new SuperMap.Geometry.GeoText(x, y, text)
| Name | Type | Description | 
|---|---|---|
| x | float | x 坐标。 | 
| y | float | y 坐标。 | 
| text | string | 标签中的文本内容。 | 
Extends
Members
- 
    boundsSuperMap.Bounds
- 
    
    几何对象的范围。 
- 
    bsInfoObject
- 
    
    标签范围的基础信息。 Properties:Name Type Description wnumber bounds 的宽。 hnumber bounds 的高度。 
- 
    idstring
- 
    
    此几何对象的唯一标示符。 
- 
    parentSuperMap.Geometry
- 
    
    This is set when a Geometry is added as component of another geometry 
- 
    SRIDinterger
- 
    
    投影坐标参数。通过该参数,服务器判断 Geometry 对象的坐标参考系是否与数据集相同,如果不同,则在数据入库前进行投影变换。 Examplevar geometry= new SuperMap.Geometry(); geometry. SRID=4326;
- 
    textstring
- 
    
    标签中的文本内容。 
- 
    xfloat
- 
    
    横坐标。 
- 
    yfloat
- 
    
    纵坐标。 
Methods
- 
    calculateBounds()common/commontypes/geometry/GeoText.js, line 92
- 
    
    
    计算标签对象的范围。 
- 
    inherited clearBounds()common/commontypes/Geometry.js, line 85
- 
    
    
    清除几何对象的 bounds。 如果该对象有父类,也会清除父类几何对象的 bounds。 
- 
    clone(){SuperMap.Geometry.GeoText}common/commontypes/geometry/GeoText.js, line 79
- 
    
    
    克隆标签对象。 Returns:Type Description SuperMap.Geometry.GeoText 克隆后的标签对象。 
- 
    destroy()common/commontypes/geometry/GeoText.js, line 59
- 
    
    
    销毁文本标签类。 
- 
    inherited extendBounds(newBounds)common/commontypes/Geometry.js, line 98
- 
    
    
    Extend the existing bounds to include the new bounds. If geometry's bounds is not yet set, then set a new Bounds. Name Type Description newBoundsSuperMap.Bounds 范围。 
- 
    inherited getArea(){float}common/commontypes/Geometry.js, line 147
- 
    
    
    计算几何对象的面积 ,此方法需要在子类中定义。 Returns:Type Description float The area of the collection by summing its parts 
- 
    inherited getBounds(){SuperMap.Bounds}common/commontypes/Geometry.js, line 115
- 
    
    
    获得几何图形的边界。如果没有设置边界,可通过计算获得。 Returns:Type Description SuperMap.Bounds 返回的几何对象的边界。 
- 
    getCentroid(){SuperMap.Geometry.Point}common/commontypes/geometry/GeoText.js, line 70
- 
    
    
    获取标签对象的质心。 Returns:Type Description SuperMap.Geometry.Point 标签对象的质心。 
- 
    getLabelPxBoundsByLabel(locationPixel, labelWidth, labelHeight, style){SuperMap.Bounds}common/commontypes/geometry/GeoText.js, line 101
- 
    
    
    根据绘制好的标签获取文字标签的像素范围,参数的单位是像素;此方法相对于 getLabelPxBoundsByText 效率较低,但支持所有格式的文本。 Name Type Description locationPixelObject 标签的位置点,该对象含有属性 x(横坐标),属性 y(纵坐标)。 labelWidthstring 标签的宽度,如:“90px”。 labelHeightstring 标签的高度。 styleObject 标签的 style。 Returns:Type Description SuperMap.Bounds 标签的像素范围。 
- 
    getLabelPxBoundsByText(locationPixel, style){SuperMap.Bounds}common/commontypes/geometry/GeoText.js, line 174
- 
    
    
    根据文本内容获取文字标签的像素范围。 Name Type Description locationPixelObject 标签的位置点,该对象含有属性 x(横坐标),属性 y(纵坐标)。 styleObject 标签的样式。 Returns:Type Description SuperMap.Bounds 标签的像素范围。 
- 
    getLabelPxSize(style){Object}common/commontypes/geometry/GeoText.js, line 241
- 
    
    
    获取 label 的像素大小。 Name Type Description styleObject 标签样式。 Returns:Type Description Object 标签大小对象,属性 w 表示标签的宽度,属性 h 表示标签的高度。 
- 
    getTextCount(text){Object}common/commontypes/geometry/GeoText.js, line 293
- 
    
    
    获取 text 中的字符个数。 Name Type Description textstring 字符串。 Returns:Type Description Object 字符个数统计结果,属性 cnC 表示中文字符个数,属性 enC 表示英文字符个数,属性 textC 表示字符总个数。 
- 
    inherited getVertices(nodes){Array}common/commontypes/Geometry.js, line 138
- 
    
    
    返回几何图形的所有顶点的列表(需要在子类中实现此方法)。 Name Type Description nodesboolean 可选 如果是 true,线则只返回线的末端点,如果 false,仅仅返回顶点,如果没有设置,则返回顶点。 Returns:Type Description Array 几何图形的顶点列表。 
- 
    inherited setBounds(bounds)common/commontypes/Geometry.js, line 73
- 
    
    
    设置此几何对象的 bounds。 Name Type Description boundsSuperMap.Bounds 范围。