Google地图接口API之Google地图 API 参考手册(七)
Google 地图API 参考手册
地图
| 构造函数/对象 | 描述 |
|---|---|
| Map() | 在指定的 HTML 容器中创建新的地图,该容器通常是一个DIV元素。 |
叠加层
| 构造函数/对象 | 描述 |
|---|---|
| Marker | 创建一个标记。 |
| MarkerOptions | 标记的选项。由DirectionsRenderer渲染的所有标记都将使用这些选项。 |
| MarkerImage | A structure representing a Marker icon or shadow image |
| MarkerShape | Defines the marker shape to use in determination of a marker's clickable region (type and coord) |
| Animation | Specifies animations that can be played on a marker (bounce or drop) |
| InfoWindow | Creates an info window |
| InfoWindowOptions | Options for rendering the info window |
| Polyline | Creates a polyline (contains path and stroke styles) |
| PolylineOptions | Options for rendering the polyline |
| Polygon | Creates a polygon (contains path and stroke+fill styles) |
| PolygonOptions | Options for rendering the polygon |
| Rectangle | Creates a rectangle (contains bounds and stroke+fill styles) |
| RectangleOptions | Options for rendering the rectangle |
| Circle | Creates a circle (contains center+radius and stroke+fill styles) |
| CircleOptions | Options for rendering the circle |
| GroundOverlay | |
| GroundOverlayOptions | |
| OverlayView | |
| MapPanes | |
| MapCanvasProjection |
事件
| 构造函数/对象 | 描述 |
|---|---|
| MapsEventListener | It has no methods and no constructor. Its instances are returned from addListener(), addDomListener() and are eventually passed back to removeListener() |
| event | Adds/Removes/Trigger event listeners |
| MouseEvent | Returned from various mouse events on the map and overlays |
控件集
| 构造函数/对象 | 描述 |
|---|---|
| MapTypeControlOptions | Holds options for modifying a control (position and style) |
| MapTypeControlStyle | Specifies what kind of map control to display (Drop-down menu or buttons) |
| OverviewMapControlOptions | Options for rendering of the overview map control (opened or collapsed) |
| PanControlOptions | Options for rendering of the pan control (position) |
| RotateControlOptions | Options for rendering of the rotate control (position) |
| ScaleControlOptions | Options for rendering of the scale control (position and style) |
| ScaleControlStyle | Specifies what kind of scale control to display |
| StreetViewControlOptions | Options for rendering of the street view pegman control (position) |
| ZoomControlOptions | Options for rendering of the zoom control (position and style) |
| ZoomControlStyle | Specifies what kind of zoom control to display (large or small) |
| ControlPosition | Specifies the placement of controls on the map |
地图 API Map() 构造器:
定义和用法
Map() 构造器创建了一个新的地图并插入到指定的HTML元素中(<div> 元素)。
语法
参数值
| 参数 | 描述 |
|---|---|
| HTMLElement | 规定要把地图放置在那个 HTML 元素中。 |
| MapOptions | 带有地图初始化变量/选项的 MapOptions 对象。 |
Map() 的方法
| 方法 | 返回值 | 描述 |
|---|---|---|
| fitBounds(LatLngBounds) | None | 设置要包含给定边界的视口。 |
| getBounds() | LatLng,LatLng | 返回当前视口的西南纬度/经度和东北纬度/经度。 |
| getCenter() | LatLng | 返回地图的中心的纬度/经度。 |
| getDiv() | Node | 返回包含地图的 DOM 对象。 |
| getHeading() | number | 返回航拍图像的罗盘航向(支持 SATELLITE 和 HYBRID 地图类型)。 |
| getMapTypeId() | HYBRID ROADMAP SATELLITE TERRAIN | 返回当前地图类型。 |
| getProjection() | Projection | 返回当前 Projection(投影)。 |
| getStreetView() | StreetViewPanorama | 返回绑定到地图的默认的 StreetViewPanorama。 |
| getTilt() | number | 返回航拍图像的入射角度数(支持 SATELLITE 和 HYBRID 地图类型)。 |
| getZoom() | number | 返回地图的当前缩放级别。 |
| panBy(xnumber,ynumber) | None | 通过以像素计的给定距离改变地图的中心。 |
| panTo(LatLng) | None | 改变地图的中心为给定的 LatLng。 |
| panToBounds(LatLngBounds) | None | 将地图平移所需的最小距离以包含给定的 LatLngBounds。 |
| setCenter(LatLng) | None | |
| setHeading(number) | None | 设置航拍图像的罗盘方向(以度为单位进行测量),基本方向为北方。 |
| setMapTypeId(MapTypeId) | None | 改变要显示的地图类型。 |
| setOptions(MapOptions) | None | |
| setStreetView(StreetViewPanorama) | None | 绑定一个 StreetViewPanorama 到地图上。 |
| setTilt(number) | None | 设置航拍图像的入射角度数(支持 SATELLITE 和 HYBRID 地图类型)。 |
| setZoom(number) | None |
Map() 的属性
| 属性 | 类型 | 描述 |
|---|---|---|
| controls | Array.<MVCArray.<Node>> | 要附加到地图上的额外控件。 |
| mapTypes | MapTypeRegistry | 按字符串 ID 划分的 MapType 实例的注册表。 |
| overlayMapTypes | MVCArray.<MapType> | 要叠加的额外地图类型。 |
Map() 的事件
| 事件 | 参数 | 描述 |
|---|---|---|
| bounds_changed | None | 当可视区域范围更改时会触发此事件。 |
| center_changed | None | 当地图 center(中心)属性更改时会触发此事件。 |
| click | MouseEvent | 当用户点击地图(但不是点击标记或信息窗口)时会触发此事件。 |
| dblclick | MouseEvent | 当用户双击地图时会触发此事件。请注意,触发此事件前还会触发点击事件。 |
| drag | None | 当用户拖动地图时会反复触发此事件。 |
| dragend | None | 当用户停止拖动地图时会触发此事件。 |
| dragstart | None | 当用户开始拖动地图时会触发此事件。 |
| heading_changed | None | 当地图 heading(方向)属性更改时会触发此事件。 |
| idle | None | 当地图在平移或缩放之后变为闲置状态时会触发此事件。 |
| maptypeid_changed | None | 当 mapTypeId 属性更改时会触发此事件。 |
| mousemove | MouseEvent | 只要用户的鼠标在地图容器上移动,就会触发此事件。 |
| mouseout | MouseEvent | 当用户的鼠标从地图容器上退出时会触发此事件。 |
| mouseover | MouseEvent | 当用户的鼠标进入地图容器时会触发此事件。 |
| projection_changed | None | 当投影更改时会触发此事件。 |
| resize | None | 当地图(div)更改尺寸时会触发此事件。 |
| rightclick | MouseEvent | 当用户右击地图时会触发此事件。 |
| tilesloaded | None | 当可见图块载入完成后会触发此事件。 |
| tilt_changed | None | 当地图 tilt(倾斜)属性更改时会触发此事件。 |
| zoom_changed | None | 当地图 zoom(缩放)属性更改时会触发此事件。 |
Google地图接口API之Google地图 API 参考手册(七)的更多相关文章
- Google Play和基于Feature的过滤 —— Feature 参考手册
翻译自 Features Reference 下表列出了软/硬件Feature和权限的参考信息,它们被用于GooglePlay. 硬件feature 下面列出了被大多数当前发布的平台所支持的硬件功能描 ...
- Google地图接口API之申请免费API Key(一)
使用谷歌地图API V3创建交互式地图,首先需要拥有一个免费的 Google 地图 API key. 如果想调用Google地图的接口,首先需要拥有一个免费的 Google 地图 API key.想要 ...
- Google Map Api 谷歌地图接口整理
一:基本知识: 1. 使用谷歌地图 API 的第一步就是要注册一个 API 密钥,需要注重一下两点: 1.假如使用 API 的页面还没有发布,只是在本地调试,可以不用密钥,随便用个字符串代替就可以了. ...
- Google地图接口API之地图类型(六)
1. Google 地图- 基本地图类型 Google Maps API 中提供了以下地图类型: MapTypeId.ROADMAP,用于显示默认的道路地图视图 MapTypeId.SATELLITE ...
- Google地图接口API之地图控件集(五)
1.默认控件集 当使用一个标准的google地图,它的控件默认设置如下: (1). Zoom-显示一个滑动条来控制map的Zoom级别,如下所示:
- 利用 Google API 调用谷歌地图 演示1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- Google Maps Android API v2 (4)- 地图类型
地图类型 地图内的谷歌地图的Android API的种类有很多.地图的类型管辖地图的整体代表性.例如,地图集通常包含政治地图,专注于显示边界和道路地图,显示了一个城市或地区的所有道路. Android ...
- Google Maps Android API v2 (3)- 地图添加到Android应用程序
添加地图的基本步骤是: (一旦)按照以下步骤[入门] [开始],获得API,获取密钥所需的属性,并添加到您的Android清单. 添加一个碎片对象 要处理地图的活动.做到这一点最简单的方法是增加一个 ...
- Google Map API抓取地图坐标信息小程序
因为实验室需要全国城市乡镇的地理坐标,有Execl的地名信息,需要一一查找地方的经纬度.Google Map地图实验室提供自带的查找经纬度的方法,不过需要一个点一个点的手输入,过于繁琐,所以自己利用G ...
随机推荐
- POJ 1797 Heavy Transportation (Dijkstra变形)
F - Heavy Transportation Time Limit:3000MS Memory Limit:30000KB 64bit IO Format:%I64d & ...
- Linux 命令行生成随机密码的十种方法
Linux操作系统的一大优点是对于同样一件事情,你可以使用高达数百种方法来实现它.例如,你可以通过数十种方法来生成随机密码.本文将介绍生成随机密码的十种方法.这些方法均收集于Command-Line ...
- Shortest Word Distance
Given a list of words and two words word1 and word2, return the shortest distance between these two ...
- iOS 中的frame,bounds,center,transform关联
这里有一篇好文章 http://www.winddisk.com/2012/06/07/transform/ 先看几个知识点,UIView 的frame,bounds,center,transform ...
- [Ant] Ant之MacroDef—“宏
转载自:http://lhq1013.iteye.com/blog/1157234 Ant是一个基于Java的跨平台构建工具,它易于使用,并且可扩展.可升级. MacroDef——“宏”,在An ...
- Road Construction(poj 3352)
题意:求最少天几条边,使这个无向图变成双连通图. /* tarjan缩点后,形成一棵树,求出叶子节点数tot,答案是(tot+1)/2 */ #include<cstdio> #inclu ...
- Controller与View之间的数据传递
1)Controller向View传递数据ViewData["message"] = "Hello";//使用ViewData传递数据ViewBag.Time ...
- p235习题3
- 解决TIME_WAIT过多造成的问题
sh-4.1# netstat -an |awk '/tcp/ {++S[$NF]}END {for (a in S) print a , S[a]}' TIME_WAIT CLOSE_WAIT ES ...
- IIS7 / IIS7.5 URL 重写 HTTP 重定向到 HTTPS(转)
转自: http://www.cnblogs.com/yipu/p/3880518.html 1.购买SSL证书,参考:http://www.cnblogs.com/yipu/p/3722135. ...