-
2 Dec 2011 6:43 AM #1
Google Map InfoWindow wont close
Google Map InfoWindow wont close
Hi,
I appear to have a problem getting an infoWindow to close in a Google Map panel. It appears the close icon in the top right of the infoWindow is disabled. I can close the window in Chrome but not on an iPhone, has anyone come across this before?
There is no configuration property in the Google Maps API that allows you to make an infoWindow closable or not, this should just be default behaviour from my past experiences of using the maps API.
Thanks,
Rob
-
2 Dec 2011 9:35 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,689
- Vote Rating
- 435
But you can click on a marker? Any error? Code?
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
5 Dec 2011 4:53 AM #3
Sorry, should have posted some code for you!
Yes my Markers are clickable which displays the infoWindow as expected. Its just the infoWindow will not close when clicking the little cross icon.
After creating a Marker on my map I am registering a google maps click handler on my Marker object like so:
As you can see I am using a delegate function here as eventually I will be calling the same function from other types of Markers on my map display in which case the infoWindow will need to display different types of content.Code:google.maps.event.addListener(googlemap.unitMarker,'click', Ext.Function.bind(this._showMarkerInfoWindow, this, [googlemap.unitMarker]));
So I now have infoWindows displaying when clicking each of my Markers, they just wont close for me.Code:showMarkerInfoWindow: function(Marker) { // Unit if (Marker.untID) { var r = this.application.getCurrentGridStore().getById(Marker.untID); if (r!==undefined) { if (Marker.infoWindow==null) { var iw = new google.maps.InfoWindow({ content: this._untInfoWindowContent(Marker, r.data), disableAutoPan: false, maxWidth: 300 }); Marker.infoWindow=iw; } else { Marker.infoWindow.setContent(this._untInfoWindowContent(Marker, r.data)); } } Marker.infoWindow.open(Marker.map, Marker); } }, _untInfoWindowContent:function(marker, d) { // TODO: Change to use Ext.XTemplate? return "<div>" +"<span style='position:relative; top:-7px;left:2px;'><b>"+d.UnitName+"</b></span>"+"<br/>" +"<br/>" +"<b>"+d.EventDTLocalDisplay+"</b>: " +d.Location+"<br/>" +"</div>"; }
I even tried adding a listener to the infoWindow's closeclick event which is fired when the close icon is clicked and calling the infoWindow close function:
But this doesn't make any different.Code:google.maps.event.addListener(Marker.infoWindow, 'closeclick', function() { Marker.infoWindow.close(); console.log('closeclick'); });
The infoWindows do close correctly in Chrome and Safari on my desktop machine, but not on an iPhone 3GS running iOS 5.0
Any ideas? Are there any sample apps that use Google Maps with clickable Markers and infoWindows?
Thanks
-
5 Dec 2011 10:43 PM #4
Infowindow not closing, click events not working maybe?
Infowindow not closing, click events not working maybe?
I'm also having this problem. Not only can I not close an infowindow, but my infowindow has a link with an onclick event that opens a new view. Works in Chrome, not in Safari on iOS 5.
-
6 Dec 2011 4:13 AM #5
I have the same problem. Nothing happens when I tap the cross.
-
14 Dec 2011 2:00 AM #6
I had the same problem, with the map and with all <a> html links. You can see how I've solved here:
http://www.sencha.com/forum/showthread.php?154101-Can-t-click-on-map-buttons.
Greetings.


Reply With Quote