- 浏览: 16026274 次
- 性别:
- 来自: 济南
最新评论
-
wu1236:
ef0793cd94337324b6fefc4c9474af5 ...
Android ApiDemos示例解析(87):Media->MediaPlayer -
77219634:
0127bf2236bee4dd1f632ce430f1af1 ...
本博客文章都为转载,没有任何版权! -
77219634:
0127bf2236bee4dd1f632ce430f1af1 ...
VPLEX - EMC的RAC -
77219634:
0127bf2236bee4dd1f632ce430f1af1 ...
qTip2 Show -
77219634:
0127bf2236bee4dd1f632ce430f1af1 ...
SecureCRT中文乱码、复制粘贴乱码解决办法(修改版)
Google Maps API Reference——Google 地图 API 文档之七-2
class GMapOptions
This class represents optional arguments to the GMap2
constructor. It has no constructor, but is instantiated as an object literal.
Properties
size | GSize | Sets the size in pixels of the map. The container that is passed to the map constructor will be resized to the given size. By default, the map will assume the size of its container. |
mapTypes | Array of GMapType | Array of map types to be used by this map. By default, G_DEFAULT_MAP_TYPES is used. You can use this option to restrict the set of predefined map types that is displayed on the map, or to pass your own map types to the map. See also GMap2.addMapType() . |
draggableCursor | String | The cursor to display when the map is draggable. (Since 2.59) |
draggingCursor | String | The cursor to display while dragging the map. (Since 2.59) |
enum GMapPane
These constants define the layering system that is used by overlay to display themselves on the map. There are different layers for icons, shadows, the info window, the shadow on the info window, and transparent mouse event catching objects.
You need to use this type if you subclass from GOverlay
.
Constants
G_MAP_MAP_PANE | This pane is still below the shadows of the markers, directly on top of the map. It contains for instance the polylines. |
G_MAP_MARKER_SHADOW_PANE | This pane contains the shadows of the markers. It is below the markers. |
G_MAP_MARKER_PANE | This pane contains the markers. |
G_MAP_FLOAT_SHADOW_PANE | This pane contains the shadow of the info window. It is above the G_MAP_MARKER_PANE , so that markers can be in the shadow of the info window. |
G_MAP_MARKER_MOUSE_TARGET_PANE | This pane contains transparent elements that receive DOM mouse events for the markers. Is is above the G_MAP_FLOAT_SHADOW_PANE , so that markers in the shadow of the info window can be clickable. |
G_MAP_FLOAT_PANE | This pane contains the info window. It is above everything else on the map. |
class GKeyboardHandler
Instantiate this class to add keyboard bindings to a map. The key bindings are the same as for the maps application.
up, down, left, right | Moves the map continuously while the key is pressed. Two keys can be pressed simultaneously in order to move diagonally. |
page down, page up, home, end | Pans the map by 3/4 its size in the corresponding direction, with a nice animation. This corresponds to the arrow buttons in the GLargeMapControl and the GSmallMapControl. |
+, - | Zooms one level in or out, respectively. This corresponds to the + and - buttons in the GLargeMapControl and the GSmallMapControl. |
Constructor
GKeyboardHandler(map) | Installs keyboard event handler for the map passed as argument. |
interface GOverlay
This interface is implemented by the GMarker
, GPolyline
, GTileLayerOverlay
and GInfoWindow
classes in the maps API library. You can implement it if you want to display custom types of overlay objects on the map. An instance of GOverlay
can be put on the map with the method GMap2.addOverlay()
. The map will then call the method GOverlay.initialize()
on the overlay instance to display itself on the map initially. Whenever the map display changes, the map will call GOverlay.redraw()
so that the overlay can reposition itself if necessary. The overlay instance can use the method GMap2.getPane()
to get hold of one or more DOM container elements to attach itself to.
Constructor
GOverlay() | This constructor creates dummy implementations for the methods. Still, when inheriting from this class, your derived class constructor should call this constructor for completeness. |
Static Methods
getZIndex(latitude) | Number | Returns a CSS z-index value for a given latitude. It computes a z index such that overlays further south are on top of overlays further north, thus creating the 3D appearance of marker overlays. |
Abstract Methods
initialize(map) | none | Called by the map after the overlay is added to the map using GMap2.addOverlay() . The overlay object can draw itself into the different panes of the map that can be obtained using GMap2.getPane() . |
remove() | none | Called by the map after the overlay is removed from the map using GMap2.removeOverlay() or GMap2.clearOverlays() . The overlay must remove itself from the map panes here. |
copy() | GOverlay | Returns an uninitialized copy of itself that can be added to the map. |
redraw(force) | none | Called by the map when the map display has changed. The argument force will be true if the zoom level or the pixel offset of the map view has changed, so that the pixel coordinates need to be recomputed. |
class GInfoWindow
GInfoWindow
has no constructor. It is created by the map and accessed by its method GMap2.getInfoWindow()
.
Methods
selectTab(index) | none | Selects the tab with the given index. This has the same effect as clicking on the corresponding tab. |
hide() | none | Makes the info window invisible. NOTE: This doesn't close the info window. It can be made visible again using show() . |
show() | none | Makes the info window visible if its currently invisible. |
isHidden() | Boolean | Returns true iff the info window is hidden. This includes the state that it's closed. |
reset(point, tabs, size, offset?, selectedTab?) | none | Resets the state of the info window. Each argument may be null and then its value will not be changed from the current value. |
getPoint() | GLatLng | Returns the geographical point at which the info window is anchored. The tip of the window points to this point on the map, modulo the pixel offset. |
getPixelOffset() | GSize | Returns the offset, in pixels, of the tip of the info window from the point on the map at whose geographical coordinates the info window is anchored. |
getSelectedTab() | Number | Returns the index, starting at 0, of the current selected tab. |
getTabs() | Array of GInfoWindowTabs | Returns the array of tabs in this info window. (Since 2.59) |
getContentContainers() | Array of Node | Returns the array of DOM nodes that hold the content of the tabs of this info window. (Since 2.59) |
Events
closeclick | none | This event is fired when the info window close button is clicked. An event handler for this event can implement to close the info window, by calling the GMap2.closeInfoWindow() method. |
class GInfoWindowTab
An array of instances of this class can be passed as the tabs
argument to the methods GMap2.openInfoWindowTabs()
, GMap2.openInfoWindowTabsHtml()
, GMarker.openInfoWindowTabs()
, GMarker.openInfoWindowTabsHtml()
, and the GMarker.bindInfoWindow*()
variants. If the array contains more than one element, the info window will be shown with tabs. Every InfoWindowTab
object contains two items: content
defines the content of the info window when the tab is selected, and label
defines the label of the tab. The properties are passed as arguments to the constructor. For the openInfoWindowTabs()
methods, content
is a DOM Node. For the methods openInfoWindowTabsHtml()
, content
is a string that contains HTML text.
Constructor
GInfoWindowTab(label, content) | Creates an info window tab data structure that can be passed in the tabs argument to openInfoWindowTabs*() methods. |
class GInfoWindowOptions
Instances of this class are used in the opts?
argument to the methods openInfoWindow()
, openInfoWindowHtml()
, openInfoWindowTabs()
, openInfoWindowTabsHtml()
, the bindInfoWindow*()
variants, and showMapBlowup()
of classes GMap2
and GMarker
. There is no constructor for this class. Instead, this class is instantiated as javascript object literal.
Properties
As the name of this class indicates, all properties are optional.
selectedTab | Number | Selects the tab with the given index, starting at 0, instead of the first tab (with index 0). |
maxWidth | Number | Maximum width of the info window content, in pixels. |
noCloseOnClick | Boolean | Indicates whether or not the info window should close for a click on the map that was not on a marker. If set to true , the info window will not close when the map is clicked. The default value is false . (Since 2.83) |
onOpenFn | Function | Function is called after the info window is opened and the content is displayed. |
onCloseFn | Function | Function is called when the info window is closed. |
zoomLevel | Number | Pertinent for showMapBlowup() only. The zoom level of the blowup map in the info window. |
mapType | GMapType | Pertinent for showMapBlowup() only. The map type of the blowup map in the info window. |
class GMarker
A GMarker
marks a position on the map. It implements the GOverlay
interface and thus is added to the map using the GMap2.addOverlay()
method.
A marker object has a point
, which is the geographical position where the marker is anchored on the map, and an icon
. If the icon
is not set in the constructor, the default icon G_DEFAULT_ICON
is used.
After it is added to a map, the info window of that map can be opened through the marker. The marker object will fire mouse events and infowindow events.
Constructor
GMarker(point, icon?, inert?) | Creates a marker at the passed point of either GPoint or GLatLng with icon or the G_DEFAULT_ICON . If the inert flag is true , then the marker is not clickable and will not fire any events. (Deprecated since 2.50) |
GMarker(latlng, opts?) | Creates a marker at the latlng with options specified in GMarkerOptions . By default markers are clickable & have the default icon G_DEFAULT_ICON . (Since 2.50) |
Methods
Before these methods can be invoked, the marker must be added to a map.
openInfoWindow(content, opts?) | none | Opens the map info window over the icon of the marker. The content of the info window is given as a DOM node. Only option GInfoWindowOptions.maxWidth is applicable. |
openInfoWindowHtml(content, opts?) | none | Opens the map info window over the icon of the marker. The content of the info window is given as a string that contains HTML text. Only option GInfoWindowOptions.maxWidth is applicable. |
openInfoWindowTabs(tabs, opts?) | none | Opens the tabbed map info window over the icon of the marker. The content of the info window is given as an array of tabs that contain the tab content as DOM nodes. Only options GInfoWindowOptions.maxWidth and InfoWindowOptions.selectedTab are applicable. |
openInfoWindowTabsHtml(tabs, opts?) | none | Opens the tabbed map info window over the icon of the marker. The content of the info window is given as an array of tabs that contain the tab content as Strings that contain HTML text. Only options InfoWindowOptions.maxWidth and InfoWindowOptions.selectedTab are applicable. |
bindInfoWindow(content, opts?) | none | Binds the given DOM node to this marker. The content within this node will be automatically displayed in the info window when the marker is clicked. Pass content as null to unbind. (Since 2.85) |
bindInfoWindowHtml(content, opts?) | none | Binds the given HTML to this marker. The HTML content will be automatically displayed in the info window when the marker is clicked. Pass content as null to unbind. (Since 2.85) |
bindInfoWindowTabs(tabs, opts?) | none | Binds the given GInfoWindowTab s (provided as DOM nodes) to this marker. The content within these tabs' nodes will be automatically displayed in the info window when the marker is clicked. Pass tabs as null to unbind. (Since 2.85) |
bindInfoWindowTabsHtml(tabs, opts?) | none | Binds the given GInfoWindowTab s (provided as strings of HTML) to this marker. The HTML content within these tabs will be automatically displayed in the info window when the marker is clicked. Pass tabs as null to unbind. (Since 2.85) |
closeInfoWindow() | none | Closes the info window only if it belongs to this marker. (Since 2.85) |
showMapBlowup(opts?) | none | Opens the map info window over the icon of the marker. The content of the info window is a closeup map around the marker position. Only options InfoWindowOptions.zoomLevel and InfoWindowOptions.mapType are applicable. |
getIcon() | GIcon | Returns the icon of this marker, as set by the constructor. |
getTitle() | String | Returns the title of this marker, as set by the constructor via the GMarkerOptions.title property. Returns undefined if no title is passed in. (Since 2.85) |
getPoint() | GLatLng | Returns the geographical coordinates at which this marker is anchored, as set by the constructor or by setPoint() . (Deprecated since 2.88) |
getLatLng() | GLatLng | Returns the geographical coordinates at which this marker is anchored, as set by the constructor or by setLatLng() . (Since 2.88) |
setPoint(point) | none | Sets the geographical coordinates of the point at which this marker is anchored. (Deprecated since 2.88) |
setLatLng(point) | none | Sets the geographical coordinates of the point at which this marker is anchored. (Since 2.88) |
enableDragging() | none | Enables the marker to be dragged and dropped around the map. To function, the marker must have been initialized with GMarkerOptions.draggable = true . |
disableDragging() | none | Disables the marker from being dragged and dropped around the map. |
draggable() | Boolean | Returns true if the marker has been initialized via the constructor using GMarkerOptions.draggable = true . Otherwise, returns false . |
draggingEnabled() | Boolean | Returns true if the marker is currently enabled for the user to drag on the map. |
setImage(url) | none | Requests the image specified by the url to be set as the foreground image for this marker. Note that neither the print image nor the shadow image are adjusted. Therefore this method is primarily intended to implement highlighting or dimming effects, rather than drastic changes in marker's appearances. (Since 2.75) |
hide() | none | Hides the marker if it is currently visible. Note that this function triggers the event GMarker.visibilitychanged in case the marker is currently visible. (Since 2.77) |
show() | none | Shows the marker if it is currently hidden. Note that this function triggers the event GMarker.visibilitychanged in case the marker is currently hidden. (Since 2.77) |
isHidden() | Boolean | Returns true if the marker is currently hidden. Otherwise returns false . (Since 2.77) |
Events
All these events fire only if the marker is not inert (see constructor).
click | none | This event is fired when the marker icon was clicked. Notice that this event will also fire for the map, with the marker passed as the first argument to the event handler there. |
dblclick | none | This event is fired when the marker icon was double-clicked. Notice that this event will not fire for the map, because the map centers on double-click as a hardwired behavior. |
mousedown | none | This event is fired when the DOM mousedown event is fired on the marker icon. Notice that the marker will stop the mousedown DOM event, so that it doesn't cause the map to start dragging. |
mouseup | none | This event is fired for the DOM mouseup on the marker. Notice that the marker will not stop the mousedown DOM event, because it will not confuse the drag handler of the map. |
mouseover | none | This event is fired when the mouse enters the area of the marker icon. |
mouseout | none | This event is fired when the mouse leaves the area of the marker icon. |
infowindowopen | none | This event is fired when the info window of the map was opened through this marker. |
infowindowbeforeclose | none | This event is fired before the info window of the map that was opened through this marker is closed. (Since 2.83) |
infowindowclose | none | This event is fired when the info window of the map that was opened through this marker is closed. This happens when either the info window was closed, or when it was opened on another marker, or on the map. The event infowindowbeforeclose is fired before this event. |
remove | none | This event is fired when the marker is removed from the map, using GMap2.removeOverlay() or GMap2.clearOverlays() . |
dragstart | none | If the marker is enabled for dragging, this event is fired when the marker dragging begins. |
drag | none | If the marker is enabled for dragging, this event is fired when the marker is being dragged. |
dragend | none | If the marker is enabled for dragging, this event is fired when the marker ceases to be dragged. |
visibilitychanged | isVisible | This event is fired when the visibility of the marker is changed (i.e. the visibility is flipped from visible to hidden or vice-versa). isVisible refers to the state of the marker after the visibility change has happened. (Since 2.77) |
class GMarkerOptions
Instances of this class are used in the opts?
argument to the constructor of the GMarker
class. There is no constructor for this class. Instead, this class is instantiated as a javascript object literal.
Properties
As the name of this class indicates, all properties are optional.
icon | GIcon | Chooses the Icon for this class. If not specified, G_DEFAULT_ICON is used. (Since 2.50) |
dragCrossMove | Boolean | When dragging markers normally, the marker floats up and away from the cursor. Setting this value to true keeps the marker underneath the cursor, and moves the cross downwards instead. The default value for this option is false . (Since 2.63) |
title | String | This string will appear as tooltip on the marker, i.e. it will work just as the title attribute on HTML elements. (Since 2.50) |
clickable | Boolean | Toggles whether or not the marker is clickable. Markers that are not clickable or draggable are inert, consume less resources and do not respond to any events. The default value for this option is true , i.e. if the option is not specified, the marker will be clickable. (Since 2.50) |
draggable | Boolean | Toggles whether or not the marker will be draggable by users. Markers set up to be dragged require more resources to set up than markers that are clickable. Any marker that is draggable is also clickable, bouncy and auto-pan enabled by default. The default value for this option is false . (Since 2.61) |
bouncy | Boolean | Toggles whether or not the marker should bounce up and down after it finishes dragging. The default value for this option is false . (Since 2.61) |
bounceGravity | Number | When finishing dragging, this number is used to define the acceleration rate of the marker during the bounce down to earth. The default value for this option is 1 . (Since 2.61) |
autoPan | Boolean | Auto-pan the map as you drag the marker near the edge. If the marker is draggable the default value for this option is true . (Since 2.87) |
相关推荐
├─05 实战Google Maps API之三——地图天气预报服务 │ ├─5.1 在Google地图上显示天气预报 │ │ ├─5.1.2 利用Google AJAX Feed API加载RSS文档 │ │ └─5.1.3 YWeather()类的构造 │ └─5.2 │ └─...
用于 JavaScript 的 Google Maps API V3 中文参考文档 与官网文档格式基本相同
Google Maps API编程资源大全
Google Maps为代表的地图服务的推出开创了全球化地理信息服务新的开端,C,ooSle Maps提供的API具有开放式、 低成本和易用性的特点,使其应用更加广泛。本文通过介绍Goosle Maps的功能、特点和C,oosle Maps API的使用...
google-maps-services-go, 谷歌地图 API Web服务的客户端库 访问 谷歌地图 服务 描述使用要对进行地理编码? 查找方向。? 也许是矩阵的方向。? 这个库将 谷歌地图 API Web服务 插件引入到你的go应用程序中。 谷歌...
google-maps-api-threejs-layer, 谷歌地图 API层,使用 Three.js 实现超快速动画 用于 谷歌地图 API的 Three.js-层谷歌地图 API层,使用 Three.js 实现超快速动画。用法new ThreejsLayer(options, completeCallback)...
├─04 实战Google Maps API之二——BLOG访客地域来源记录 │ ├─4.1 定位访客位置的博客小地图 │ └─4.2 记录访客的地域来源 │ └─guestmap GuestMap实例代码
Google Maps API示例CHM文档下载
谷歌地图GoogleMaps3.310 谷歌地图GoogleMaps3.310 谷歌地图GoogleMaps3.310 谷歌地图GoogleMaps3.310
创建Googlemaps-api_key,Googlemaps-api_key的相关信息和教程
GoogleMaps API V3离线下载工具及使用.zip 主要对其地图的下载,及自我编制。 离线下完全可以使用,只需先进行地图的下载。 添加了控件,离线下可进行操作。。。
包含翻译后的API文档:guava-30.1.1-jre-javadoc-API文档-中文(简体)版.zip; Maven坐标:com.google.guava:guava:30.1.1-jre; 标签:google、guava、中文文档、jar包、java; 使用方法:解压翻译后的API文档,用...
书中详细介绍Google Maps API的应用,从开发环境搭建到事件、控件、叠加层、地址解析、本地搜索等,全面介绍,网点管理系统和地图搜索应用实例。
├─07 Google Maps API深度历险 │ ├─7.1 导入Google Maps API库 │ │ ├─7.1.2 导入不同语言的Google Maps API库文件 │ │ └─7.1.3 在...│ ├─7.5.1-2 汉化Google地图 │ └─7.5.3-4 打造完美的混合地图
angular-google-maps, Angular 2 谷歌地图 组件 AGM - Angular 谷歌地图谷歌地图的Angular 2 组件。 ( 以前称为 angular2-google-maps )注意:项目 NAME 已经从 angular2-google-maps 映射更改到 AGM
Google Maps API android demo Eciplse project source code and javacript version Google Maps API and Place Search example html.
Google Masp API. 方便学习Google Map 的朋友。此版是英文原版的,但难度不大,很容易看懂
google_map_API谷歌地图API
本书从易到难、由浅入深、循序渐进地介绍了Google Maps API和Google Earth API的开发技术。本书知识讲解通俗易懂,并有大量的实例供读者更加深刻地巩固所学习的知识,帮助读者更好地进行开发实践。 本书共分为18...
Google-Maps-API-China