GPolyline [class]-GoogleMaps/API/doc/ClassReference/05-GPolyline-N☆E 学習帳

[ リロード ]   [ ソース ]  [ トップ | 一覧 | 単語検索 | 最新 | バックアップ | ヘルプ ]

Counter: 2809, today: 2, yesterday: 3

GPolyline [class]

http://www.google.com/apis/maps/docu­mentation/

Version 2 (2006.4)

This is a map overlay that draws a polyline on the map, using the vector drawing facilities of the browser if they are available, or an image overlay from Google servers otherwise.

Constructor

Constructor Description
GPolyline(points, color?, weight?, opacity?) Creates a polyline from an array of vertices. The color is given as a string that contains the color as a hexadecimal number RRGGBB. The weight is the width of the line in pixels. The opacity is given as a number between 0 and 1. The line will be antialiased and semitransparent.

 

Factory Methods

Factory Methods Return Value Description
fromEncoded(color?, weight?, opacity?, points, zoomFactor, levels, numLevels) GPolyline Creates a polyline from encoded strings of aggregated points and levels. color is a string that contains a hexadecimal numeric HTML style, i.e. #RRGGBB. weight is the width of the line in pixels. opacity is a number between 0 and 1. points is a string containing the encoded latitude and longitude coordinates. levels is a string containing the encoded polyline zoom level groups. numLevels is the number of zoom levels contained in the encoded levels string. zoomFactor is the magnification between adjacent sets of zoom levels in the encoded levels string. Together, these two values determine the precision of the levels within an encoded polyline. The line will be antialiased and semitransparent. (Since 2.63)

 

Methods

Methods Return Value Description
getVertexCount() Number Returns the number of vertices in the polyline. (Since 2.46)
getVertex(index) GLatLng Returns the vertex with the given index in the polyline. (Since 2.46)

 

Events

Events Arguments Description
remove none This event is fired when the polyline is removed from the map, using GMap2.removeOverlay() or GMap2.clearOverlays().

 

Version 1

A polyline represents a vector polyline overlay on the map. A polyline is drawn with the vector drawing facilities of the browser if they are available or an image overlay from Google servers otherwise.

Constructor

Constructor Description
GPolyline(points, color?, weight?, opacity?) Constructs a polyline from the given array of lat/lng points. color should be a hex HTML color (e.g., "#0000ff"), weight is an integer representing the width of the line in pixels, and opacity should be a float between 0 and 1.