Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

agnostic-maps

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

agnostic-maps

A set of wrappers for modern maps API e.g. Open Street Maps and Yandex

  • 1.1.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

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)

Keywords

FAQs

Package last updated on 15 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc