Yohan Boniface avatar Yohan Boniface committed 8d210a5

Handle minimap option (cf yohanboniface/Leaflet.Storage#31)

Comments (0)

Files changed (7)

 [submodule "leaflet_storage/static/edit_in_osm"]
 	path = leaflet_storage/static/edit_in_osm
 	url = git://github.com/yohanboniface/Leaflet.EditInOSM.git
+[submodule "leaflet_storage/static/minimap"]
+	path = leaflet_storage/static/minimap
+	url = git://github.com/Norkart/Leaflet-MiniMap.git

leaflet_storage/forms.py

         ("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),
+        ("miniMap", _("Do you want to display a minimap?"), False),
         ("editInOSMControl", _("Do you want to display control with links to edit in OSM?"), False),
         ("enableMarkerDraw", _("Do you want to enable Marker drawing?"), True),
         ("enablePolylineDraw", _("Do you want to enable Polyline drawing?"), True),

leaflet_storage/templates/leaflet_storage/css.html

 <![endif]-->
 <link rel="stylesheet" href="{{ STATIC_URL }}draw/dist/leaflet.draw.css" />
 <link rel="stylesheet" href="{{ STATIC_URL }}edit_in_osm/Leaflet.EditInOSM.css" />
+<link rel="stylesheet" href="{{ STATIC_URL }}minimap/src/Control.MiniMap.css" />
 <link rel="stylesheet" href="{{ STATIC_URL }}storage/src/css/storage.css" />

leaflet_storage/templates/leaflet_storage/js.html

 <script src="{{ STATIC_URL }}draw/dist/leaflet.draw-src.js"></script>
 <script src="{{ STATIC_URL }}hash/leaflet-hash.js"></script>
 <script src="{{ STATIC_URL }}edit_in_osm/Leaflet.EditInOSM.js"></script>
+<script src="{{ STATIC_URL }}minimap/src/Control.MiniMap.js"></script>
 <script src="{{ STATIC_URL }}storage/src/js/leaflet.storage.core.js"></script>
 <script src="{{ STATIC_URL }}storage/src/js/leaflet.storage.xhr.js"></script>
 <script src="{{ STATIC_URL }}storage/src/js/leaflet.storage.forms.js"></script>

leaflet_storage/templates/leaflet_storage/map_fragment.html

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

leaflet_storage/templates/leaflet_storage/map_init.html

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

leaflet_storage/views.py

             'jumpToLocationControl': 0,
             'editInOSMControl': 0,
             'scaleControl': 0,
+            'miniMap': 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.