See http://www.geoffschultz.org/Test/infobox.html
Click on the map to create an InfoBox at the cursor.
Note that this works properly on Safari on Windows 7, FireFox, IE and
Chrome.
-- Geoff
Thanks for the heads up. This used to work as expected on the iPad,
but a change in iOS seems to have affected the behavior. Have you
tried on Android?
Gary
On Dec 8, 10:22 am, GeoffSchultz <geoffrey.w.schu...@gmail.com> wrote:
> On an iPad running Safari & iOS 5.0.1, clicks to an InfoBox are passed
> through to the map and aren't received by the InfoBox. The [X] close
> box doesn't work either.
>
> Seehttp://www.geoffschultz.org/Test/infobox.html
-- Geoff
P.S. I don't have any Android devices.
I have a similar problem on my real estate map on the iPhone but I've
worked around it by eliminating a map click handler that closes the
InfoBox (so you have to close it by clicking the close box). It's not
perfect since you can click markers underneath the InfoBox.
I'm not sure if this is a bug in iOS/Safari, the Maps API, or what.
The technique I use to prevent the event propagation works with all
others browsers I'm aware of.
Gary
On Dec 10, 11:25 am, GeoffSchultz <geoffrey.w.schu...@gmail.com>
wrote:
> My issue is that I have forms which are displayed within the InfoBox
> and none of the checkboxes, buttons, [X] and other items work. As it
> turns out, I do have a click handler on the map. If you want to see
> how I'm probably using InfoBoxes in ways that you never imagined, you
> can look athttp://www.geoffschultz.org/weather_mapin particular
I use the same technique which handles most of my FYI InfoBoxes where
a click received to the map closes it. Unfortunately I'm using an
InfoBox with a form with checkboxes, dropdowns and a variety of
buttons, and none of that works. Maybe I'll just explore a different
InfoSomething to use.
I've looked at your code and there's click/close event handler code
that I really don't understand. Where the heck does "e" come from in
these functions? I'm an ex-operating systems guy, but a newbie/hacker
when it comes to JS. Unfortunately I have no idea as how to debug JS
on on iPad...
-- Geoff
-- Geoff
-- Geoff
On Dec 17, 11:29 am, GeoffSchultz <geoffrey.w.schu...@gmail.com>
wrote:
I checked InfoBubble on the iPad and found that it works as expected.
Here's the code that the use to handle events:
/**
* Add events to stop propagation
* @private
*/
InfoBubble.prototype.addEvents_ = function() {
// We want to cancel all the events so they do not go to the map
var events = ['mousedown', 'mousemove', 'mouseover', 'mouseout',
'mouseup',
'mousewheel', 'DOMMouseScroll', 'touchstart', 'touchend',
'touchmove',
'dblclick', 'contextmenu', 'click'];
var bubble = this.bubble_;
this.listeners_ = [];
for (var i = 0, event; event = events[i]; i++) {
this.listeners_.push(
google.maps.event.addDomListener(bubble, event, function(e) {
e.cancelBubble = true;
if (e.stopPropagation) {
e.stopPropagation();
}
})
);
}
};
I must admit that I don't understand why your code and the InfoBubble
code saves the handlers and removes them before doing a setMap(null)
on the InfoBox. According to what I've read elsewhere (and from a
Google employee), all of the listeners associated with an object are
removed when the setMap(null) is done. It seems like this just
duplicates that functionality.
Anyhow, I'm a happy camper. If/when you update your code to handle
this, I'll be glad to pull an "official" version down so that I stay
on track.
-- Geoff
Send me your modified file so I can see exactly what changes you made.
Gary
Gary