Skip to content

Commit

Permalink
Fix: display heightlight point for osm and ign geocoding
Browse files Browse the repository at this point in the history
  • Loading branch information
nboisteault authored and github-actions[bot] committed Oct 17, 2024
1 parent 33fb345 commit 5e7cb7c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions assets/src/modules/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export default class Search {
var bbox = ftsGeometry.getBounds();
if (extent.intersectsBounds(bbox)) {
var lab = ftsFeat.label.replace(labrex, '<strong class="highlight">$1</strong>');
text += '<li><a href="#' + bbox.toBBOX() + '" data="' + ftsGeometry.toString() + '">' + lab + '</a></li>';
text += '<li><a href="#' + bbox.toBBOX() + '" data-wkt="' + ftsGeometry.toString() + '">' + lab + '</a></li>';
count++;
}
}
Expand Down Expand Up @@ -210,7 +210,7 @@ export default class Search {
bbox = new OpenLayers.Bounds(bbox);
if (extent.intersectsBounds(bbox)) {
var lab = address.display_name.replace(labrex, '<strong class="highlight">$1</strong>');
text += '<li><a href="#' + bbox.toBBOX() + '">' + lab + '</a></li>';
text += `<li><a href="#${bbox.toBBOX()}" data-wkt="POINT(${address.lon} ${address.lat})">${lab}</a></li>`;
count++;
}
}
Expand All @@ -232,7 +232,7 @@ export default class Search {
let count = 0;
for (const result of data.results) {
var lab = result.fulltext.replace(labrex, '<strong class="highlight">$1</strong>');
text += '<li><a href="#' + result.x + ',' + result.y + ',' + result.x + ',' + result.y + '">' + lab + '</a></li>';
text += `<li><a href="#${result.x},${result.y},${result.x},${result.y}" data-wkt="POINT(${result.x} ${result.y})">${lab}</a></li>`;
count++;
}
if (count == 0 || text == '') {
Expand Down Expand Up @@ -357,7 +357,7 @@ export default class Search {
this._map.zoomToExtent(bbox);

var feat = new OpenLayers.Feature.Vector(bbox.toGeometry().getCentroid());
var geomWKT = linkClicked.getAttribute('data');
var geomWKT = linkClicked.dataset.wkt;
if (geomWKT) {
mainLizmap.map.setHighlightFeatures(geomWKT, "wkt", "EPSG:4326");
}
Expand Down

0 comments on commit 5e7cb7c

Please sign in to comment.