MASK

GeoGlobe.Format. MASK

南京行政区划工具类。

Constructor

new MASK()

Example
(code)
var mask = new GeoGlobe.Format.MASK();
mask.createLayer({
  type: '区', // 必选。
  name: '鼓楼区', // 必选。区划名称或区划代码,选区划名称时填name:'鼓楼区'。选区划名称时填code:'320106'。
  reverse: true, // 可选,默认false。reverse为true时,只能精确匹配。
  fillPaint: {
    "fill-color": "#0080ff",
    "fill-opacity": 0.5,
  }, // 可选, 默认{'fill-color': 'red', fill-opacity': 0.2}。填充面的paint,各选项与mapbox一致。
  fillLayout: {
    "visibility": "visible"
  }, // 可选。填充面的layout,各选项与mapbox一致。
  outlinePaint: {
    "line-color": "black",
    "line-width": 4,
    "line-dasharray": [5, 3]
  }, // 可选, 默认{'line-color': 'red', 'line-width': 2}。边线的paint,各选项与mapbox一致。
  outlineLayout: {
    "visibility": "visible",
    "line-cap": "round",
    "line-join": "miter"
  } // 可选。边线的layout,各选项与mapbox一致。
}, function (result) {
  map.addLayers(result);
});

Methods

createLayer(options, successFn, failFn)

创建南京行政区图层。
Parameters:
Name Type Description
options Object 相关选项设置。
successFn function 请求成功的回调函数。
failFn function 请求失败的回调函数。

getData()

获取南京行政区图层的数据。

initialize()

GeoGlobe.Format.MASK构造函数。

removeLayer(map-地图)

移除南京行政区图层。
Parameters:
Name Type Description
map-地图 Object