india-boundary-corrector maplibre IIFE example
HTML
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl@5.0.1/dist/maplibre-gl.css" />
<script src="https://unpkg.com/maplibre-gl@5.0.1/dist/maplibre-gl.js"></script>
<script src="https://unpkg.com/@india-boundary-corrector/maplibre-protocol/dist/index.global.js"></script>
<div id="map" style="height: 400px;"></div>
<script>
// Register the ibc:// protocol
IndiaBoundaryCorrector.registerCorrectionProtocol(maplibregl);
// Use in map style
const map = new maplibregl.Map({
container: 'map',
style: {
version: 8,
sources: {
osm: {
type: 'raster',
tiles: ['ibc://https://tile.openstreetmap.org/{z}/{x}/{y}.png'],
tileSize: 256
}
},
layers: [
{ id: 'osm', type: 'raster', source: 'osm' }
]
},
center: [75.3412, 33.2778],
zoom: 5
});
</script>