leaflet-rd
TypeScript icon, indicating that this package has built-in type declarations

2.4.0 • Public • Published

Build Status npm version

Leaflet.RD

Deze plugin voegt ondersteuning voor het Rijksdriehoeksstelsel toe aan Leaflet. Gebruik het meegelverde coördinatensysteem bij het aanmaken van een nieuwe kaart. Leaflet is dan meteen geschikt voor het tonen van bijvoorbeeld kaartlagen uit PDOK.

This plugin adds support for the Amersfoort / RD New coordinate system. Created for leaflet 1.0 and up. Leaflet 1.1 not supported, use 1.2 in stead.

Usage

Standalone

Include the javascript file on your page behind both Leaflet and Proj4js

Node

Require the 'leaflet-rd' package.

Setup Leaflet

Leaflet.RD adds a projection under L.projection.RD and a CRS under L.CRS.RD.

To immediately start using RD resources on your map set the CRS of your Leaflet map to L.CRS.RD:

var map = L.map("map", {
    crs: L.CRS.RD,
});

The plugin exports L.CRS.RD, in node the following is also possible:

import rd from 'leaflet-rd';
 
var map = L.map("map", {
    crs: rd,
});

Projecting Markers and Vector Layers

Markers and Vector Layers still expect latlng input. Project points using L.projection.RD.unproject(point) or map.options.crs.projection.unproject. You can convert GeoJson-data using reproject, as an added convenience an proj4 defenition string is located at L.projection.RD.proj4def.

/leaflet-rd/

    Package Sidebar

    Install

    npm i leaflet-rd

    Weekly Downloads

    10

    Version

    2.4.0

    License

    MIT

    Unpacked Size

    11.5 kB

    Total Files

    11

    Last publish

    Collaborators

    • geoloep