MapDocTileLayer Class

MapDocTileLayer(opt_name, opt_docName, opt_options)

MapDocTileLayer显示动态裁图的矢量地图文档

Fx构造函数

# new MapDocTileLayer(opt_name, opt_docName, opt_options)

Zondy.Map.MapDocTileLayer

参数:
名称 类型 属性 默认值 描述
opt_name String

可选项,显示瓦片地图的名称,无实际意义,可为NULL。

opt_docName String

必选项,动态裁图的矢量地图文档的名称(IGServer上发布的实际名称)

opt_options Object

必选项,设置其他属性键值对对象。对象中的属性来自本类的属性。例如:{key1:value1, key2:value2 …}

ip String <optional>
''

必选项,服务器ip地址,本地为“127.0.0.1”或“localhost”。

port String <optional>
'6163'

必选项,服务器端口号,默认值6163

projection String <optional>
''

必选项,地图坐标系,一般为EPSG:4326或EPSG:3857

token String <optional>
''

可选项,服务访问控制,如果在 MapGIS Server Manager 服务管理中开启token,须设置此项,其key值可在设置处获取。

f String <optional>
'png'

可选项,图像类型,取值为:jpg|png|gif,默认值png

layers String <optional>
''

可选项,控制矢量地图文档中图层的显示,显示状态有四种形式:show:表示只显示指定图层;hide:表示隐藏不需要显示的图层;include:表示显示除默认图层(地图文档内图层状态为可见的图层)外,另追加指定图层;exclude:表示从默认图层列表里删除指定图层后进行显示;语法为:“layers=显示状态:图层序号,图层序号...”,如“layers=show:1,2,3”。当不设置此项时,表示显示全部图层。

filters String <optional>
'false'

可选项,图层过滤条件,它由多个键值对组成,值为您所要设定的过滤条件。如:'1:ID>4,3:ID>1”。过滤条件中用到的符号包括“==”、“!=”、“<”、“>”、“<=”、“>=”、“..”、“~”等,当包含中文条件时,请使用UTF-8编码格式,其中“:”和“,”为保留字符,用于表示键值对概念和分隔不同图层的条件,请不要将这2个字符用于自定义条件中,javascitpt中请使用encodeURI()函数编码后再代入filters参数中。

style Zondy.Object.CDisplayStyle <optional>
''

可选项,地图文档显示样式参数

proj Zondy.Object.CGetImageBySRSID <optional>
''

可选项,动态投影参数,设置地图文档在服务器端重新投影所需的空间参考系对象。

extent Array.<Number> <optional>
''

可选项,地图文档数据范围

guid String <optional>
''

可选项,地图文档缓存的唯一标识,一般无需赋值。

查看源代码 openlayers/layer/mapDocTileLayer.js, line 328

Example
//定义地图文档图层和地图
    var mapDocLayer, map;
    // 初始化地图显示
    function init() {
        //初始化地图容器
        map = new ol.Map({
            target: "mapCon",
            view: new ol.View({
                center: [(12060733.232006868 + 12929863.44711455) / 2, (3377247.5680546067 + 3934286.5753852259) / 2],
                zoom: 6
            })
        });
        var { protocol, ip, port } = window.webclient;
        //初始化地图文档图层对象
        mapDocLayer = new Zondy.Map.MapDocTileLayer("MapGIS IGS MapDocLayer", "Hubei3857", {
            //指定ip地址
            ip: `${ip}`,
            //指定端口号
            port: `${port}`,
            //指定坐标系
            projection: "EPSG:3857",
            //指定返回的图片格式
            f:'png',
        });
        //将地图文档图层加载到地图中
        map.addLayer(mapDocLayer);
    }

方法

# static getStyle() → {Array.<Zondy.Object.CDisplayStyle>}

获取地图文档显示样式参数信息。

查看源代码 openlayers/layer/mapDocTileLayer.js, line 416

描述地图文档显示样式的参数信息.

Example
mapDocLayer.getStyle()

# static refresh()

刷新地图,重新取图,但保留了原有的guid的标识。

查看源代码 openlayers/layer/mapDocTileLayer.js, line 397

Example
mapDocLayer.refresh()

# static setFilters(opt_filters)

设置地图文档图层过滤条件。

参数:
名称 类型 描述
opt_filters String

过滤条件。如:'1:ID>4,3:ID>1”。 过滤条件中用到的符号包括“==”、“!=”、“<”、“>”、“<=”、“>=”、“..”、“~”等,当包含中文条件时,请使用UTF-8编码格式,其中“:”和“,”为保留字符,用于表示键值对概念和分隔不同图层的条件,请不要将这2个字符用于自定义条件中,javascitpt中请使用encodeURI()函数编码后再代入filters参数中。

查看源代码 openlayers/layer/mapDocTileLayer.js, line 481

Example
//显示第0个图层,所有id大于1的数据
var opt_style = '0:id>1';
VecLayer.setFilters(opt_filters)
mapDocLayer.refresh()

# static setStyle(opt_style)

设置地图文档显示样式参数信息。

参数:
名称 类型 描述
opt_style Array.<Zondy.Object.CDisplayStyle>

地图文档显示样式参数。

查看源代码 openlayers/layer/mapDocTileLayer.js, line 431

Example
mapDocLayer.setStyle(opt_style)