Hey guys,
I have finally released my joomla component - hotspots :). Here is the
demo:
http://demo.compojoom.com/hotspots
I got few users complaining that when they click on a marker in street
mode, they don't see the infoWindow. The infoWindow opens, but in the
map plane and not the street map plane.
So, after reading the documentation about Overlays with street map:
https://code.google.com/apis/maps/documentation/javascript/services.html#StreetViewOverlays
I've corrected my createInfoWindow function to this:
createInfoWindow: function(marker, hotspot) {
return (function() {
var container = this.infoWindowToolbarActions(hotspot);
var text = new Element('div', {
style: 'width: 300px;',
html: hotspot.description
});
container.inject(text);
this.infoWindow.setOptions({
'content': text ,
'position':new google.maps.LatLng(hotspot.latitude,
hotspot.longitude )
});
var panorama = this.map.getMap().getStreetView();
if(panorama.getVisible()) {
this.infoWindow.open(panorama,marker.markerObj);
} else {
this.infoWindow.open(this.map.getMap(),marker.markerObj);
}
}.bind(this));
},
now when I'm street mode and I click the marker, the infowindow shows
in street mode. If I close the infowindow and after that close the
street mode, then click on the infowindow in map view - everything
works fine.
But if leave the infowindow open in street mode and just close the
street mode, then try to open the infowindow in the normal map view,
the browser just crashes. I've tested it with firefox and chrome.
In firefox the first time I try it, I get this message:
A script on this page may be busy, or it may have stopped responding.
You can stop the script now, open the script in the debugger, or let
the script continue.
Script:
http://maps.gstatic.com/intl/en_us/mapfiles/api-3/5/9/main.js:53
and firebug's console shows this:
uncaught exception: 2.9828892165819886e+144
The second time I try it, it just crashes...
In chrome it chrashes already on the first time.
You can test the behavior here:
http://labs.compojoom.com/index.php/hotspots
Any ideas? Am I doing anything wrong? Should I automatically destroy
the infoWindow when switching between street mode and normal map mode?