Remove highlight from map when clicking on a feature
This commit is contained in:
parent
8642e4c1f3
commit
ca07fe853c
1 changed files with 3 additions and 0 deletions
|
@ -54,6 +54,9 @@ OSM.Query = function(map) {
|
||||||
$(this).removeClass("selected");
|
$(this).removeClass("selected");
|
||||||
})
|
})
|
||||||
.on("click", ".query-results li.query-result", function (e) {
|
.on("click", ".query-results li.query-result", function (e) {
|
||||||
|
var geometry = $(this).data("geometry")
|
||||||
|
if (geometry) map.removeLayer(geometry);
|
||||||
|
|
||||||
if (!$(e.target).is('a')) {
|
if (!$(e.target).is('a')) {
|
||||||
$(this).find("a").simulate("click", e);
|
$(this).find("a").simulate("click", e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue