MMapGeolocationControl
The MMapGeolocationControl
class determines a user's location by calling the browser's standard geolocation function and/or identifying their IP address.
Note
This class is a JS API package component and provides additional features not included in the core API.
To integrate the package, follow the instructions.
Usage example
Add the location button:
const map = new MMap(element, {
location: {center: [25.229762, 55.289311], zoom: 14}
});
const controls = new MMapControls();
controls.addChild(new MMapGeolocationControl());
map.addChild(controls);
Constructor
new MMapGeolocationControl(props
)
Constructor parameters
Parameter |
Type |
|
Redefines
Props
MMapGeolocationControlProps: Object
Parameters
Parameter |
Type |
Description |
|
|
Duration of location animation on the map. |
|
Easing function for animating the location on the map. |
|
|
( |
Callback of a geolocation request. |
|
|
ID of the data source for a geolocation tag. |
|
|
Map scale after the location is determined. |
Methods
addChild
addChild(child
, index?
): MMapGeolocationControl
Parameters
Parameter |
Type |
|
|
|
|
Returns
Inherited from
removeChild
removeChild(child
): MMapGeolocationControl
Parameters
Parameter |
Type |
|
|
Returns
Inherited from
update
update(changedProps
): void
Parameters
Parameter |
Type |
Description |
|
New |
Returns
void