@fidenz/maposm
v1.0.4
Published
`maposm` widget library is based on OpenStreetMap and [Entur]("https://entur.no/") API. `maposm` can be used as either a **CDN** resource or a **NodeJS module**.
Downloads
1
Readme
osm-map-lib
maposm
widget library is based on OpenStreetMap and Entur API. maposm
can be used as either a CDN resource or a NodeJS module.
Features
- Transportation route between 2 locations with several transportation methods.
- Walk
- Car
- Bicycle
- Flexible
- Bus
- Tram
- Metro
- Rail
- Stop places in the currenly visible map bounds
Packaging
npm i
npm run build
Installation
CDN resource
Import the {MAPOSM_LIB_DIR}\dist\cdn\bundle.js using script
tag.
Node module
npm i {MAPOSM_LIB_DIR}\dist\module
Install package from remote NPM registry
npm i @fidenz/maposm
Initialization
Create a DOM element to work as the map container. Element id is used when initializing OSM map.
<div
id="osm-map"
style="width: 70vw; height: 75vh">
</div>
Initialize the OSM map using maposm
lib.
Module
import {initMap} from 'maposm';
initMap("osm-map");
CDN
<script>
maposm.initMap("osm-map");
</script>