How to make a text selection in my overlays? Now my overlays inactive for text selection and creates a zoom when i double-click in overlay.
Asked
Active
Viewed 768 times
1
-
Please post a link to your site. It is impossible to tell what you are doing wrong from that image. – plexer Aug 05 '10 at 04:24
2 Answers
1
Please see the document, the static function preventMapHitsAndGesturesFrom probably is what you want.
preventMapHitsAndGesturesFrom(element) Parameters:
element: Element
Return Value: None Stops click, tap, drag, and wheel events on the element from bubbling up to the map. Use this to prevent map dragging and zooming, as well as map "click" events.

Gray Young
- 41
- 4
0
You need to cancel the propagation of events on the overlay so they do not bubble up to the map. The most commmon events would be click, mousedown, mouseup, mousemove, mouseenter, mouseleave but it just depends what you want to do.
So add an event listener to your base div that contains the overlay and add:
google.maps.events.addDomListener(theDiv, theEvent, function(e) {
e.cancelBubble = true;
if (e.stopPropagation) {
e.stopPropagation();
}
});

skarE
- 5,880
- 2
- 23
- 23