【问题标题】:Combine wmts and wms结合 wmts 和 wms
【发布时间】:2015-12-10 09:50:23
【问题描述】:

我想将 WMS 与 WMTS 结合使用。我和 OL 一起工作 3.10.1。单独或仅组合 WMS 应用程序中的服务没有问题。 WMTS 服务单独在我的 OL3 应用程序中正常工作。

但是当我将 WMS 添加到 WMTS OL3 时,会生成带有 &SRS=EPSG%3A3857& 的 WMS-GetMap-Requests,尽管我的所有服务都基于 EPSG 25832(WMTS 也是)。 WMS 响应随后包含 ServiceException 代码 InvalidSRS。当我复制 wms-getmap-request 并将 3857 替换为 25832 时,响应是正确的映射。

在我的 OL3 应用程序中,我还使用投影对象进行了测试,但没有成功。

var layer_wmts=new ol.layer.Tile({
		source: new ol.source.WMTS({
			url: 'https://sg.geodatenzentrum.de/xxxx',
			layer:'xxx',
			matrixSet:'DE_EPSG_25832_ADV',
			tileGrid: tileGrid,
			format: 'image/png',
			style: 'normal',
			projection: 'EPSG:25832'
			})
		});
		
var layer_grenzen=new ol.layer.Image({
	source: new ol.source.ImageWMS({
	url:'http://intra-entumn1.vkv.niedersachsen.de/fcgi-bin/ows/verwaltungsgrenzen',
	params: {'LAYERS': 'AG',VERSION: '1.1.1',defaultProjection:'EPSG:25832',projection:'EPSG:25832'}
    })
 });	
	
var map = new ol.Map({
  layers: [layer_wmts,layer_grenzen],
  target: 'map',
  view: new ol.View({center:[594560.,5806642.],zoom:8,minZoom:7,maxZoom:18}),
  controls: ol.control.defaults().extend([new ol.control.ScaleLine(),new ol.control.MousePosition({coordinateFormat: ol.coordinate.createStringXY(0)})
  ]),
});

如何在 OL3 中结合 WMTS 和 WMS?

【问题讨论】:

    标签: openlayers openlayers-3 wms


    【解决方案1】:

    在结合 wmts 和 wms 时使用投影对象运行(默认投影为 3857)。

    var projection = new ol.proj.Projection({
      code: 'EPSG:25832',
      extent: [ -1878007.03, 3932282.86, 831544.53, 9437501.55]
    });
    
    // …
    
    var view = new ol.View({
      projection: projection
      // …
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-06-07
      • 2020-12-22
      • 1970-01-01
      • 1970-01-01
      • 2015-11-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多