diff options
-rw-r--r-- | htdocs/mapscript.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/htdocs/mapscript.js b/htdocs/mapscript.js index c70006f..73c7fb0 100644 --- a/htdocs/mapscript.js +++ b/htdocs/mapscript.js @@ -346,6 +346,16 @@ function search(e) { results.appendChild(el); } break; + case "Polygon": + regex = new RegExp(query, 'i'); + + if (item.feature.properties.name.match(regex)) { + el = document.createElement("li"); + zpos = layers._layers[i].layer._layers[item._leaflet_id].getCenter(); + el.innerHTML = "[" + layers._layers[i].name + "] " + '<a href="#" onclick="latLng2 = L.latLng(' + Math.round(zpos.lat) + ',' + Math.round(zpos.lng) + '); jump_to(latLng2, ' + polyconf_show_cities + '); return false;">' + htmlEntities(item.feature.properties.name) + "</a>"; + results.appendChild(el); + } + break; default: break; } |