【发布时间】:2010-09-16 09:38:57
【问题描述】:
我使用 Google Maps Javascript API V2 创建了一个自定义的 Google Maps 投影。根据 API 规范,它看起来像这样:
function PProjection(levels) {
this.fromLatLngToPixel = function(latlng, zoom) {
...
};
this.fromPixelToLatLng = function(pixel, zoom) {
...
};
this.tileCheckRange = function(tile, zoom, tilesize) {
...
};
this.getWrapWidth = function(zoom) {
...
};
}
以前,我的 API 版本设置为 2.147,一切正常。然而,谷歌最近推出了最低版本 2.193。这个新版本打破了我的预测。每当我尝试添加标记时,都会在 Firebug 中收到以下错误:
d.getNearestImage 不是函数
根据this发布了一个名为
的新方法GProjection.getNearestImage(pixel,zoom,centrepixel)
是在 2.148 版本中添加的,所以如果我使用 2.147 以上的 API 版本,就会出现这个问题。但是,参考手册中并没有说明 API 的官方更改。我在我的投影中添加了这个名称的虚拟方法,但没有运气。关于如何修复我的投影或如何恢复到 2.147 的任何想法?
【问题讨论】:
标签: google-maps google-maps-api-2 map-projections