new mapboxgl.supermap.GraticuleLayer(options)
mapboxgl/overlay/GraticuleLayer.js, line 14
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
经纬网参数。
|
- Version:
- 10.1.1
Methods
-
removeFromMap()
mapboxgl/overlay/GraticuleLayer.js, line 107 -
移除图层。
-
setExtent(extent)
mapboxgl/overlay/GraticuleLayer.js, line 165 -
设置经纬网渲染的边界范围。
Name Type Description extentmapboxgl.LngLatBounds 经纬网渲染的边界范围。
-
setIntervals(interval)
mapboxgl/overlay/GraticuleLayer.js, line 216 -
设置经纬度的间隔(以度为单位)
Name Type Description intervalnumber | function 经纬度的间隔(以度为单位),可以是数字,也可以是函数,参数是map。
-
setLatLabelStyle(labelStyle)
mapboxgl/overlay/GraticuleLayer.js, line 206 -
设置纬度标签样式。
Name Type Description labelStylemapboxgl.supermap.GraticuleLayer.LabelStyle 标签样式。
-
setLngLabelStyle(labelStyle)
mapboxgl/overlay/GraticuleLayer.js, line 196 -
设置经度标签样式。
Name Type Description labelStylemapboxgl.supermap.GraticuleLayer.LabelStyle 标签样式。
-
setMaxZoom(maxZoom)
mapboxgl/overlay/GraticuleLayer.js, line 145 -
该图层可见的最大视图缩放级别。
Name Type Description maxZoomnumber 该图层可见的最大视图缩放级别(含)。
-
setMinZoom(minZoom)
mapboxgl/overlay/GraticuleLayer.js, line 135 -
设置最小视图缩放级别。
Name Type Description minZoomnumber 最小视图缩放级别(不包括此级别),在该级别之上,该层将可见。
-
setShowLabel(showLabel)
mapboxgl/overlay/GraticuleLayer.js, line 155 -
设置显示标签。
Name Type Description showLabelboolean 是否显示标签。
-
setStrokeStyle(strokeStyle)
mapboxgl/overlay/GraticuleLayer.js, line 177 -
设置经纬线样式。
Name Type Description strokeStylemapboxgl.supermap.GraticuleLayer.StrokeStyle 经纬线样式。
-
setVisibility(visible)
mapboxgl/overlay/GraticuleLayer.js, line 117 -
设置是否可见。
Name Type Description visibleboolean 是否可见。
Type Definitions
-
mapboxgl.supermap.GraticuleLayer.LabelStyleObject
-
标签样式
Properties:
Name Type Default Description textFontArray.<string> ['Calibri','sans-serif'] 可选 字体样式。
textSizestring '12px' 可选 字体大小。
textColorstring 'rgba(0,0,0,1)' 可选 字体颜色
textHaloColorstring 'rgba(255,255,255,1)' 可选 描边颜色
textHaloWidthnumber 1 可选 描边宽度
textAnchorstring 'bottom' 可选 字体基线: "center", "left", "right", "top", "bottom", "top-left", "top-right", "bottom-left", "bottom-right"
-
mapboxgl.supermap.GraticuleLayer.StrokeStyleObject
-
线样式
Properties:
Name Type Default Description lineColorstring 'red' 可选 线颜色。
lineCapstring 'round' 可选 线端点风格:butt, round, square。
lineJoinstring round 可选 线连接样式:bevel, round, miter。
lindDasharrayArray.<number> [0.5,4] 可选 虚线样式。
lineWidthnumber 1 可选 线宽。