We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7fe22d0 commit b7fa030Copy full SHA for b7fa030
src/components/interactive-map.js
@@ -215,16 +215,20 @@ function onPointerMove(event) {
215
if (interactiveLayerIds || onHover) {
216
features = getFeatures.call(this, event.point);
217
}
218
- if (onHover) {
219
- // backward compatibility: v3 `onHover` interface
220
- event.features = features;
221
- onHover(event);
222
- }
223
224
const isHovering = Boolean(interactiveLayerIds && features && features.length > 0);
225
const isEntering = isHovering && !this.state.isHovering;
226
const isExiting = !isHovering && this.state.isHovering;
227
+ if (onHover || isEntering) {
+ event.features = features;
+
+ // backward compatibility: v3 `onHover` interface
+ if (onHover) {
228
+ onHover(event);
229
+ }
230
231
232
if (isEntering) {
233
onEvent.call(this, 'onMouseEnter', event);
234
0 commit comments