Google地图自定义投影

时间:2010-09-16 09:38:58

标签: google-maps google-maps-api-2 map-projections

我使用Google Maps Javascript API V2创建了自定义Google地图投影。根据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,一切正常。不过,Google最近推出的最低版本为2.193。这个新版本打破了我的预测。每当我尝试添加标记时,我在Firebug中收到以下错误:

d.getNearestImage不是函数

根据this发布了一种名为

的新方法
GProjection.getNearestImage(pixel,zoom,centrepixel) 

是在2.148版本中添加的,所以如果我使用2.147以上的API版本会出现这种问题。但是,参考手册中没有关于API官方变更的说明。我在我的投影中添加了这个名字的虚拟方法,但没有运气。有关如何修复我的预测或如何恢复到2.147的任何想法?

1 个答案:

答案 0 :(得分:0)

相关问题