1.GPolyline折線對象和GPolygon多邊形對象html
html標籤中必須包含v="urn:schemas-microsoft--com:vml"的命名空間算法
<html xmlns:v="urn:schemas-microsoft--com:vml">api
new GPolyline(points,color?,weight?,opacity?)google
new GPolygon(points,strokeColor,strokeWeight,strokeOpacity,fillColor,fillOpacity)編碼
2.GPolyline折線對象和GPolygon多邊形對象的工廠方法fromEncoded()code
GPolyline.fromEncoded(color,weight,opacity,points,zoomFactor,levels,numLevels)//points編碼後的數據,xml
GPolygon.fromEncoded(polylins,fill,color,opacity,outline)//polylins一組通過編碼的折線數據;fill是否以color參數指定的顏色填充多邊形;opacity和outline參數表示是否以指定的透明度繪製邊線。htm
3.如何簡單快速的將經緯度信息轉化爲編碼:對象
(1)對於靜態、不須要修改的數據: http://www.google.com/apis/maps/documentation/polylineutility.htmlci
編碼算法: http://www.google.com/apis/maps/documentation/polylinealgorithm.html
4.其餘類方法
getVertexCount()和getVertex()
GPolyline.getVertexCount()或GPolygon.getVertexCount() //返回值爲該折線或多邊形全部頂點的個數
GPolygon.getVertex()或GPolyline.getVertex() //index表示指定折線或多邊形頂點所表明的序號,返回值爲序號,爲該參數的GLatLng()對象