1.GPolyline折线对象和GPolygon多边形对象
html标签中必须包含v="urn:schemas-microsoft--com:vml"的命名空间
<html xmlns:v="urn:schemas-microsoft--com:vml">
new GPolyline(points,color?,weight?,opacity?)
new GPolygon(points,strokeColor,strokeWeight,strokeOpacity,fillColor,fillOpacity)
2.GPolyline折线对象和GPolygon多边形对象的工厂方法fromEncoded()
GPolyline.fromEncoded(color,weight,opacity,points,zoomFactor,levels,numLevels)//points编码后的数据,
GPolygon.fromEncoded(polylins,fill,color,opacity,outline)//polylins一组经过编码的折线数据;fill是否以color参数指定的颜色填充多边形;opacity和outline参数表示是否以指定的透明度绘制边线。
3.如何简单快速的将经纬度信息转化为编码:
(1)对于静态、不需要修改的数据: http://www.google.com/apis/maps/documentation/polylineutility.html
编码算法: http://www.google.com/apis/maps/documentation/polylinealgorithm.html
4.其他类方法
getVertexCount()和getVertex()
GPolyline.getVertexCount()或GPolygon.getVertexCount() //返回值为该折线或多边形所有顶点的个数
GPolygon.getVertex()或GPolyline.getVertex() //index表示指定折线或多边形顶点所代表的序号,返回值为序号,为该参数的GLatLng()对象
本文详细介绍了GPolyline折线对象和GPolygon多边形对象的使用方法,包括如何通过fromEncoded()方法创建对象,以及如何将经纬度信息转化为编码。同时,提供了获取顶点数量和顶点信息的方法。
1698

被折叠的 条评论
为什么被折叠?



