Appearance
GeolocateControl
GeolocateControl
定位控件
Examples
javascript
const gCtrol = new GeolocateControl()
map.addControl(gCtrol, "right-right")constructor
构造函数
Parameters
options{positionOptions: (PositionOptions | undefined)?, fitBoundsOptions: (FitBoundsOptions | undefined)?, trackUserLocation: (boolean | undefined)?, showAccuracyCircle: (boolean | undefined)?, showUserLocation: (boolean | undefined)?, showUserHeading: (boolean | undefined)?, geolocation: (Geolocation | undefined)?}? 可选参数对象。options.positionOptions定位选项对象。options.fitBoundsOptions自适应地图视野选项对象。options.trackUserLocation是否追踪用户位置,默认为 false。options.showAccuracyCircle是否显示用户位置精度圈,默认为 true。options.showUserLocation是否显示用户位置,默认为 false。options.showUserHeading是否显示用户朝向,默认为 false。options.geolocation自定义 Geolocation 对象。
trigger
触发定位
Returns boolean
