maps: add possibility to have a map without geolocation button (#24571)

This commit is contained in:
Frédéric Péters 2018-06-15 11:32:45 +02:00
parent 1e529e134d
commit 16f84f464c
2 changed files with 2 additions and 1 deletions

View File

@ -104,7 +104,7 @@ $(function() {
if (map_options.maxZoom != map_options.minZoom) {
new L.Control.Zoom({position: map_controls_position}).addTo(map);
}
if (L.Control.Gps) {
if (L.Control.Gps && $map_widget.data('include-geoloc-button')) {
var gps_control = new L.Control.Gps({position: map_controls_position});
map.addControl(gps_control);
}

View File

@ -6,6 +6,7 @@
data-max-zoom="{{ max_zoom }}" data-init-lat="{{ init_lat }}"
data-init-lng="{{ init_lng }}" data-geojson-url="{{ geojson_url }}"
data-tile-urltemplate="{{ tile_urltemplate}}" data-map-attribution="{{ map_attribution}}"
data-include-geoloc-button="true"
{% if group_markers %}data-group-markers="1"{% endif %}
{% if max_bounds.corner1.lat %}
data-max-bounds-lat1="{{ max_bounds.corner1.lat }}"