fix: only use location bias in search for close zoom
And add a lower location bias
This commit is contained in:
parent
6396ee5e58
commit
375ef69b1b
2 changed files with 3 additions and 1 deletions
|
@ -58,7 +58,7 @@
|
||||||
"leaflet.locatecontrol": "^0.79.0",
|
"leaflet.locatecontrol": "^0.79.0",
|
||||||
"leaflet.markercluster": "^1.5.3",
|
"leaflet.markercluster": "^1.5.3",
|
||||||
"leaflet.path.drag": "0.0.6",
|
"leaflet.path.drag": "0.0.6",
|
||||||
"leaflet.photon": "0.9.0",
|
"leaflet.photon": "0.9.1",
|
||||||
"osmtogeojson": "^3.0.0-beta.3",
|
"osmtogeojson": "^3.0.0-beta.3",
|
||||||
"simple-statistics": "^7.8.3",
|
"simple-statistics": "^7.8.3",
|
||||||
"togpx": "^0.5.4",
|
"togpx": "^0.5.4",
|
||||||
|
|
|
@ -1237,6 +1237,7 @@ U.StarControl = L.Control.extend({
|
||||||
U.Search = L.PhotonSearch.extend({
|
U.Search = L.PhotonSearch.extend({
|
||||||
initialize: function (map, input, options) {
|
initialize: function (map, input, options) {
|
||||||
this.options.placeholder = L._('Type a place name or coordinates')
|
this.options.placeholder = L._('Type a place name or coordinates')
|
||||||
|
this.options.location_bias_scale = 0.5
|
||||||
L.PhotonSearch.prototype.initialize.call(this, map, input, options)
|
L.PhotonSearch.prototype.initialize.call(this, map, input, options)
|
||||||
this.options.url = map.options.urls.search
|
this.options.url = map.options.urls.search
|
||||||
if (map.options.maxBounds) this.options.bbox = map.options.maxBounds.toBBoxString()
|
if (map.options.maxBounds) this.options.bbox = map.options.maxBounds.toBBoxString()
|
||||||
|
@ -1276,6 +1277,7 @@ U.Search = L.PhotonSearch.extend({
|
||||||
// Only numbers, abort.
|
// Only numbers, abort.
|
||||||
if (/^[\d .,]*$/.test(this.input.value)) return
|
if (/^[\d .,]*$/.test(this.input.value)) return
|
||||||
// Do normal search
|
// Do normal search
|
||||||
|
this.options.includePosition = this.map.getZoom() > 10
|
||||||
L.PhotonSearch.prototype.search.call(this)
|
L.PhotonSearch.prototype.search.call(this)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue