Fx构造函数
# new MapWmsLayer(option)
参数:
名称 | 类型 | 属性 | 默认值 | 描述 |
---|---|---|---|---|
option |
Object | 属性键值对,地图属性字段。 |
||
domain |
String |
<optional> |
'' | 【domain和(networkProtocol,ip,port)二选一】。域名 |
networkProtocol |
String |
<optional> |
location.protocol.split(":")[0] || "http" | 【domain和(networkProtocol,ip,port)二选一】。网络协议 |
ip |
String |
<optional> |
localhost | 【domain和(networkProtocol,ip,port)二选一】。地图服务ip |
port |
String |
<optional> |
6163 | 【domain和(networkProtocol,ip,port)二选一】。地图服务端口 |
serverType |
String |
<optional> |
必选。服务类型,doc/layer |
|
serverName |
String |
<optional> |
必选。服务名 |
|
layers |
String |
<optional> |
null | 必选。要显示的图层名集合 |
format |
String |
<optional> |
image/png | 可选。图块输出格式。image/gif,image/png,image/jpeg |
version |
String |
<optional> |
1.0.0 | 可选。WMS版本,1.1.1(默认)或1.3.0 |
srs |
String |
<optional> |
'EPSG:4326' | 可选。空间坐标参考系,只在版本1.1.1中有效,如EPSG:4326 |
crs |
String |
<optional> |
'EPSG:4326' | 可选。空间坐标参考系,只在版本1.3.0中有效,如crs:80 |
width |
String |
<optional> |
'256' | 可选。输出地图图片的象素宽,像素值,如256 |
height |
String |
<optional> |
'256' | 可选。输出地图图片的象素高,像素值,如256 |
tileSize |
String |
<optional> |
512 | 可选。瓦片大小 |
layerID |
String |
<optional> |
可选。 |
|
sourceID |
String |
<optional> |
可选。 |
Example
//地图容器
var map = new mapboxgl.Map({
container: 'map', // 容器id
crs: 'EPSG:4326',//mapboxgl原生只支持3857
center: [101.74721254733845, 32.5665352689922],
zoom: 3
});
//wms图层
new mapboxgl.Zondy.Map.MapWmsLayer({
//IGServer所在ip地址
ip: "localhost",
//IGServer请求端口号
port: "6163",
serverType:'layer',
serverName:'wms',
//wmts服务名称
layers: ["省级行政区x","中国地级县x"],
//设置地图不连续显示
noWrap: true,
}).addToMap(map);