-
Notifications
You must be signed in to change notification settings - Fork 287
Open
Description
I'm trying to create a form using the code in the docs:
Code:
from django import forms
from leaflet.forms.widgets import LeafletWidget
class WeatherStationForm(forms.ModelForm):
class Meta:
model = WeatherStation
fields = ('name', 'geom')
widgets = {'geom': LeafletWidget()}
... and in my HTML template
{% load leaflet_tags %}
<html>
<head>
{% leaflet_js plugins="forms" %}
{% leaflet_css plugins="forms" %}
{{ form.media }} <!-- Even though this line does not appear in the docs, it showed an error without it, as issue #343 -->
</head>
<body>
<h1>Edit {{ object }}</h1>
<form method="POST">
{{ form }}
<input type="submit"/>
</form>
</body>
</html>
However, the LeafletWidget always appears in black (no tile layer). There doesn't seem to be any reference to the OpenStreetMap layer anywhere either. Does that mean that I have to add it manually with javascript?
Also, it seems to ignore the settings defined in the settings.py file, i.e. the ATTRIBUTION_PREFIX
parameter.
Metadata
Metadata
Assignees
Labels
No labels