diff --git a/map_location/fields.py b/map_location/fields.py index d6248cc..136ac1a 100644 --- a/map_location/fields.py +++ b/map_location/fields.py @@ -28,6 +28,7 @@ class MapLocationWidget(Widget): def get_context(self, name, value, attrs): context = super().get_context(name, value, attrs) + context['id'] = context['widget']['attrs']['id'] context['map_options'] = json.dumps( context['widget']['attrs'].get('options')) return context diff --git a/map_location/templates/forms/map-location.html b/map_location/templates/forms/map-location.html index 715b6a3..7afb189 100644 --- a/map_location/templates/forms/map-location.html +++ b/map_location/templates/forms/map-location.html @@ -1,8 +1,8 @@