Refactor to PointerEvents (#9620)

This commit is contained in:
Florian Bischof
2025-05-06 21:11:43 +02:00
committed by GitHub
parent 97362a7309
commit e9c66955c4
49 changed files with 481 additions and 710 deletions

View File

@ -53,10 +53,10 @@
markers.removeLayer(marker);
} else {
marker = new Marker(getRandomLatLng(map.getBounds()))
.on('mouseover', () => {
.on('pointerover', () => {
marker.setZIndexOffset(10000);
})
.on('mouseout', () => {
.on('pointerout', () => {
marker.setZIndexOffset(0);
})
.addTo(markers);

View File

@ -129,8 +129,8 @@
function onEachFeature(feature, layer) {
layer.on({
mouseover: highlightFeature,
mouseout: resetHighlight,
pointerover: highlightFeature,
pointerout: resetHighlight,
click: zoomToFeature
});
}