Protected
_initProtected
Readonly
_starterReadonly
emitterReadonly
keysReadonly
mapReadonly
runtimeStatic
getStatic
keysProtected
_addProtected
_emitProtected
_onManual way to create a map (If MapOptions.create is false
).
const webMap = new WebMap(options);
webMap.create().then(() => doSomething());
Sets a map view that contains the given geographical bounds.
Array of coordinates, measured in degrees, in [west, south, east, north] order.
Optional
options: FitOptions// Whole world
webMap.fitBounds([0, -90, 180, 90]);
Returns the map's geographical centerpoint.
lngLat Array of two numbers representing longitude and latitude of the center of the map view.
// Mount Everest 27° 59′ 17″ N, 86° 55′ 31″ E
webMap.getCenter(); // [86.925278, 27.988056]
Checking the status of any asynchronous operation
The name of the event whose status is checked
var webMap = new WebMap(options);
webMap.getEventStatus('create'); // false
webMap.emitter.on('create', function () {
webMap.getEventStatus('create'); // true
})
Optional
events: LocationEventshelper method to wait for events to load. By default, card creation is tracked
The name of the event whose status is checked
var webMap = new WebMap(options);
webMap.onLoad().then(function () {
webMap.getEventStatus('create'); // true
})
// use async/await syntax
async function () {
await webMap.onLoad();
doSomething();
}
Optional
cb: ((mapAdapter) => void)Set the center of the current view.
Array of two numbers representing longitude and latitude of the center of the map view.
// Mount Everest 27° 59′ 17″ N, 86° 55′ 31″ E
webMap.setCenter([86.925278, 27.988056]);
Set the cursor icon to be displayed when hover icon on the map container.
Available cursor name from https://developer.mozilla.org/ru/docs/Web/CSS/cursor
Sets the view of the map geographical center and zoom
Optional
zoom: numberThe zoom level to set (0-24).
// Mount Everest 27° 59′ 17″ N, 86° 55′ 31″ E
webMap.setView([86.925278, 27.988056], 12)
Zoom to a specific zoom level.
The zoom level to set (0-24).
Generated using TypeDoc
From runtime params