leaflet-nearmap

Nearmap CRS for leaflet library


Keywords
leaflet
License
MIT
Install
npm install leaflet-nearmap@1.0.2

Documentation

leaflet-nearmap

Use leaflet library with Nearmap's Tile API.

Installation

npm install --save-dev leaflet-nearmap

Usage

Follow the Leaflet docs for setting up a basic map.

Import custom CRS for panoramas to initialize the map, and add the respective layer:

import leaflet from 'leaflet';
import northCrs from 'leaflet-nearmap/crs/north';
import northLayer from 'leaflet-nearmap/layers/north';

const ApiKey = 'YOUR_API_KEY';
const UrlTemplate = `https://api.nearmap.com/tiles/v3/{layer}/{z}/{x}/{y}.img?tertiary=satellite&apikey=${ApiKey}`;

const map = leaflet.map('mapid', {
  crs: northCrs,
  center: [-34.915302, 138.595637],
  zoom: 13
});

map.addLayer(northLayer(UrlTemplate));

See ./examples/index.js for more details.

Running the Examples

Make sure you have a recent version of node installed. Clone or download this repo and run the following:

npm ci
npx run

This starts a webserver and you can explore the demo at http://localhost:8080/