Commits

Yohan Boniface committed f3e0c34

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

Comments (0)

Files changed (4)

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),

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>

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}

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)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.