update project
This commit is contained in:
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# SCM syntax highlighting & preventing 3-way merges
|
||||||
|
pixi.lock merge=binary linguist-language=YAML linguist-generated=true -diff
|
||||||
11
.gitignore
vendored
Normal file
11
.gitignore
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# pixi environments
|
||||||
|
.pixi/*
|
||||||
|
!.pixi/config.toml
|
||||||
|
*.las
|
||||||
|
*.laz
|
||||||
|
*.tif
|
||||||
|
*.tiff
|
||||||
|
data/
|
||||||
|
lidar/
|
||||||
|
tiles/
|
||||||
|
node_modules/
|
||||||
23
index.html
Normal file
23
index.html
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<title>LiDAR App</title>
|
||||||
|
<link href="https://unpkg.com/maplibre-gl/dist/maplibre-gl.css" rel="stylesheet" />
|
||||||
|
<script type="module" src="/main.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<button id="resetBtn">Zurück auf Nord</button>
|
||||||
|
Hintergrundkarte:
|
||||||
|
<select name="basemap" id="basemap">
|
||||||
|
<option value="openfree_bright">OpenFreeMap hell</option>
|
||||||
|
<option value="openfree_dark">OpenFreeMap dunkel</option>
|
||||||
|
<option value="openfree_liberty">OpenFreeMap Liberty</option>
|
||||||
|
<option value="google_satellite">Satellit</option>
|
||||||
|
<option value="terrain">Terrain</option>
|
||||||
|
<option value="satellite_terrain">Terrain mit Satellitenbild</option>
|
||||||
|
</select>
|
||||||
|
<div id="map" style="width:100%; height:100vh;"></div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
145
main.js
Normal file
145
main.js
Normal file
@@ -0,0 +1,145 @@
|
|||||||
|
import maplibregl from "maplibre-gl";
|
||||||
|
import {Deck} from '@deck.gl/core';
|
||||||
|
import {PointCloudLayer} from '@deck.gl/layers';
|
||||||
|
import {LASLoader} from '@loaders.gl/las';
|
||||||
|
import {MapboxOverlay} from '@deck.gl/mapbox';
|
||||||
|
import {COORDINATE_SYSTEM} from '@deck.gl/core';
|
||||||
|
|
||||||
|
|
||||||
|
const map = new maplibregl.Map({
|
||||||
|
container: 'map',
|
||||||
|
style: "https://tiles.openfreemap.org/styles/bright",
|
||||||
|
center: [9.209116842757239, 52.26520546238239],
|
||||||
|
zoom: 17
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
const layer = new PointCloudLayer({
|
||||||
|
data: '/3dm_32_285_5653_1_nw.copc_WGS84.laz',
|
||||||
|
loaders: [LASLoader],
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
const overlay = new MapboxOverlay({
|
||||||
|
layers: [layer]
|
||||||
|
});
|
||||||
|
|
||||||
|
map.addControl(overlay);
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// Hintergrundkarte ändern
|
||||||
|
function changeBaseMap(newMap){
|
||||||
|
var basemapStyle;
|
||||||
|
switch(newMap){
|
||||||
|
case "openfree_dark":
|
||||||
|
basemapStyle = "https://tiles.openfreemap.org/styles/dark"
|
||||||
|
break;
|
||||||
|
case "openfree_bright":
|
||||||
|
basemapStyle = "https://tiles.openfreemap.org/styles/bright"
|
||||||
|
break;
|
||||||
|
case "openfree_liberty":
|
||||||
|
basemapStyle = "https://tiles.openfreemap.org/styles/liberty"
|
||||||
|
break;
|
||||||
|
case "google_satellite":
|
||||||
|
basemapStyle = {
|
||||||
|
version: 8,
|
||||||
|
sources: {
|
||||||
|
"raster-tiles": {
|
||||||
|
type: "raster",
|
||||||
|
tiles: [
|
||||||
|
"https://mt0.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",
|
||||||
|
"https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",
|
||||||
|
"https://mt2.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",
|
||||||
|
"https://mt3.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",
|
||||||
|
],
|
||||||
|
tileSize: 256,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
layers: [{ id: "raster-layer", type: "raster", source: "raster-tiles" }],
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "terrain":
|
||||||
|
basemapStyle = {
|
||||||
|
version: 8,
|
||||||
|
sources: {
|
||||||
|
osm: {
|
||||||
|
type: 'raster',
|
||||||
|
tiles: ['https://a.tile.openstreetmap.org/{z}/{x}/{y}.png'],
|
||||||
|
tileSize: 256,
|
||||||
|
attribution: '© OpenStreetMap Contributors',
|
||||||
|
maxzoom: 19
|
||||||
|
},
|
||||||
|
// Use a different source for terrain and hillshade layers, to improve render quality
|
||||||
|
terrainSource: {
|
||||||
|
type: 'raster-dem',
|
||||||
|
url: 'https://tiles.mapterhorn.com/tilejson.json',
|
||||||
|
},
|
||||||
|
hillshadeSource: {
|
||||||
|
type: 'raster-dem',
|
||||||
|
url: 'https://tiles.mapterhorn.com/tilejson.json'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
layers: [
|
||||||
|
{
|
||||||
|
id: 'osm',
|
||||||
|
type: 'raster',
|
||||||
|
source: 'osm'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'hills',
|
||||||
|
type: 'hillshade',
|
||||||
|
source: 'hillshadeSource',
|
||||||
|
layout: {visibility: 'visible'},
|
||||||
|
paint: {'hillshade-shadow-color': '#473B24'}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
terrain: {
|
||||||
|
source: 'terrainSource',
|
||||||
|
exaggeration: 1
|
||||||
|
},
|
||||||
|
sky: {}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "satellite_terrain":
|
||||||
|
basemapStyle = {
|
||||||
|
version: 8,
|
||||||
|
sources: {
|
||||||
|
"satellite": {
|
||||||
|
type: "raster",
|
||||||
|
tiles: [
|
||||||
|
"https://mt0.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",
|
||||||
|
"https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",
|
||||||
|
"https://mt2.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",
|
||||||
|
"https://mt3.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",
|
||||||
|
],
|
||||||
|
tileSize: 256,
|
||||||
|
},
|
||||||
|
// ── Elevation data ──────────────────────────
|
||||||
|
"terrarium": {
|
||||||
|
type: "raster-dem",
|
||||||
|
tiles: ["https://s3.amazonaws.com/elevation-tiles-prod/terrarium/{z}/{x}/{y}.png"],
|
||||||
|
tileSize: 256,
|
||||||
|
encoding: "terrarium",
|
||||||
|
maxzoom: 15
|
||||||
|
},
|
||||||
|
},
|
||||||
|
layers: [{ id: "satellite", type: "raster", source: "satellite" }],
|
||||||
|
// 2-fache Überhöhung
|
||||||
|
terrain: { source: "terrarium", exaggeration: 2 },
|
||||||
|
}
|
||||||
|
}
|
||||||
|
map.setStyle(basemapStyle);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ausgewähltes Element im BaseMap DropDown Feld
|
||||||
|
const selectElement = document.querySelector('select[name="basemap"]');
|
||||||
|
selectElement.addEventListener('change', (event) => {
|
||||||
|
changeBaseMap(event.target.value);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Karte auf Nord zurücksetzen
|
||||||
|
document.getElementById("resetBtn").addEventListener("click", () => {
|
||||||
|
map.resetNorth();
|
||||||
|
});
|
||||||
5167
package-lock.json
generated
Normal file
5167
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
21
package.json
Normal file
21
package.json
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"name": "code-map-libre",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
|
"dev": "vite"
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
|
"type": "commonjs",
|
||||||
|
"dependencies": {
|
||||||
|
"@loaders.gl/core": "^4.4.1",
|
||||||
|
"@loaders.gl/las": "^4.4.1",
|
||||||
|
"deck.gl": "^9.3.1",
|
||||||
|
"maplibre-gl": "^5.22.0",
|
||||||
|
"vite": "^8.0.7"
|
||||||
|
}
|
||||||
|
}
|
||||||
18
pixi.lock
generated
Normal file
18
pixi.lock
generated
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
version: 6
|
||||||
|
environments:
|
||||||
|
default:
|
||||||
|
channels:
|
||||||
|
- url: https://conda.anaconda.org/conda-forge/
|
||||||
|
options:
|
||||||
|
pypi-prerelease-mode: if-necessary-or-explicit
|
||||||
|
packages:
|
||||||
|
win-64:
|
||||||
|
- conda: https://conda.anaconda.org/conda-forge/win-64/nodejs-25.8.2-h80d1838_0.conda
|
||||||
|
packages:
|
||||||
|
- conda: https://conda.anaconda.org/conda-forge/win-64/nodejs-25.8.2-h80d1838_0.conda
|
||||||
|
sha256: 5e38e51da1aa4bc352db9b4cec1c3e25811de0f4408edaa24e009a64de6dbfdf
|
||||||
|
md5: e626ee7934e4b7cb21ce6b721cff8677
|
||||||
|
license: MIT
|
||||||
|
license_family: MIT
|
||||||
|
size: 31271315
|
||||||
|
timestamp: 1774517904472
|
||||||
11
pixi.toml
Normal file
11
pixi.toml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
[workspace]
|
||||||
|
authors = ["Arne Zitting <arne.zitting@student.jade-hs.de>"]
|
||||||
|
channels = ["conda-forge"]
|
||||||
|
name = "Code Map Libre"
|
||||||
|
platforms = ["win-64"]
|
||||||
|
version = "0.1.0"
|
||||||
|
|
||||||
|
[tasks]
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
nodejs = ">=25.8.2,<25.9"
|
||||||
Reference in New Issue
Block a user