Class: Text

.Visuals.MapV. Text

基于MapV的文本图层

new Text()

Author:
  • kz
Source:
View2D/Visuals/MapV/Text.js
Example
//构造MapV可视化图层
 var mapV = new GeoGlobe.Visuals.MapV();
 //添加到地图中
 mapV.addTo(map);
 //构造文本图层
 var text = new GeoGlobe.Visuals.MapV.Text({
    id: 'text_1',
    visibility: true,
    dragdrawing: true,
    data: [{
        "type": "Feature",
        "properties": {"text":"¥4.89"},
        "geometry": {
            "type": "Point",
            "coordinates": [123.3192464663197, 43.91886355937628]
        }
    }],
    rendererOptions: {
        fillStyle: 'yellow',
        avoid: true,
        size: 12,
        font: "18px Arial",
        shadowColor: "yellow",
        shadowBlur: 10
    }
 });
 //添加到MapV可视化图层
 text.addTo(mapV);
 //绘制
 mapV.render();

Members


visibility :Boolean

图层可见性
Type:
  • Boolean
Default Value:
  • true
Source:
View2D/Visuals/MapV/Text.js

Methods


addTo(mapV)

关联mapV
Parameters:
Name Type Description
mapV GeoGlobe.Visuals.MapV
Source:
View2D/Visuals/MapV/Text.js

destroy()

销毁图层
Source:
View2D/Visuals/MapV/Text.js

remove()

从父对象中移除自己
Source:
View2D/Visuals/MapV/Text.js

render()

绘制
Source:
View2D/Visuals/MapV/Text.js

setData(data)

数据的处理
Parameters:
Name Type Description
data Array 数据,geojson格式
Source:
View2D/Visuals/MapV/Text.js

setVisible(visibility)

图层的显示与隐藏
Parameters:
Name Type Description
visibility Boolean 可见性
Source:
View2D/Visuals/MapV/Text.js