maps: display location pointer whenever device location is known (#31078)
This commit is contained in:
parent
0e224961b8
commit
08182efe31
|
@ -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');
|
||||
|
|
Loading…
Reference in New Issue