Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

地图边缘zoom计算问题导致图层拼接不上 #2306

Open
wordgold opened this issue Apr 18, 2024 · 5 comments
Open

地图边缘zoom计算问题导致图层拼接不上 #2306

wordgold opened this issue Apr 18, 2024 · 5 comments

Comments

@wordgold
Copy link
Contributor

"maptalks": "^1.0.0-rc.33"

使用高德瓦片,使用 gcoord 转换为 wgs84

new maptalks.TileLayer('base', {
    urlTemplate: 'http://webrd{s}.is.autonavi.com/appmaptile?lang=zh_cn&style=8&x={x}&y={y}&z={z}',
    subdomains: ['01', '02', '03', '04'],
    offset (z) {
      const map = this.getMap()
      const center = map.getCenter()
      return map.coordToPoint(center, z)
        .sub(map.coordToPoint(
          new maptalks.Coordinate(
            gcoord.transform(center.toArray(), gcoord.AMap, gcoord.WGS84)
          ), z
        ))._round().toArray()
    }
  })

在地图边缘会出现有的瓦片zoom计算错误问题,往中心挪动就正常,到边缘表现为层级缩小,瓦片加载错误

image
边缘时瓦片上的文字明显较大
image
往中心稍微挪动一下后变小
image
往中心稍微挪动一下后变小


@wordgold
Copy link
Contributor Author

请问大佬地图没有倾斜,没有旋转,为什么会出现各瓦片 zoom 层级不一致的问题呢?

@fuzhenn
Copy link
Member

fuzhenn commented Apr 18, 2024

直觉上感觉和offset有关

@deyihu
Copy link
Collaborator

deyihu commented Apr 22, 2024

maybe same proble #2008

@wordgold
Copy link
Contributor Author

wordgold commented May 8, 2024

@fuzhenn @deyihu 设置 map option: seamlessZoom: false 后规避了这个问题

@wordgold
Copy link
Contributor Author

wordgold commented May 8, 2024

#1540

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants