I am using the Infobox plugin for Google Maps V3 API. http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/docs/reference.html
Problem: When I rightclick on the infobox div, nothing happens. Same goes for any div that is the child of the parent infobox div. However I have an input box that contains some text that I want to be able to select and rightclick copy.
How can this be done if I cannot rightclick on it? More importantly, how can I enable right clicking?
Example
http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/examples/infobox-basic.html
JS Code Does not work
var infoboxOptions = {
content: boxText,
disableAutoPan: true,
maxWidth: 0,
pixelOffset: new google.maps.Size(0, 0),
zIndex: null,
infoBoxClearance: new google.maps.Size(5, 5),
closeBoxURL: '',
isHidden: true,
pane: "floatPane",
enableEventPropagation: false,
contextmenu: true
};
I modifed the infobox.js code to get it working.
Changed this:
this.contextListener_ = google.maps.event.addDomListener(this.div_, "contextmenu", ignoreHandler);
to this:
this.contextListener_ = google.maps.event.addDomListener(this.div_, "contextmenu", cancelHandler);
DISCLAIMER: this may have other ill effects I am not aware of as I didn't test it thoroughly, but it works in my case.
Just add "contextmenu: true" to the set of options
I pulled this from the infobox.js source:
- @property {boolean} enableEventPropagation Propagate mousedown, click, dblclick,
- and contextmenu events in the InfoBox (default is false to mimic the behavior
- of a google.maps.InfoWindow). Set this property to true if the InfoBox
- is being used as a map label. iPhone note: This property setting has no effect; events are
- always propagated.
Looks like setting your enableEventPropagation property to true should do the trick!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With