leaflet-geocoder-ban
Advanced tools
Comparing version
{ | ||
"name": "leaflet-geocoder-ban", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -35,2 +35,5 @@ /* global define, XMLHttpRequest */ | ||
}, | ||
onRemove: function (map) { | ||
map.off('click', this.collapseHack, this) | ||
}, | ||
onAdd: function (map) { | ||
@@ -43,3 +46,2 @@ var className = 'leaflet-control-geocoder-ban' | ||
this.map = map | ||
map.on('click', this.collapseHack, this) | ||
@@ -63,5 +65,2 @@ | ||
L.DomEvent.addListener(input, 'keyup', this.keyup, this) | ||
if (this.options.defaultMarkgeocode) { | ||
this.on('markgeocode', this.markGeocode, this) | ||
} | ||
@@ -77,7 +76,6 @@ L.DomEvent.disableScrollPropagation(container) | ||
} | ||
return container | ||
}, | ||
toggle: function () { | ||
if (this.container.classList.contains('leaflet-control-geocoder-ban-expanded')) { | ||
if (L.DomUtil.hasClass(this.container, 'leaflet-control-geocoder-ban-expanded')) { | ||
this.collapse() | ||
@@ -91,3 +89,3 @@ } else { | ||
if (this.geocodeMarker) { | ||
this.map.removeLayer(this.geocodeMarker) | ||
this._map.removeLayer(this.geocodeMarker) | ||
} | ||
@@ -168,3 +166,3 @@ this.input.select() | ||
}, | ||
clearResults () { | ||
clearResults: function () { | ||
while (this.alts.firstChild) { | ||
@@ -217,6 +215,6 @@ this.alts.removeChild(this.alts.firstChild) | ||
var latlng = [feature.geometry.coordinates[1], feature.geometry.coordinates[0]] | ||
this.map.setView(latlng, 14) | ||
this._map.setView(latlng, 14) | ||
this.geocodeMarker = new L.Marker(latlng) | ||
.bindPopup(feature.properties.label) | ||
.addTo(this.map) | ||
.addTo(this._map) | ||
.openPopup() | ||
@@ -223,0 +221,0 @@ } |
Sorry, the diff of this file is not supported yet
30633
0.35%734
-0.14%