【问题标题】:Using openlayers lib, the same point show in different places between different layers使用openlayers lib,同一点显示在不同层之间的不同位置
【发布时间】:2013-01-18 17:39:01
【问题描述】:

this demo上有三层:

  1. MyLayer:使用自定义平铺数据
  2. Google:使用Openlayer.Layer.Google v3 API
  3. TMS

当我在地图上放置三个标记时,切换不同层后显示不同的地方。我已经将 Google'layers 投影更改为 Openlayers 默认投影EPSG:4326

我该如何解决这个问题?

还有为什么?

三个点的坐标是:

  • (0, 0)
  • (31.22689446881399, 121.475830078125)
  • (18.255436745247998, 109.51309204101562)

所有my code is from here

等待答案,非常感谢。

【问题讨论】:

    标签: google-maps openlayers projection


    【解决方案1】:

    如果您使用像 Google 或 OSM 这样的层,则必须将默认投影设置为 EPSG:900913 而不是 EPSG:4326。然后你应该将所有图层重新投影到墨卡托投影。

    您可以阅读更多关于球形墨卡托的文档here。 你也可以在这个example page上搜索mercator

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-29
      • 1970-01-01
      • 2018-10-07
      • 1970-01-01
      相关资源
      最近更新 更多