After using qgis2web to export a map, I am looking to modify the qgis2web.js file to have the possibility to select (highlight) features on click and keep them selected until I click somewhere else (example [here]) and to display the pop up info under the same circumstances. I am new to coding so any help is most welcomed.
map.on('pointermove', function(evt) {
onPointerMove(evt);
});
map.on('singleclick', function(evt) {
onSingleClick(evt);
});
if I add if front of this
`map.on('click', function (evt) {
var pixel = map.getEventPixel(evt.originalEvent);
displayFeatureInfo(evt.pixel);
})
map.on('pointermove', function(evt) {
if (evt.dragging) {
return;
}
var pixel = map.getEventPixel(evt.originalEvent);
displayFeatureInfo(pixel);
});`
It allows me to do that however the feature does not remain highlighted when dragging the map.