diff --git a/combo/apps/maps/static/js/combo.map.js b/combo/apps/maps/static/js/combo.map.js index 90a2f076..9329b386 100644 --- a/combo/apps/maps/static/js/combo.map.js +++ b/combo/apps/maps/static/js/combo.map.js @@ -143,8 +143,9 @@ $(function() { zoomOutTitle: gettext('Zoom out') }).addTo(map); } + var gps_control = null; if (L.Control.Gps && $map_widget.data('include-geoloc-button')) { - var gps_control = new L.Control.Gps({ + gps_control = new L.Control.Gps({ position: map_controls_position, tooltipTitle: gettext('Display my position')}); map.addControl(gps_control); @@ -163,6 +164,9 @@ $(function() { return; } map.setView(e.latlng, map_options.zoom); + if (gps_control) { + gps_control.addLayer(); + } }); map.on('locationerror', function(e) { $map_widget.removeClass('waiting-for-geolocation');