Improve user popups on friend/nearby mapper maps.

This commit is contained in:
Tom Hughes 2010-03-11 18:23:22 +00:00
parent 910937ae4b
commit dcbc807526
7 changed files with 62 additions and 48 deletions

View file

@ -96,7 +96,8 @@ function addMarkerToMap(position, icon, description) {
markers.addMarker(marker);
if (description) {
marker.events.register("click", marker, function() { openMapPopup(marker, description) });
marker.events.register("mouseover", marker, function() { openMapPopup(marker, description) });
marker.events.register("mouseout", marker, function() { closeMapPopup() });
}
return marker;
@ -169,10 +170,9 @@ function addBoxToMap(boxbounds) {
function openMapPopup(marker, description) {
closeMapPopup();
popup = new OpenLayers.Popup.AnchoredBubble("popup", marker.lonlat, null,
description, marker.icon, true);
popup = new OpenLayers.Popup.FramedCloud("popup", marker.lonlat, null,
description, marker.icon, true);
popup.setBackgroundColor("#E3FFC5");
popup.autoSize = true;
map.addPopup(popup);
return popup;