简体   繁体   English

如何在OpenLayers的一个地图中使用带有lat-lon图层的Mapnik-Backgroundlayer?

[英]How can I use a Mapnik-Backgroundlayer with lat-lon layers in one map with OpenLayers?

I have an application with a map-client using OpenLayers . 我有一个使用OpenLayers的map-client应用程序。 I want to use Mapnik-data as background-layer, as provided with the class OpenLayers.Layer.OSM.Mapnik. 我想使用Mapnik-data作为背景层,与OpenLayers.Layer.OSM.Mapnik类一起提供。 For that I have to switch to the projection EPSG:900913. 为此,我必须切换到EPSG:900913投影。 But I also want to display some layers, that I can only request in EPSG:4326. 但我也希望显示一些图层,我只能在EPSG中请求:4326。 Can I combine both layers with the different projections in one map with OpenLayers and how can I do that? 我可以使用OpenLayers将两个图层与一个地图中的不同投影合并,我该怎么做?

If your layers are vector (WFS, KML, GeoRSS etc.) then you can reproject them with OpenLayers in the browser. 如果您的图层是矢量(WFS,KML,GeoRSS等),那么您可以在浏览器中使用OpenLayers重新投影它们。

http://docs.openlayers.org/library/spherical_mercator.html#working-with-projected-coordinates 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: 如果您的图层是光栅(图像/ WMS服务等),则无法重新投影:

http://docs.openlayers.org/library/spherical_mercator.html#creating-spherical-mercator-raster-images 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). 您必须通过WMS服务本身(通过MapServer / ArcGIS / GeoServer)执行此操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM