mirror of
https://github.com/hyperknot/openfreemap.git
synced 2026-05-21 05:52:17 +00:00
terrain example
This commit is contained in:
1
debug
Symbolic link
1
debug
Symbolic link
@@ -0,0 +1 @@
|
||||
/Users/user/Documents/dev/openfreemap/repo/website/public/debug
|
||||
15
website/public/debug/terrain/terrain.html
Normal file
15
website/public/debug/terrain/terrain.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>OpenFreeMap Debug</title>
|
||||
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
|
||||
<link href="https://unpkg.com/maplibre-gl/dist/maplibre-gl.css" rel="stylesheet" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="map" class="w-full h-screen"></div>
|
||||
<script src="https://unpkg.com/maplibre-gl/dist/maplibre-gl.js"></script>
|
||||
<script src="terrain.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
26
website/public/debug/terrain/terrain.js
Normal file
26
website/public/debug/terrain/terrain.js
Normal file
@@ -0,0 +1,26 @@
|
||||
const map = new maplibregl.Map({
|
||||
container: 'map',
|
||||
hash: 'map',
|
||||
zoom: 10.5,
|
||||
center: [9.0788, 47.1194],
|
||||
style: {
|
||||
version: 8,
|
||||
sources: {
|
||||
hillshadeSource: {
|
||||
type: 'raster-dem',
|
||||
url: 'https://tiles.mapterhorn.com/tilejson.json',
|
||||
},
|
||||
},
|
||||
layers: [
|
||||
{
|
||||
id: 'hillshade',
|
||||
type: 'hillshade',
|
||||
source: 'hillshadeSource',
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
|
||||
map.on('load', () => {
|
||||
console.log('Terrain map loaded')
|
||||
})
|
||||
Reference in New Issue
Block a user