如何使用 OpenLayers 在一张地图中使用带有经纬度图层的 Mapnik-Backgroundlayer?

发布于 2024-08-20 15:01:02 字数 258 浏览 7 评论 0原文

我有一个使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

裂开嘴轻声笑有多痛 2024-08-27 15:01:02

如果您的图层是矢量(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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文