stepankuzmin / leaflet-pkk

Public cadastral map (pkk5.rosreestr.ru) plugin for Leaflet
https://stepankuzmin.github.io/leaflet-pkk/
BSD 2-Clause "Simplified" License
1 stars 2 forks source link
leaflet leaflet-plugin pkk pkk5-rosreestr

leaflet-pkk

Public cadastral map (pkk5.rosreestr.ru) plugin for Leaflet.

Example

screenshot

Install

Install using npm:

npm install --save leaflet-pkk

...or using unpkg CDN

<script src="https://unpkg.com/leaflet-pkk/index.js"></script>

Usage

const map = L.map('map').setView([55.756389, 37.63019], 14);

const baseLayer = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png');
map.addLayer(baseLayer);

const pkkLayer = L.tileLayer.pkk({
  layers: '8,9,10,11,12',
  format: 'image/png32',
  transparent: true
});

pkkLayer.on('featureclick', ({ latlng, feature }) => {
  const popup = L.popup()
    .setLatLng(latlng)
    .setContent(feature.attrs.id)
    .openOn(map);
});

map.addLayer(pkkLayer);