Geolocation Marker for Google Maps v3
来源:互联网 发布:云计算 pdf 编辑:程序博客网 时间:2024/05/16 13:58
Geolocation Marker for Google Maps v3
This library uses geolocation to add a marker and accuracy circle to a map. The marker position is automatically updated as the user position changes.
To add the Geolocation Marker, just instantiate a new GeolocationMarker object, passing your map to it:
var mapOptions = { zoom: 17, center: new google.maps.LatLng(-34.397, 150.644), mapTypeId: google.maps.MapTypeId.ROADMAP};var map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions);var GeoMarker = new GeolocationMarker(map);
See the example.
Note: This library will only function in browsers supporting theW3C Geolocation API. This excludes Internet Explorer versions 8 and older.
class GeolocationMarker
This class extends google.maps.MVCObject.
Constructor
GeolocationMarker(map?:google.maps.Map, marker_opts?:google.maps.MarkerOptions, circle_opts?:google.maps.CircleOptions)
A marker and accuracy circle positioned on the map to track the user's location.Methods
getAccuracy()
number|null
Returns the current accuracy of the location data. Will return null
if a position has not yet been obtained.getBounds()
google.maps.LatLngBounds|null
Returns the lat/lng bounds containing the marker and accuracy circle. Will returnnull
if a position has not yet been obtained.getMap()
google.maps.Map
getMinimumAccuracy()
number|null
Returns the minimum accuracy (in meters) that must be achieved before the marker is initially drawn on the map. Returnsnull
if no minimum is specified.getPosition()
google.maps.LatLng|null
Returns the center of the marker and accuracy circle. Will return null
if a position has not yet been obtained.getPositionOptions()
PositionOptionsInterface
Returns the current options used to call the geolocation.watchPosition method.setCircleOptions(options:google.maps.CircleOptions)
This method will ignore certain properties of the google.maps.CircleOptions object. It will ignoreposition
, radius
andmap
properties as these are set by the library.setMap(map:google.maps.Map)
setMarkerOptions(options:google.maps.MarkerOptions)
This method will ignore certain properties of the google.maps.MarkerOptions object. It will ignoreposition
and map
properties as these are set by the library.setMinimumAccuracy(accuracy:number|null)
Sets the minimum accuracy (in meters) that must be achieved before the marker is initially drawn on the map.setPositionOptions(positionOpts: PositionOptionsInterface)
Sets the options used to call the geolocation.watchPosition method.Events
accuracy_changed
geolocation_error
PositionErrorInterface
Triggered whenever geolocation fails. Can be caused by a user denying permission to access location data.position_changed
- Geolocation Marker for Google Maps v3
- google maps V3 给多个marker添加infowindows信息
- Google Maps API V3
- google maps v3 示例
- google Maps V3测距
- google maps v3 电子地图测距
- Google Maps JavaScript API v3
- Google Maps JavaScript API v3
- HTML5+geolocation结合google+maps的应用+MapMail
- 电信Android手机结合Google Maps Geolocation API定位
- Google Maps JavaScript API V3 参考
- Google Maps API v3离线开发包
- 使用Google Maps JavaScript API V3
- google maps api v3版页面镶嵌
- Google Maps API v3离线开发包
- Google Maps JavaScript API V3 叠加层
- Google Maps JavaScript API V3 基础知识
- Google Maps Api V3 地理位置搜索
- EditText设置/隐藏光标位置、选中文本和获取/清除焦点
- 配置WifiConfiguration
- 磁盘访问题
- Oracle PL/SQL中如何使用%TYPE和%ROWTYPE
- js Cookie 读写
- Geolocation Marker for Google Maps v3
- SQL语句数据库分离、附加
- 11.12变量控制器
- linux /etc/hosts的修改
- windows server 2003问题
- windws store app 中的ready
- Sql视图初步
- JSP设计模式
- C#--第十周作业之打开对话框和加载动态图片并给与提示