【问题标题】:Leaflet + EPSG:31466 WMS layer传单 + EPSG:31466 WMS 层
【发布时间】: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


    【解决方案1】:

    我已经修改了an example,更改了图块坐标的原点并添加了一个矩形来检查一般地理坐标。

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

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

    [编辑]

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

    与此同时,我 updated the example 使用了一个被黑的 L.TileLayer.WMS.getTileUrl 函数 - 现在它似乎可以加载了。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-15
    相关资源
    最近更新 更多