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.