如何使用 OpenLayers 在一张地图中使用带有经纬度图层的 Mapnik-Backgroundlayer?
我有一个使用 OpenLayers 的地图客户端应用程序。我想使用 Mapnik-data 作为背景层,如 OpenLayers.Layer.OSM.Mapnik 类提供的那样。为此,我必须切换到投影 EPSG:900913。但我还想显示一些图层,我只能在 EPSG:4326 中请求。我可以使用 OpenLayers 将两个具有不同投影的图层合并到一张地图中吗?我该怎么做?
I have an application with a map-client using OpenLayers. I want to use Mapnik-data as background-layer, as provided with the class OpenLayers.Layer.OSM.Mapnik. For that I have to switch to the projection EPSG:900913. But I also want to display some layers, that I can only request in EPSG:4326. Can I combine both layers with the different projections in one map with OpenLayers and how can I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的图层是矢量(WFS、KML、GeoRSS 等),那么您可以在浏览器中使用 OpenLayers 重新投影它们。
http://docs.openlayers.org/library/spherical_mercator。 html#working-with-projected-coordinates
如果您的图层是栅格(图像/WMS 服务等),则无法重新投影它们:
http://docs.openlayers.org/library/spherical_mercator.html#creating-spherical-mercator-raster-images
您必须通过 WMS 服务本身(通过 MapServer / ArcGIS / GeoServer)来完成此操作。
If your layers are vector (WFS, KML, GeoRSS etc.) then you can reproject them with OpenLayers in the browser.
http://docs.openlayers.org/library/spherical_mercator.html#working-with-projected-coordinates
If your layers are raster (images / WMS services etc.) then they cannot be reprojected:
http://docs.openlayers.org/library/spherical_mercator.html#creating-spherical-mercator-raster-images
You'd have to do this via the WMS service itself (through MapServer / ArcGIS / GeoServer).