-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
百度地图坐标转换成pixel 出现x = 256 或者 y=256, 溢出? #5
Comments
感谢测试,应该是边界问题,我跟进一下。 |
另外还发现tile pixel 中x 或者 y 有正负1 pixel的误差,这个误差在level 10 情况下, 造成的偏移量还是不容忽视的。 可能跟上述的issue相关。 |
var pixelX = Math.round(x * this._getMapSize(level) * 256 % 256); 两行使用了round 进行了向上取整, 所以有256的出现了。 改成 |
对,就是这个问题.用 Math.round 是有问题的.会导致取值区间变为 [0, 256],一共 257 个取值. |
zoom level 10
百度坐标 {lng: 120.097447, lat: 31.780346}
返回pixel {pixelX: 256, pixelY: 163}
tile 大小 256 x 256 x或者y 0-255, 转换后256是不是溢出了?
The text was updated successfully, but these errors were encountered: