没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
24/07/2008 23:56Google Maps API Reference - Google Maps API - Google Code
Page 1 of 71http://code.google.com/apis/maps/documentation/reference.html#GInfoWindow
Google Maps API
Home Docs FAQ Articles Blog Group Terms
The Google Maps API is now integrated with the Google AJAX API loader, which creates a common namespace for
loading and using multiple Google AJAX APIs. This framework allows you to use the optional google.maps.*
namespace for all classes, methods and properties you currently use in the Google Maps API, replacing the normal
G prefix with this namespace. Don't worry: the existing G namespace will continue to be supported.
For example, the GMap2 object within the Google Maps API can also be defined as google.maps.Map2.
Note that this reference documentation refers only to the existing G namespace.
If you only want to use the map to display your content, then you need to know these classes, types, and functions:
GMap2
GMapOptions
GGoogleBarOptions
GInfoWindow
GInfoWindowTab
GInfoWindowOptions
GMarker
GMarkerOptions
GPolyline
GPolylineOptions
GPolyEditingOptions
GPolyStyleOptions
GPolygon
GPolygonOptions
GScreenOverlay
GScreenPoint
GScreenSize
GGroundOverlay
GIcon
GPoint
GSize
GBounds
GLatLng
GLatLngBounds
GControl
GTileLayerOptions
GTileLayerOverlayOptions
GEvent
GEventListener
GXmlHttp
GXml
GXslt
GLog
GDraggableObject
GDraggableObjectOptions
GGeoStatusCode
GGeoAddressAccuracy
GClientGeocoder
GGeocodeCache
GFactualGeocodeCache
GMarkerManager
GMarkerManagerOptions
GGeoXml
GDownloadUrl
GBrowserIsCompatible
GDirections
GDirectionsOptions
GRoute
GStep
GTrafficOverlay
GAdsManager
GAdsManagerOptions
GStreetviewPanorama
GStreetviewPanoramaOptions
GStreetviewOverlay
GStreetviewClient
GStreetviewClient.ReturnValues
GStreetviewData
GStreetviewLocation
GStreetviewLink
GPov
GStreetviewPanorama.ErrorValues
If you want to extend the functionality of the maps API by implementing your own controls, overlays, or map types, then
you also need to know these classes and types:
GGoogleBarListingTypes
GGoogleBarLinkTarget
GGoogleBarResultList
GControlAnchor
GMapTypeControl
GMenuMapTypeControl
GTileLayerOverlay
GCopyrightCollection
GCopyright
Docs > API Reference
Google Maps API Reference
©2008 Google - Code Home - Site Terms of Service - Privacy Policy - Site Directory
24/07/2008 23:56Google Maps API Reference - Google Maps API - Google Code
Page 2 of 71http://code.google.com/apis/maps/documentation/reference.html#GInfoWindow
GMapPane
GOverlay
GControl
GControlPosition
GHierarchicalMapTypeControl
GMapType
GMapTypeOptions
GTileLayer
GProjection
GMercatorProjection
class GMap2
Instantiate class GMap2 in order to create a map. This is the central class in the API. Everything else is auxiliary.
Constructor Description
GMap2(container,
opts?)
Creates a new map inside of the given HTML container, which is typically a
DIV element. If no set of map types is given in the optional argument
opts.mapTypes, the default set G_DEFAULT_MAP_TYPES is used. If
no size is given in the optional argument opts.size, then the size of the
container is used. If opts.size is given, then the container element
of the map is resized accordingly. See class GMapOptions.
Methods Return
Value
Description
enableDragging() none Enables the dragging of the map (enabled by
default).
disableDragging() none Disables the dragging of the map.
draggingEnabled() Boolean
Returns true iff the dragging of the map is
enabled.
enableInfoWindow() none Enables info window operations on the map
(enabled by default).
disableInfoWindow() none Closes the info window, if it is open, and
disables the opening of a new info window.
infoWindowEnabled() Boolean
Returns true iff the info window is enabled.
enableDoubleClickZoom() none Enables double click to zoom in and out
(disabled by default). (Since 2.58)
disableDoubleClickZoom() none Disables double click to zoom in and out.
(Since 2.58)
doubleClickZoomEnabled() Boolean
Returns true iff double click to zoom is
enabled. (Since 2.58)
enableContinuousZoom() none Enables continuous smooth zooming for select
browsers (disabled by default). (Since 2.58)
disableContinuousZoom() none Disables continuous smooth zooming. (Since
2.58)
continuousZoomEnabled() Boolean
Returns true if continuous smooth zooming is
enabled. (Since 2.58)
Constructor
Methods
Configuration
24/07/2008 23:56Google Maps API Reference - Google Maps API - Google Code
Page 3 of 71http://code.google.com/apis/maps/documentation/reference.html#GInfoWindow
enableGoogleBar() none Enables the GoogleBar, an integrated search
control, to the map. When enabled, this control
takes the place of the default Powered By
Google logo. Note that this control is not
enabled by default. (Since 2.92)
disableGoogleBar() none Disables the GoogleBar integrated search
control. When disabled, the default Powered by
Google logo occupies the position formerly
containing this control. Note that this control is
already disabled by default. (Since 2.92)
enableScrollWheelZoom() none Enables zooming using a mouse's scroll wheel.
Note: scroll wheel zoom is disabled by default.
(Since 2.78)
disableScrollWheelZoom() none Disables zooming using a mouse's scroll wheel.
Note: scroll wheel zoom is disabled by default.
(Since 2.78)
scrollWheelZoomEnabled() Boolean Returns a Boolean indicating whether scroll
wheel zooming is enabled. (Since 2.78)
Methods Return
Value
Description
addControl(control,
position?)
none Adds the control to the map. The position on the map
is determined by the optional position argument. If
this argument is absent, the default position of the
control is used, as determined by the
GControl.getDefaultPosition() method. A
control instance must not be added more than once to
the map.
removeControl(control) none Removes the control from the map. It does nothing if
the control was never added to the map.
getContainer() Node Returns the DOM object that contains the map. Used
by GControl.initialize().
Methods Return
Value
Description
getMapTypes() Array of
GMapType
Returns the array of map types registered with this
map.
getCurrentMapType() GMapType Returns the currently selected map type.
setMapType(type) none Selects the given new map type. The type must be
known to the map. See the constructor, and the
method addMapType().
addMapType(type) none Adds a new map type to the map. See section
GMapType for how to define custom map types.
removeMapType(type) none Removes the map type from the map. Will update the
set of buttons displayed by the GMapTypeControl
or GHierarchicalMapTypeControl and fire
Controls
Map Types
24/07/2008 23:56Google Maps API Reference - Google Maps API - Google Code
Page 4 of 71http://code.google.com/apis/maps/documentation/reference.html#GInfoWindow
or GHierarchicalMapTypeControl and fire
the removemaptype event.
Methods Return Value Description
isLoaded() Boolean
Returns true iff the map was initialized by
setCenter() since it was created.
getCenter() GLatLng Returns the geographical coordinates of the center
point of the map view.
getBounds() GLatLngBounds Returns the the visible rectangular region of the map
view in geographical coordinates.
getBoundsZoomLevel(bounds) Number Returns the zoom level at which the given rectangular
region fits in the map view. The zoom level is
computed for the currently selected map type. If no
map type is selected yet, the first on the list of map
types is used.
getSize() GSize Returns the size of the map view in pixels.
getZoom() Number Returns the current zoom level.
getDragObject() GDraggableObject Returns the draggable object used by this map. (Since
2.93)
getEarthInstance(callback) none Retrieves the instance of the Google Earth Browser
Plugin attached to this map, and calls the passed
callback function once the instance is ready to receive
commands, passing the earth instance (a GEPlugin
object) as a parameter. This callback function may fire
immediately if the Earth instance had previously been
instantiated by setting the Google Earth map type via
GMap2.setMapType(G_SATELLITE_3D_MAP).
If the instance if not yet created, calling
getEarthInstance will initialize the Google Earth
Plug-in. (This asynchronous behavior is why this
method requires a callback.) Note: if the initialization
encounters an error, the callback function will pass a
null parameter. Note that that while this method will
create an Earth instance, it will not set the Earth map
type as the current view. To so so, call
GMap2.setMapType(G_SATELLITE_3D_MAP)
explicitly, or allow the user to select this map type via
the MapTypeControl. See the Google Earth API
Developer's Guide for details on how to use the
GEPlugin object. (Since 2.113)
Methods Return
Value
Description
setCenter(center,
zoom?, type?)
none Sets the map view to the given center. Optionally,
also sets zoom level and map type. The map type
must be known to the map. See the constructor, and
the method addMapType(). This method must be
called first after construction to set the initial state of
the map. It is an error to call operations on a newly
Map State
Modify the Map State
24/07/2008 23:56Google Maps API Reference - Google Maps API - Google Code
Page 5 of 71http://code.google.com/apis/maps/documentation/reference.html#GInfoWindow
the map. It is an error to call operations on a newly
constructed GMap2 object until after this function is
invoked.
panTo(center) none Changes the center point of the map to the given
point. If the point is already visible in the current map
view, change the center in a smooth animation.
panBy(distance) none Starts a pan animation by the given distance in
pixels.
panDirection(dx, dy) none Starts a pan animation by half the width of the map
in the indicated directions. +1 is right and down, -1
is left and up, respectively.
setZoom(level) none Sets the zoom level to the given new value.
zoomIn() none Increments zoom level by one.
zoomOut() none Decrements zoom level by one.
savePosition() none Stores the current map position and zoom level for
later recall by returnToSavedPosition().
returnToSavedPosition() none Restores the map view that was saved by
savePosition().
checkResize() none Notifies the map of a change of the size of its
container. Call this method after the size of the
container DOM object has changed, so that the map
can adjust itself to fit the new size.
Methods Return
Value
Description
addOverlay(overlay) none Adds an overlay to the map and fires the
addoverlay event.
removeOverlay(overlay) none Removes the overlay from the map. If the overlay was
on the map, it fires the removeoverlay event.
clearOverlays() none Removes all overlay from the map, and fires the
clearoverlays event.
getPane(pane) Node Returns a DIV that holds the object in the layer
identified by pane. Used by GOverlay instances in
method GOverlay.initialize() instances to
draw themselves on the map
Methods Return Value Description
openInfoWindow(latlng, node,
opts?)
none Opens a simple info window at
the given point. Pans the map
such that the opened info
window is fully visible. The
content of the info window is
given as a DOM node.
Overlays
Info Window
剩余70页未读,继续阅读
资源评论
史前文物
- 粉丝: 17
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功