【发布时间】:2016-02-11 10:54:02
【问题描述】:
我想使用 EPSG:31466 投影创建一张传单地图。我已经包含了proj4 库以及proj4leaflet 插件。我计划使用fp_plan 层包含this WMS 服务。
我尝试使用以下方法 (fiddle) 设置我的地图。
// Define CRS (EPSG:31466)
var rs31466 = new L.Proj.CRS(
'EPSG:31466',
'+proj=tmerc +lat_0=0 +lon_0=6 +k=1 +x_0=2500000 +y_0=0 +ellps=bessel +datum=potsdam +units=m +no_defs',
{
origin: [
2490547.1867,
5958700.0208
],
resolutions: [
10000000 * 0.00028, //GroundResolutionInMeter * OGC_PixelWidth
5000000 * 0.00028,
2500000 * 0.00028,
1000000 * 0.00028,
500000 * 0.00028,
250000 * 0.00028,
100000 * 0.00028,
50000 * 0.00028
]
}
);
// Create the WMS layer
var wmsLayer = L.tileLayer.wms('http://xplanung.lkee.de/xplan-wms-neu/services/wms', {
version: '1.3.0',
crs: rs31466,
layers: 'fp_plan',
format: 'image/png',
transparent: false,
// The `continuousWorld` property should be set to make sure Leaflet doesn't
// try to wrap or cut off the tiles on Spherical Mercator's bounds.
continuousWorld: true
});
// Define the map
var map = L.map('map', {
crs: rs31466,
center:[51.310, 13.393],
zoom: 1,
layers: [
wmsLayer
]
});
我本来希望看到这样的:
请求了切片,但该部分不包含预期的图层信息。如果我使用 EPSG:25833 投影,则会以预期的方式(fiddle)准确地获取和渲染图块。
【问题讨论】:
标签: javascript leaflet gis wms