API Overview / Overlays-GoogleMaps/API/doc/APIoverview/04-Overlays/Polylines-N☆E 学習帳

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

Counter: 3587, today: 1, yesterday: 3

API Overview / Overlays

Polylines

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

Version 2 (2006.4)

The GPolyline constructor takes an array of points as an argument, and creates a series of line segments that connect those points in the given sequence. You can also specify the color, weight, and opacity of the line. The color should be in the hexadecimal numeric HTML style, e.g., use #ff0000 instead of red. GPolyline does not understand named colors.

The following code snippet creates a 10-pixel-wide red polyline between two points:

var polyline = new GPolyline([
   new GLatLng(37.4419, -122.1419),
   new GLatLng(37.4519, -122.1519)
], "#ff0000", 10);
map.addOverlay(polyline);

In Internet Explorer, Google Maps uses VML to draw polylines (see XHTML and VML for more information). In all other browsers, we request an image of the line from Google servers and overlay that image on the map, refreshing the image as necessary as the map is zoomed and dragged around.

Version 1

The GPolyline constructor takes an array of lat/lng points as an argument. You can also specify the color, weight, and opacity. The color should be in the older HTML style, e.g., "#ff0000". GPolyline does not understand named colors. For example, this creates a 10 pixel, red polyline between two points:

  • GPolylineコンストラクタは緯度/経度の配列を引数で受ける
  • 色、太さ、不透明を指定できる。
  • 色は「#ff0000」のように16進で指定。色の名前では指定不可。
  • 以下は10ピクセルの赤い線で2つのポイントを結ぶ

var polyline = new GPolyline([new GPoint(-122.1419, 37.4419),
                              new GPoint(-122.1519, 37.4519)],
                              "#ff0000", 10);
map.addOverlay(polyline);

In Internet Explorer browser, we use VML to draw polylines. On all other browsers, we request an image of the line from Google servers and overlay that image on the map, refreshing the image as necessary as the map is zoomed and dragged around.

  • IEはVMLを描画にVMLを使い、その他ブラウザはGoogleサーバーから受け取ったイメージを表示するようです。


(2005.12)

The GPolyline constructor takes an array of points as an argument, and creates a series of line segments that connect those points in the given sequence. You can also specify the color, weight, and opacity of the line. The color should be in the hexadecimal numeric HTML style; for example, use "#ff0000" for red. GPolyline does not understand named colors.
 
The following code snippet creates a 10-pixel-wide red polyline between two points:

var polyline = new GPolyline([new GPoint(-122.1419, 37.4419),
			new GPoint(-122.1519, 37.4519)],
			"#ff0000", 10);
map.addOverlay(polyline);

In Internet Explorer, Google Maps uses VML to draw polylines, so be sure to include the VML namespace and the relevant CSS code. (See XHTML and VML.) In all other browsers, we request an image of the line from Google servers and overlay that image on the map, refreshing the image as necessary as the map is zoomed and dragged around.

VML

Vector Markup Language
e-Words → http://e-words.jp/w/vml.html

WWW上でベクター画像の表現を可能にするXMLベースの言語。