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?

AlfaTeK
  • 7,487
  • 14
  • 49
  • 90
  • possible duplicate of [Is it possible to dispatchEvent() a mouse click to a element?](http://stackoverflow.com/questions/5352709/is-it-possible-to-dispatchevent-a-mouse-click-to-a-input-type-text-element) – Paul Sweatte Mar 12 '14 at 22:49
  • Not a duplicate. This question relates specifically to google-maps-api-3 and not a generic javascript/DOM question – AlfaTeK Mar 13 '14 at 15:22
  • The question itself includes the answer to your question. – Paul Sweatte Mar 13 '14 at 18:20

1 Answers1

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