Skip to content

Commit

Permalink
Merge pull request #1338 from NSUWAL123/fix-screen-blank-issue
Browse files Browse the repository at this point in the history
fix vectorLayer: remove hover effect code leading screen blank issue
  • Loading branch information
NSUWAL123 authored Mar 12, 2024
2 parents 9eb57a3 + 0f81fd9 commit ba44cf2
Showing 1 changed file with 0 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -360,24 +360,6 @@ const VectorLayer = ({
vectorLayer.setProperties(layerProperties);
}, [map, vectorLayer, layerProperties]);

useEffect(() => {
if (!map) return;
map.on('pointermove', function (e) {
const pixel = map.getEventPixel(e.originalEvent);
const features = map.getFeaturesAtPixel(pixel);
if (features.length > 0) {
document.getElementById('ol-map').style.cursor = 'pointer';
} else {
document.getElementById('ol-map').style.cursor = 'default';
}
});

// Clean up
return () => {
map.setTarget(null);
};
}, [map]);

// style on hover
useEffect(() => {
if (!map) return null;
Expand Down

0 comments on commit ba44cf2

Please sign in to comment.