Agnostic Maps
Install
$ npm install agnostic-maps
Usage
import { yandex as mapApi } from 'agnostic-maps';
mapApi.load({ yMapsApiKey: '<YOUR-API-KEY>' }).then(() => {
const center = { lat: 55.75, lon: 37.62 };
const map = mapApi.createMap(document.getElementById('map'), center);
const marker = mapApi.createMarker(center);
mapApi.addMarker(map, marker);
setTimeout(() => mapApi.setMarkerPosition(marker, { lat: 55.7, lon: 37.6 }), 2000);
setTimeout(() => mapApi.removeMarker(map, marker), 3000);
});
Supported Maps
- Open Street Maps (
osm
) - Yandex (
yandex
)