Hello,
1) I've implemented own overlay with acts as "tooltip".
function ToolTip(marker, html, width)
{
this.html_ = html;
this.width_ = (width ? width + 'px' : 'auto');
this.marker_ = marker;
}
ToolTip.prototype = new GOverlay;
ToolTip.prototype.initialize = function(map)
{
var div = document.createElement('div');
div.style.display = 'none';
map.getPane(G_MAP_FLOAT_PANE).appendChild(div);
this.map_ = map;
this.container_ = div;
}
ToolTip.prototype.remove = function()
{
this.container_.parentNode.removeChild(this.container_);
}
ToolTip.prototype.copy = function()
{
return new ToolTip(this.html_);
}
ToolTip.prototype.redraw = function(force)
{
if(!force)
{
return;
}
var pixelLocation = this.map_.fromLatLngToDivPixel
(this.marker_.getPoint());
this.container_.innerHTML = this.html_;
this.container_.style.position = 'absolute';
xpos = pixelLocation.x + 16;
this.container_.style.left = xpos + 'px';
ypos = pixelLocation.y + 16;
this.container_.style.top = ypos + 'px';
this.container_.style.width = this.width_;
this.container_.style.font = '10px Verdana';
this.container_.style.border = '1px solid #b6a700';
this.container_.style.background = '#fffbce';
this.container_.style.padding = '4px';
//this.container_.style.opacity = '0.7';
this.container_.style.whiteSpace = 'nowrap';
if(this.width_ != 'auto')
{
this.container_.style.overflow = 'hidden';
}
this.container_.style.display = 'block';
}
GMarker.prototype.ToolTipInstance = null;
GMarker.prototype.openToolTip = function(content)
{
if(this.ToolTipInstance == null)
{
this.ToolTipInstance = new ToolTip(this, content);
map.addOverlay(this.ToolTipInstance);
}
}
GMarker.prototype.closeToolTip = function()
{
if(this.ToolTipInstance != null)
{
map.removeOverlay(this.ToolTipInstance);
this.ToolTipInstance = null;
}
}
How to make the tooltip div to be "over" map div? The map div i
cliping it now ( for example when over some bottom right marker ).
2) How to center map view that it would show particular markers.
As here: http://gmapsapi.com/wspolrzedne.php - You can add markers and
then center view to see them all - "zoom do wszystkich markerów" link
which mean - "zoom to all markers".
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---