Update prettier version
This commit is contained in:
parent
c49b821db7
commit
25429b3c24
42 changed files with 2480 additions and 2490 deletions
|
|
@ -2,30 +2,30 @@ BR.Search = L.Control.Geocoder.extend({
|
|||
options: {
|
||||
geocoder: new L.Control.Geocoder.LatLng({
|
||||
next: new L.Control.Geocoder.Nominatim({
|
||||
serviceUrl: 'https://nominatim.openstreetmap.org/'
|
||||
serviceUrl: 'https://nominatim.openstreetmap.org/',
|
||||
}),
|
||||
sizeInMeters: 800
|
||||
sizeInMeters: 800,
|
||||
}),
|
||||
position: 'topleft',
|
||||
shortcut: {
|
||||
search: 70 // char code for 'f'
|
||||
}
|
||||
search: 70, // char code for 'f'
|
||||
},
|
||||
},
|
||||
|
||||
initialize: function(options) {
|
||||
initialize: function (options) {
|
||||
L.Control.Geocoder.prototype.initialize.call(this, options);
|
||||
L.setOptions(this, {
|
||||
// i18next.t will only return 'undefined' if it is called in a static context
|
||||
// (e.g. when added directly to "options:" above), so we have to call it here
|
||||
placeholder: i18next.t('map.geocoder-placeholder')
|
||||
placeholder: i18next.t('map.geocoder-placeholder'),
|
||||
});
|
||||
|
||||
L.DomEvent.addListener(document, 'keydown', this._keydownListener, this);
|
||||
},
|
||||
|
||||
markGeocode: function(result) {
|
||||
markGeocode: function (result) {
|
||||
this._map.fitBounds(result.geocode.bbox, {
|
||||
maxZoom: 17
|
||||
maxZoom: 17,
|
||||
});
|
||||
|
||||
this.clear();
|
||||
|
|
@ -33,22 +33,22 @@ BR.Search = L.Control.Geocoder.extend({
|
|||
interactive: false,
|
||||
color: 'red',
|
||||
opacity: 1,
|
||||
weight: 3
|
||||
weight: 3,
|
||||
}).addTo(this._map);
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
clear: function() {
|
||||
clear: function () {
|
||||
if (this._geocodeMarker) {
|
||||
this._map.removeLayer(this._geocodeMarker);
|
||||
}
|
||||
},
|
||||
|
||||
_keydownListener: function(e) {
|
||||
_keydownListener: function (e) {
|
||||
if (BR.Util.keyboardShortcutsAllowed(e) && e.keyCode === this.options.shortcut.search) {
|
||||
$('#map .leaflet-control-geocoder')[0].dispatchEvent(new MouseEvent('mousedown'));
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue