1.1.9 • Published 4 years ago

agnostic-maps v1.1.9

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

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(() => {
        const newPosition = { lat: 55.7, lon: 37.6 };
        mapApi.setMarkerPosition(marker, newPosition);
        
        const anotherPosition = { lat: 55.8, lon: 37.7 };
        mapApi.addMarker(map, mapApi.createMarker(center));
        
        mapApi.setBounds(map, [newPosition, anotherPosition]);
        mapApi.addPolyline(map, mapApi.createPolyline([newPosition, anotherPosition], '#2b580c'));
    }, 2000);
    
    setTimeout(() => mapApi.removeMarker(map, marker), 3000);
});

Supported Maps

  • Open Street Maps (osm)
  • Yandex (yandex)
1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.1

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago