2011-08-04 25 views

回答

0
GEvent.addListener(this, "mouseover", function() { 
    var ToPixel = new GPoint(); 
    var AddOffset = new GPoint(); 
    var ToLatlag = new GLatLng(); 
    var currentProjection = G_NORMAL_MAP.getProjection(); 
    ToPixel = currentProjection.fromLatLngToPixel(**this.latlng**, this.map.getZoom()); 
    AddOffset = new GPoint(ToPixel.x,ToPixel.y-2); 
    ToLatlag = currentProjection.fromPixelToLatLng(AddOffset,this.map.getZoom()); 
    this.setLatLng(ToLatlag); 
    this.redraw(true); 
}); 

GEvent.addListener(this, "mouseout", function() { 
    this.setLatLng(this.latlng); 
});