Provides useful classes for Leaflet.
Like Leaflet's L.Projection.LonLat
but without hard-coded bounds.
Pass an L.Bounds
object to the constructor instead.
Simple coordinate reference system making Leaflet internally use the same coordinates as the original data. Constructor arguments:
- Coordinate reference system name string, like
EPSG:3067
. For information only, not used for anything. - Any Leaflet projection, preferably an instance of
Projection
from this package. - Optionally an
L.Transformation
instance for mapping between external spatial and internal pixel coordinates. By default, latitude is flipped.
import { Projection, CRS } from 'charto-leaflet';
import * as L from 'leaflet';
const JHS180 = new CRS(
'EPSG:3067',
new Projection(L.bounds([ -548576, 6291456 ], [ 1548576, 8388608 ]))
);
const map = L.map(document.body, {
crs: JHS180
});
Copyright (c) 2017 BusFaster Ltd