【发布时间】:2019-08-11 12:51:12
【问题描述】:
我想知道是否有办法知道 OSMWidget 坐标何时更改,我假装在经度和纬度字段上反映此更改。我有以下表格:
from django.contrib.gis import forms
from .models import Branch
class BranchCreateForm(forms.Form):
name = forms.CharField(label ="Name", max_length=120)
image_facade = forms.ImageField( label="Image Facade")
longitude = forms.DecimalField(label = "Latitude", max_digits=9, decimal_places=6)
latitude = forms.DecimalField(label = "Longitude", max_digits=9, decimal_places=6)
location = forms.PointField(
widget=forms.OSMWidget(
attrs={'map_width': 600,
'map_height': 400,
'template_name': 'gis/openlayers-osm.html',
'default_lat': 42.1710962,
'default_lon': 18.8062112,
'default_zoom': 6}))
【问题讨论】:
标签: python django django-forms geodjango