Javascript 在页面上查找Google标记位置?

Javascript 在页面上查找Google标记位置?,javascript,google-maps,Javascript,Google Maps,简单情况: 地图上的标记, 想在它旁边放一个DIV,显示在鼠标上方 但我究竟怎样才能得到DIV当前的位置呢 LatLng不会让我有任何进展。这将获得标记的位置(以像素为单位): var scale = Math.pow(2, map.getZoom()) , nw = new google.maps.LatLng( map.getBounds().getNorthEast().lat(), map.getBounds().getSouthWest().lng() ) , worl

简单情况: 地图上的标记, 想在它旁边放一个DIV,显示在鼠标上方

但我究竟怎样才能得到DIV当前的位置呢


LatLng不会让我有任何进展。

这将获得标记的位置(以像素为单位):

var scale = Math.pow(2, map.getZoom())
, nw = new google.maps.LatLng(
    map.getBounds().getNorthEast().lat(),
    map.getBounds().getSouthWest().lng()
)
, worldCoordinateNW = map.getProjection().fromLatLngToPoint(nw)
, worldCoordinate = map.getProjection().fromLatLngToPoint(marker.getPosition())
, pixelOffset = new google.maps.Point(
    Math.floor((worldCoordinate.x - worldCoordinateNW.x) * scale),
    Math.floor((worldCoordinate.y - worldCoordinateNW.y) * scale)
);

除此之外,我还想解决一个小问题;结果假定贴图从浏览器的左上角开始。。