Install with npm/yarn:
npm install leaflet-truesize
<script src="https://unpkg.com/leaflet-truesize"></script>
import L from 'leaflet';
import 'leaflet-truesize';
// create leaflet map ...
const geojsonFeature = {
type: 'Feature',
properties: {},
geometry: {
type: 'Polygon',
coordinates: [[
[14.7656, 50.9860],
[19.0283, 49.1529],
[24.1259, 50.2893],
[21.3134, 54.8766]
]]
}
};
const trueSizeLayer = new L.trueSize(geojsonFeature, {
color: '#FF0000',
weight: 1,
opacity: 1,
dashArray: '7, 10',
}).addTo(map);
Factory |
Description |
---|---|
L.trueSize(geojsonFeature, options) | You need to pass the first paramter data in order to create a truesize layer. It has to be a single GeoJSON feature (Polygon or LineString). The options parameter is not required. |
Option |
Type |
Default |
Description |
---|