Skip to content

opengeoshub/vgrid-maplibre

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vgrid-maplibre
DGGS Visualization on MapLibre GL JS

npm package downloads total image

Basic usage (for H3 as an example)

<!DOCTYPE html>
<html>

<head>
    <title>vgrid-maplibre Demo</title>
    <script src="https://unpkg.com/maplibre-gl@3.6.2/dist/maplibre-gl.js"></script>
    <link href="https://unpkg.com/maplibre-gl@3.6.2/dist/maplibre-gl.css" rel="stylesheet" />
    <style>
        body {
            margin: 0;
            padding: 0;
        }

        #map {
            width: 100%;
            height: 100vh;
        }
    </style>
</head>

<body>
    <div id="map"></div>
    <script type="module">
        import H3Grid from "https://unpkg.com/vgrid-maplibre/H3/H3Grid.js";
        const map = new maplibregl.Map({
            container: 'map',
            style: 'https://raw.githubusercontent.com/opengeohubs/vstyles/main/vstyles/sbr/eclipse/eclipse.json',
            center: [0, 0],
            zoom: 0
        });

        map.on('load', () => {
            const h3Grid = new H3Grid(map, {
                color: 'rgba(255, 0, 0, 1)',
                width: 1.5,
                redraw: 'move',
            });
        });
    </script>
</body>

</html>

H3

H3 Demo

image

S2

S2 Demo

image

A5

A5 Demo

image

QTM

QTM Demo

image

OLC (OpenLocationCode/ Google Pluscode)

OLC Demo

image

Geohash

Geohash Demo

image

GEOREF

GEOREF Demo

image

MGRS

MGRS Demo

image

Tilecode

Tilecode Demo

image

Maidenhead

Maidenhead Demo

image

GARS

GARS Demo