宣传单+ EPSG:31466 WMS图层

时间:2016-02-11 10:54:03

标签: javascript leaflet gis wms

我想使用 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
  ]
});

我原本希望看到这样的事情:

Expected result

请求切片但该部分不包含预期的图层信息。如果我使用 EPSG:25833 投影,则会以预期的方式(fiddle)获取并呈现切片。

1 个答案:

答案 0 :(得分:1)

我掏出an example更改了瓷砖坐标的原点,并添加了一个矩形来检查一般的地理坐标。

它确实请求了瓷砖,在我看来,请求BBOX的坐标很好,但我只能看到白色瓷砖。

也许这个例子可以帮助你看出错误的原因?

<强> [编辑]

Leaflet似乎并不尊重自定义CRS上WMS 1.3请求的坐标顺序(北向东或东向北)。我认为这是一个传单错误。

与此同时,我updated the example有一个被黑客攻击King的功能 - 现在似乎加载好了。

相关问题