0

I have a marker with a square image. I'm trying to add a custom overlay (a baloon like shape) that overlaps a bit with the marker. The overlay is an image with an ALT tag that I want to appear.

I want the custom overlay to be behind the marker. For that I added the custom overlay to the map pane = overlayshadow. The problem is that when I use that mapPane the DOM event (mouseover) that triggers the ALT title being shown doesn't appear.

Using mapPane = overlayImage and controling z-Index is a big problem because GMaps seems to use random zIndex to markers that can be a positive or negative integer. The alternative I have is to use something like zIndex -2000000 but that is still a bit "hacky".

Is there any way to use overlayShadow and still capture the DOM events?

3

1 Answer 1

0
    let OverlayView = new google.maps.OverlayView();
    OverlayView.setMap(mapRef.current);
    OverlayView.getPanes().mapPane.style.zIndex = 105
    OverlayView.getPanes().markerLayer.style.zIndex = 106

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.