GControl [interface]-GoogleMaps/API/doc/ClassReference/23-GControl-N☆E 学習帳

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

Counter: 3138, today: 2, yesterday: 1

GControl [interface]

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

Version 2 (2006.4) 新規

This interface is implemented by all controls. You can implement it in order to provide a custom control for the map. Controls are added to the map using the GMap2.addControl() method.

In contrast to overlays, which are positioned relative to the map, controls are positioned relative to the map view, i.e. they don't move when the map moves.

Constructor

Constructor Description
GControl(printable?, selectable?) Creates the prototype instance for a new control class. Flag printable indicates that the control should be visible in the print output of the map. Flag selectable indicates that the control will contain text that should be selectable.

 

Methods

These methods will be called by the map when the control is added to the map using GMap2.addControl(). Thus, these methods will not be called by you, but they will be implemented by you.

Methods Return Value Description
printable() Boolean Returns to the map if the control should be printable.
selectable() Boolean Returns to the map if the control contains selectable text.
initialize(map) Node Will be called by the map so the control can initialize itself. The control will use the method GMap2.getContainer() to get hold of the DOM element that contains the map, and add itself to it. It returns the added element.
getDefaultPosition() GControlPosition Returns to the map the position in the map view at which the control appears by default. This will be overridden by the second argument to GMap2.addControl().