LEAFLE+EPSG:31466 WMS层 [英] Leaflet + EPSG:31466 WMS layer

查看:28
本文介绍了LEAFLE+EPSG:31466 WMS层的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要使用epsg:31466投影创建传单地图。我已经包含了proj4库和proj4leaflet插件。我计划使用fp_plan层包括thisWMS服务。

我已尝试使用以下方法(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)准确地获取和渲染瓷砖。

推荐答案

我已经找到an example更改平铺坐标的原点并添加一个矩形以检查常规地理坐标。

它确实请求磁贴,在我看来,请求的BBox的坐标很好,但我只能看到白色磁贴。

或许该示例可以帮助您了解问题所在?

[编辑]

单张似乎不尊重自定义CRSS上WMS 1.3请求的坐标顺序(北距-东距或东距-北距)。我认为这是传单错误。

同时,我updated the example使用了被黑客攻击的L.TileLayer.WMS.getTileUrl函数-现在它似乎加载正常。

这篇关于LEAFLE+EPSG:31466 WMS层的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆