Openlayers WMS 图层无法使用底图正确缩放
我在 OSM 底图上使用来自 Geoserver 的 WMS 图层。当我处于特定的缩放级别 (1:70) 时,WMS 图层位于底图上方的正确位置,但在放大以查看各个点时,图层开始滑落并在 2 个缩放级别后消失。我所说的滑落是指它无法正确放大底图。
我尝试禁用底图并仅使用该图层,它单独工作正常,但当与底图附加时,它就会滑落。
如果有人能给我指出一些可以解决这个问题的资源,或者提供解决方案,那将是一个很大的帮助。
I'm using a WMS layer coming from Geoserver over a OSM basemap. When I'm at a particular zoom level (1:70) then the WMS layer is on right position over Basemap, but on zooming in to see individual points the layer starts slipping off and vanishes after 2 zoom levels. By slipping off I mean it doesn't zoom in properly with basemap.
I tried to disable basemap and work only with this layer and it works fine individually, but when attached with basemap, it just slips off.
It will be a great help if anyone can point me to some resources that can solve this problem, or provide a solution to this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
所以我发现了问题,如果图层和底图的投影不同,那么您总是会陷入点未对齐和图层缺失的情况。
我尝试通过硬编码来设置每个元素的投影系统,但没有成功。
解决方案是将地图元素的“displayProjection”(http://dev.openlayers.org/apidocs/files/OpenLayers/Map-js.html#OpenLayers.Map.displayProjection)属性设置为底图正在使用的投影系统。
So I found the problem, if the projection of both layer and basemap are different then you will always land into misaligning of points and absence of layer.
I tried to set the projection system of every element by hardcoding it, but no luck.
Solution is to set "displayProjection" (http://dev.openlayers.org/apidocs/files/OpenLayers/Map-js.html#OpenLayers.Map.displayProjection) property of map element to projection system your basemap is using.