Google Maps API version 3 リファレンス

google.maps.Map class

このクラスは MVCObjectを継承しています。

Constructor

Constructor Description
Map(mapDiv:Nodeopts?:MapOptions) 地図を指定されたHTML要素の中に作ります。通常Divです。

Methods

Methods Return Value Description
fitBounds(bounds:LatLngBounds) None 与えられた bounds に一致するようにビューポートを変更します。
getBounds() LatLngBounds 現在のビューポートの緯度経度を返します。まだ地図が初期化されていないとき やズームがセットされていないときは、 null or undefinedを返します。
getCenter() LatLng 地図の中心の緯度経度を返します。
getDiv() Node
getHeading() number Returns the compass heading of aerial imagery. The heading value is measured in degrees (clockwise) from cardinal direction North.
getMapTypeId() MapTypeId
getProjection() Projection Returns the current Projection. If the map is not yet initialized (i.e. the mapType is still null) then the result is null. Listen to projection_changed and check its value to ensure it is not null.
getStreetView() StreetViewPanorama Returns the default StreetViewPanorama bound to the map, which may be a default panorama embedded within the map, or the panorama set using setStreetView(). Changes to the map'sstreetViewControl will be reflected in the display of such a bound panorama.
getTilt() number Returns the angle of incidence for aerial imagery (available for SATELLITE and HYBRID map types) measured in degrees from the viewport plane to the map plane. A value of 0 indicates no angle of incidence (no tilt) while 45° imagery will return a value of 45.
getZoom() number
panBy(x:numbery:number) None Changes the center of the map by the given distance in pixels. If the distance is less than both the width and height of the map, the transition will be smoothly animated. Note that the map coordinate system increases from west to east (for x values) and north to south (for y values).
panTo(latLng:LatLng) None Changes the center of the map to the givenLatLng. If the change is less than both the width and height of the map, the transition will be smoothly animated.
panToBounds(latLngBounds:LatLngBounds) None Pans the map by the minimum amount necessary to contain the given LatLngBounds. It makes no guarantee where on the map the bounds will be, except that as much of the bounds as possible will be visible. The bounds will be positioned inside the area bounded by the map type and navigation (pan, zoom, and Street View) controls, if they are present on the map. If the bounds is larger than the map, the map will be shifted to include the northwest corner of the bounds. If the change in the map's position is less than both the width and height of the map, the transition will be smoothly animated.
setCenter(latlng:LatLng) None
setHeading(heading:number) None Sets the compass heading for aerial imagery measured in degrees from cardinal direction North.
setMapTypeId(mapTypeId:MapTypeId) None
setOptions(options:MapOptions) None
setStreetView(panorama:StreetViewPanorama) None Binds a StreetViewPanorama to the map. This panorama overrides the defaultStreetViewPanorama, allowing the map to bind to an external panorama outside of the map. Setting the panorama to null binds the default embedded panorama back to the map.
setTilt(tilt:number) None Sets the angle of incidence for aerial imagery (available for SATELLITE and HYBRID map types) measured in degrees from the viewport plane to the map plane. The only supported values are 0, indicating no angle of incidence (no tilt), and 45indicating a tilt of 45deg;.
setZoom(zoom:number) None

Properties

Properties Type Description
controls Array.<MVCArray.<Node>> Additional controls to attach to the map. To add a control to the map, add the control's <div>to the MVCArray corresponding to the ControlPosition where it should be rendered.
mapTypes MapTypeRegistry A registry of MapType instances by string ID.
overlayMapTypes MVCArray.<MapType> Additional map types to overlay.

Events

Events Arguments Description
bounds_changed None This event is fired when the viewport bounds have changed.
center_changed None This event is fired when the map center property changes.
click MouseEvent This event is fired when the user clicks on the map (but not when they click on a marker or infowindow).
dblclick MouseEvent This event is fired when the user double-clicks on the map. Note that the click event will also fire, right before this one.
drag None This event is repeatedly fired while the user drags the map.
dragend None This event is fired when the user stops dragging the map.
dragstart None This event is fired when the user starts dragging the map.
heading_changed None This event is fired when the map heading property changes.
idle None This event is fired when the map becomes idle after panning or zooming.
maptypeid_changed None This event is fired when the mapTypeId property changes.
mousemove MouseEvent This event is fired whenever the user's mouse moves over the map container.
mouseout MouseEvent This event is fired when the user's mouse exits the map container.
mouseover MouseEvent This event is fired when the user's mouse enters the map container.
projection_changed None This event is fired when the projection has changed.
resize None Developers should trigger this event on the map when the div changes size:google.maps.event.trigger(map, 'resize') .
rightclick MouseEvent This event is fired when the DOM contextmenu event is fired on the map container.
tilesloaded None This event is fired when the visible tiles have finished loading.
tilt_changed None This event is fired when the map tilt property changes.
zoom_changed None This event is fired when the map zoom property changes.