maps: display location pointer whenever device location is known (#22819)

This commit is contained in:
Frédéric Péters 2018-03-27 12:00:13 +02:00
parent bf1d616c0f
commit bd7b7e2692
2 changed files with 6 additions and 1 deletions

View File

@ -82,9 +82,13 @@ L.Control.Gps = L.Control.extend({
return this._currentLocation;
},
addLayer: function() {
this._map.addLayer(this._gpsMarker);
},
activate: function() {
this._isActive = true;
this._map.addLayer(this._gpsMarker);
this.addLayer();
this._map.locate({
enableHighAccuracy: true,
watch: true,

View File

@ -87,6 +87,7 @@ $(window).on('load', function() {
$map_widget.trigger('set-geolocation', e.latlng);
});
$map_widget.parent().parent().find('label').addClass('activity')
gps_control.addLayer();
map.locate({timeout: 10000, maximumAge: 300000, enableHighAccuracy: false});
}