基于高德地图API: WMS和WMTS图层 导入[JavaScript]

 

高德地图JSAPI提供了WMS和WMTS图层,凡是符合OGC标准的支持EPSG3857坐标系统的WMS和WMTS地图服务均可通过这两个图层添加到地图中

类名

描述

是否插件

AMap.TileLayer.WMS

用于加载OGC标准的WMS图层

AMap.TileLayer.WMTS

用于加载OGC标准的WMTS图层

AMap.TileLayer.WMS

用于加载OGC标准的WMS地图服务的一种图层类,自v1.4.3新增,仅支持EPSG3857坐标系统的WMS图层,查看WMS的OGC标准

示例代码,前往示例中心:

var map = new AMap.Map('container', {
    zoom: 3,
    // viewMode:'3D',
    center:[-99.241291,39.51401]
    }); 
var wms  = new AMap.TileLayer.WMS({
        url:'https://ahocevar.com/geoserver/wms',
        blend:false,
        tileSize:512,
        params:{'LAYERS': 'topp:states',VERSION:'1.3.0'}
    })
wms.setMap(map)

 

var map = new AMap.Map('container', {
    zoom: 3,
    //viewMode:'3D',
    center:[-99.241291,39.51401]
});
var wms  = new AMap.TileLayer.WMTS({
     url: 'https://services.arcgisonline.com/arcgis/rest/services/Demographics/USA_Population_Density/MapServer/WMTS/',        
     blend:false,
     tileSize:256,
     params:{'Layer': '0',Version:'1.0.0',Format: 'image/png'}
})
wms.setMap(map)

 

转载自:https://blog.csdn.net/wang603603/article/details/82707000

You may also like...

退出移动版