Commits

Yohan Boniface committed f3e0c34

Handle scaleControl option (see yohanboniface/Leaflet.Storage#34)

  • Participants
  • Parent commits 9c116c9

Comments (0)

Files changed (4)

File leaflet_storage/forms.py

         ("jumpToLocationControl", _("Do you want to display the 'quick search' control?"), True),
         ("homeControl", _("Do you want to display the 'back to home page' control?"), True),
         ("embedControl", _("Do you want to display the embed control?"), True),
+        ("scaleControl", _("Do you want to display the scale control?"), True),
         ("locateOnLoad", _("Do you want to locate user on load?"), False),
         ("editInOSMControl", _("Do you want to display control with links to edit in OSM?"), False),
         ("enableMarkerDraw", _("Do you want to enable Marker drawing?"), True),

File leaflet_storage/templates/leaflet_storage/map_fragment.html

             'homeControl': false,
             'locateControl': false,
             'jumpToLocationControl': false,
-            'editInOSMControl': false
+            'editInOSMControl': false,
+            'scaleControl': false
         }
         new L.Storage.Map("map_{{ map.pk }}", map_fragment_settings);
     </script>

File leaflet_storage/templates/leaflet_storage/map_init.html

             "enableMarkerDraw": {{ enableMarkerDraw }},
             "enablePolylineDraw": {{ enablePolylineDraw }},
             "enablePolygonDraw": {{ enablePolygonDraw }},
-            "editInOSMControl": {{ editInOSMControl }}
+            "editInOSMControl": {{ editInOSMControl }},
+            "scaleControl": {{ scaleControl }}
         }
         {% if locateOnLoad %}
             map_settings['locate'] = {"setView": true}

File leaflet_storage/views.py

             'locateControl': 0,
             'jumpToLocationControl': 0,
             'editInOSMControl': 0,
+            'scaleControl': 0,
         }
         query_string = "&".join("%s=%s" % (k, v) for k, v in qs_kwargs.iteritems())
         iframe_url = "%s?%s" % (iframe_url, query_string)