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