Exemplo n.º 1
0
class WorldBorderForm(forms.Form):

    world = forms.MultiPolygonField(
        widget = forms.OSMWidget(
            attrs = {
                'map_width': 1920,
                'map_height': 600,
            }
        )
    )
class PolygonForm(forms.ModelForm):
	class Meta:
		model = Polygon
		
		fields = ['name', 'geom', 'description', 'theme', 'popup_image', 'popup_audio_file', 'popup_audio_title', 'popup_audio_slug', 'banner_image', 'banner_image_copyright', 'weight', 'tags', 'published',]

		help_texts = {
			'popup_audio_title': _('If you have added an audio file to the popup, make sure you give it a title as well'),
			'description': _('A short description of the location.')
		}

	geom = forms.MultiPolygonField(widget=MapBoxGLWidget(attrs={'config': config}), label=_('Polygon'))
Exemplo n.º 3
0
class PartOfCityAdminForm(forms.ModelForm):
    area = geoforms.MultiPolygonField(
        widget=geoforms.OSMWidget(attrs={
            'default_lat': 39.9526,
            'default_lon': -75.1652,
            'default_zoom': 12
        }),
        required=False)

    class Meta:
        model = PartOfCity
        fields = '__all__'
Exemplo n.º 4
0
class MapItemAdminForm(forms.ModelForm):
    summary = forms.CharField(widget=CKEditorWidget(), required=False)
    description = forms.CharField(widget=CKEditorWidget(), required=False)
    location1 = geoforms.MultiPointField(
        widget=geoforms.OSMWidget(attrs={
            'default_lat': 39.9526,
            'default_lon': -75.1652,
            'default_zoom': 12
        }),
        required=False)
    location2 = geoforms.MultiPolygonField(
        widget=geoforms.OSMWidget(attrs={
            'default_lat': 39.9526,
            'default_lon': -75.1652,
            'default_zoom': 12
        }),
        required=False)
    info_sources = forms.CharField(widget=CKEditorWidget(), required=False)

    class Meta:
        model = MapItem
        fields = '__all__'
Exemplo n.º 5
0
 class PolygonForm(forms.Form):
     p = forms.MultiPolygonField()
Exemplo n.º 6
0
class MyGeoForm(forms.Form):
    class Meta:
        model = models.WorldBorder

    mpoly = forms.MultiPolygonField(widget=
        forms.OSMWidget(attrs={'map_width': 800, 'map_height': 500}))
Exemplo n.º 7
0
class WorldBorderForm(forms.Form):
    world = forms.MultiPolygonField(widget = 
        forms.OSMWidget(attrs = {'map_width': 1024, 'map_height': 600, 'default_zoom' : 18, 'default_lat' : 42.36, 'default_lon' : 288.94}))