Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions demo/local-viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,21 @@
<title>golfTiles PR demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Maplibre stylesheet: -->
<link href="https://unpkg.com/maplibre-gl@5/dist/maplibre-gl.css" rel="stylesheet" />
<!-- Scripts: -->
<script src="https://unpkg.com/maplibre-gl@5/dist/maplibre-gl.js"></script>
<link href="https://unpkg.com/maplibre-gl@6/dist/maplibre-gl.css" rel="stylesheet" />
<!-- Scripts. Maplibre v6 is ESM-only, so it is imported in the module
script below rather than loaded with a <script src> tag. -->
<script src="https://unpkg.com/pmtiles@3.2.0/dist/pmtiles.js"></script>
<style>html, body { margin: 0; height: 100%; } #map { height: 100%; }</style>
</head>
<body>
<div id='map'></div>
<script type='module'>
// add the PMTiles plugin to the maplibregl global.
// Maplibre v6 has no default export, so import the whole namespace.
// pmtiles still ships a classic bundle and is loaded above; classic
// scripts run before deferred module scripts, so the global is ready.
import * as maplibregl from 'https://unpkg.com/maplibre-gl@6/dist/maplibre-gl.mjs';

// add the PMTiles plugin to the maplibregl namespace.
const protocol = new pmtiles.Protocol();
maplibregl.addProtocol('pmtiles', protocol.tile);

Expand Down
17 changes: 12 additions & 5 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
<title>golfTiles.org</title>
<meta name="description" content="Free and open-source golf centric vector tiles with custom style for websites and apps, using OpenStreetMap data">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Maplibre stylesheet: -->
<link href="https://unpkg.com/maplibre-gl/dist/maplibre-gl.css" rel="stylesheet" />
<!-- Scripts: -->
<script src="https://unpkg.com/maplibre-gl/dist/maplibre-gl.js"></script>
<!-- Maplibre stylesheet. Keep the major version pinned: an unpinned
URL silently followed maplibre-gl to v6, which dropped the plain
<script> bundle, and the demo went blank. -->
<link href="https://unpkg.com/maplibre-gl@6/dist/maplibre-gl.css" rel="stylesheet" />
<!-- Scripts. Maplibre v6 is ESM-only, so it is imported in the module
script below rather than loaded with a <script src> tag. -->
<script src="https://unpkg.com/pmtiles@3.2.0/dist/pmtiles.js"></script>
</head>
<body>
Expand All @@ -30,7 +32,12 @@ <h2>Initial Demo using Maplibre GL JS over Sweden, finland and Denmark: </h2>
<p>Extract from 260601. Initial position is over course: <a href="https://www.openstreetmap.org/way/101624685">Way: Emmaboda Golfklubb (101624685)</a> </p>
<div id='map' style='width: 95vw; height: 80vh;'></div>
<script type='module'>
// add the PMTiles plugin to the maplibregl global.
// Maplibre v6 has no default export, so import the whole namespace.
// pmtiles still ships a classic bundle and is loaded above; classic
// scripts run before deferred module scripts, so the global is ready.
import * as maplibregl from 'https://unpkg.com/maplibre-gl@6/dist/maplibre-gl.mjs';

// add the PMTiles plugin to the maplibregl namespace.
const protocol = new pmtiles.Protocol();
maplibregl.addProtocol('pmtiles', protocol.tile);

Expand Down
17 changes: 12 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
<title>golfTiles.org</title>
<meta name="description" content="Free and open-source golf centric vector tiles with custom style for websites and apps, using OpenStreetMap data">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Maplibre stylesheet: -->
<link href="https://unpkg.com/maplibre-gl/dist/maplibre-gl.css" rel="stylesheet" />
<!-- Scripts: -->
<script src="https://unpkg.com/maplibre-gl/dist/maplibre-gl.js"></script>
<!-- Maplibre stylesheet. Keep the major version pinned: an unpinned
URL silently followed maplibre-gl to v6, which dropped the plain
<script> bundle, and the demo went blank. -->
<link href="https://unpkg.com/maplibre-gl@6/dist/maplibre-gl.css" rel="stylesheet" />
<!-- Scripts. Maplibre v6 is ESM-only, so it is imported in the module
script below rather than loaded with a <script src> tag. -->
<script src="https://unpkg.com/pmtiles@3.2.0/dist/pmtiles.js"></script>
</head>
<body>
Expand All @@ -29,7 +31,12 @@ <h2>Initial Demo using Maplibre GL JS over Sweden, finland and Denmark: </h2>
<p>Extract from 260601. Initial position is over course: <a href="https://www.openstreetmap.org/way/101624685">Way: Emmaboda Golfklubb (101624685)</a> </p>
<div id='map' style='width: 95vw; height: 80vh;'></div>
<script type='module'>
// add the PMTiles plugin to the maplibregl global.
// Maplibre v6 has no default export, so import the whole namespace.
// pmtiles still ships a classic bundle and is loaded above; classic
// scripts run before deferred module scripts, so the global is ready.
import * as maplibregl from 'https://unpkg.com/maplibre-gl@6/dist/maplibre-gl.mjs';

// add the PMTiles plugin to the maplibregl namespace.
const protocol = new pmtiles.Protocol();
maplibregl.addProtocol('pmtiles', protocol.tile);

Expand Down
Loading