Hi Everyone,
we're just about to release this into the wild,
www.360cities.net:7000/map
I know there are a few issues with it but I'm concerned about one
specifically, that we haven't been able to fix. when you mouseover one
of the pins, you get a popup image/map thumb. but this popup doesn't
always disappear.... if you mouse over really fast, it sometimes stays
there, and the popup doesn't disappear until you mouseover another
one. It's a big drag and it's something I was hoping to fix a while
ago but we just can't figure it out.
Any ideas? Perhaps we're missing something simple....
The code below places the markers on the map and assigns rollover /
out / click behavior to them.
previewPlace( place ); generates the code in the preview popup.
The popup is hidden on mouse out of the popup, the pin, and mouse over
of info window panos (and running a new search) but it is still a
little sticky.
------------------------------------------------
function placeMarkers( places ) {
var latlng = new GLatLng( 0, 0 );
var hoverMarker = new PdMarker( latlng,
{ icon:icons.rolloverIcon } );
hoverMarker.id = 'rolloverMarker';
map.addOverlay( hoverMarker );
hoverMarker.hide();
var latlng = new GLatLng( 0, 0 );
var currentMarker = new GMarker( latlng,
{ icon:icons.currentMarker } );
currentMarker.id = 'currentMarker';
map.addOverlay( currentMarker );
currentMarker.hide();
authorBounds = new GLatLngBounds();
places.array.forEach( function( place, index ) {
latlng = place.latlng = new GLatLng( place.latitude,
place.longitude );
var marker = place.marker = new GMarker( latlng,
{ icon:icons.base } );
marker.id = place.marker;
map.addOverlay( marker );
GEvent.addListener(marker, "mouseover", function() {
previewPlace( place );
$('#resultsList a').removeClass('hover');
$('#result_'+place.handle).addClass('hover');
hoverMarker.setLatLng( marker.getLatLng() );
//hoverMarker.topMarkerZIndex();
hoverMarker.show();
});
GEvent.addListener( marker, 'click', function() {
if( place.type == 'area' ) {
openCityInfoWindow( place );
}
else {
openPlaceInfoWindow( place );
}
hoverMarker.hide();
marker.hide();
currentMarker.setLatLng( marker.getLatLng() );
currentMarker.show();
});
GEvent.addListener( hoverMarker, 'click', function() {
//hoverMarker.restoreMarkerZIndex();
//hoverMarker.hide();
marker.click();
marker.hide();
currentMarker.setLatLng( marker.getLatLng() );
currentMarker.show();
previewPlace();
hoverMarker.hide();
});
GEvent.addListener(hoverMarker, "mouseout", function() {
previewPlace();
hoverMarker.hide();
marker.show();
$('#result_'+place.handle).removeClass('hover');
});
GEvent.addListener(marker, "mouseout", function(callFrom)
{
if(callFrom == 'result')
{
previewPlace();
hoverMarker.hide();
marker.show();
}
});
}
thanks :)
Jeffrey Martin
www.360cities.net
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---