The goal of this tiny lib is to offer a common interface to allow basic usage of multiple map providers.
The only thing that change will be the chosen provider and its API Key. All your map interaction logic will stay the same regardless of the provider chosen. On the other hand, it is possible to overload all methods if it is needed for customization.
Providers available:
- Google Maps -
gmaps
- Mappy (Leaflet) -
mappy
- Leaflet -
leaflet
See the full documentation.
Run npm run build-dev
and launch the example folder on a local server.
Any changes will be watched.
Run npm run test
to launch the tests (Jest - documentation).
If you need to test your developments before releasing, you can push the compiled filed to Github Pages.
To do this, just run npm run gh-deploy
.
You'll find the generated files on this link: https://leadformance.github.io/batMap/dist/[PROVIDER].[min].js
To deploy and release your code you have to merge your branch on master.
Now you can switch on master and run npm run deploy <versions>
(version: major|minor|patch).
It will generate the folder dist with every provider js (normal and minified).
Now you can use this version in your project.
Google Map | Mappy | Leaflet | SVG Marker | |
---|---|---|---|---|
Chrome | ✔ | ✔ | ✔ | ✔ |
Firefox | ✔ | ✔ | ✔ | ✔ |
Opera | ✔ | ✔ | ✔ | ✔ |
Safari | ✔ | ✔ | ✔ | ✔ |
IE11 | ✔ | ✔ | ✔ | ✔ |
EDGE | ✔ | ✔ | ✔ | ✔ |
- need to include es5-shim && es5-sham