Hey there,

I was working with the tooltip tutorials provided by Mike Williams at:

http://econym.org.uk/gmap/tooltips4.htm

and I had one question that I kept running into.  If i take this
example, and align my map window so that the marker is close to the
right border, and then try mousing over it, the tooltip would go off
the screen, when the behavior i've been trying to create is to push
the marker to flip up on the left side then of that particular
marker.

I'm assuming i can use the point to see how close it is to the edge,
along with the new GControlPosition to set it to the top right, and
offset via that way.. but really not sure..

Could anyone offer some insite on this please?

Here's the function taht i've pulled from Mike Williams' site:
function showTooltip(marker) {
        tooltip.innerHTML = marker.tooltip;
        var point=map.getCurrentMapType().getProjection().fromLatLngToPixel
(map.fromDivPixelToLatLng(new GPoint(0,0),true),map.getZoom());
        var offset=map.getCurrentMapType().getProjection().fromLatLngToPixel
(marker.getPoint(),map.getZoom());
        var anchor=marker.getIcon().iconAnchor;
        var width=marker.getIcon().iconSize.width;
        var height=tooltip.clientHeight;
        var pos = new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(offset.x
- point.x - anchor.x + width, offset.y - point.y -anchor.y -height));
        pos.apply(tooltip);
        tooltip.style.visibility="visible";
      }

Thank you
-Pete

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to