diff --git a/CHANGELOG.md b/CHANGELOG.md index 2697ebf..7d2a533 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # MapTiler 3D Models Changelog +## 2.0.0 +### Other +- Update with MapTiler SDK v3 (globe) + ## 1.0.0 -First release 🎉 \ No newline at end of file +First release 🎉 diff --git a/demos/.nojekyll b/demos/.nojekyll deleted file mode 100644 index e2ac661..0000000 --- a/demos/.nojekyll +++ /dev/null @@ -1 +0,0 @@ -TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/demos/flight.html b/demos/flight.html index 0c43c9f..556f955 100644 --- a/demos/flight.html +++ b/demos/flight.html @@ -1,13 +1,16 @@ + MapTiler 3D - - - + + + + + - -
- - + + \ No newline at end of file diff --git a/demos/index.html b/demos/index.html new file mode 100644 index 0000000..995e206 --- /dev/null +++ b/demos/index.html @@ -0,0 +1,47 @@ + + + + + + + MapTiler 3D JS + + + + +

MapTiler 3D JS Examples

+ + + + + + \ No newline at end of file diff --git a/demos/models/position-indicator--y-up.glb b/demos/models/position-indicator--y-up.glb new file mode 100644 index 0000000..a730ce4 Binary files /dev/null and b/demos/models/position-indicator--y-up.glb differ diff --git a/demos/models/position-indicator--z-up.glb b/demos/models/position-indicator--z-up.glb new file mode 100644 index 0000000..71ffd2b Binary files /dev/null and b/demos/models/position-indicator--z-up.glb differ diff --git a/demos/mountains.html b/demos/mountains.html new file mode 100644 index 0000000..45051aa --- /dev/null +++ b/demos/mountains.html @@ -0,0 +1,184 @@ + + + + + MapTiler 3D Models + + + + + + + + + + + + + + +
+ + + + + + + \ No newline at end of file diff --git a/demos/multi.html b/demos/multi.html index 66bb109..97c26f8 100644 --- a/demos/multi.html +++ b/demos/multi.html @@ -5,9 +5,11 @@ - - - + + + + + - +
@@ -94,10 +96,10 @@ map.addLayer(layer3D); // Increasing the intensity of the ambient light - layer3D.setAmbientLight({intensity: 2}); + layer3D.setAmbientLight({ intensity: 2 }); // Adding a point light - layer3D.addPointLight("point-light", {intensity: 30}); + layer3D.addPointLight("point-light", { intensity: 30 }); const gui = new lil.GUI({ width: 400 }); @@ -105,6 +107,7 @@ // Adding a mesh of a plane. const guiObj = { + projection: "mercator", heading: 0, scale: 1, altitude: 3000, @@ -115,7 +118,7 @@ layer3D.removeMesh(originalPlaneID); }, } - + const originalPlaneID = "plane"; await layer3D.addMeshFromURL( originalPlaneID, @@ -135,48 +138,66 @@ map.on("mousemove", (e) => { if (!planeCanMove) return; - layer3D.modifyMesh(originalPlaneID, {lngLat: e.lngLat}) + layer3D.modifyMesh(originalPlaneID, { lngLat: e.lngLat }) }); map.on("click", (e) => { planeCanMove = !planeCanMove; }); - gui.add( guiObj, 'heading', 0, 360, 0.1 ) - .onChange((heading) => { - layer3D.modifyMesh(originalPlaneID, {heading}); - }); - - gui.add( guiObj, 'scale', 0.01, 5, 0.01 ) - .onChange((scale) => { - layer3D.modifyMesh(originalPlaneID, {scale}); - }); - - gui.add( guiObj, 'altitude', 0, 10000, 1 ) - .onChange((altitude) => { - layer3D.modifyMesh(originalPlaneID, {altitude}); - }); - - gui.add( guiObj, 'opacity', 0, 1) - .onChange((opacity) => { - layer3D.modifyMesh(originalPlaneID, {opacity}); - }); - - - gui.add( guiObj, 'altitudeReference', ["MEAN_SEA_LEVEL", "GROUND"]) - .onChange((altRef) => { - layer3D.modifyMesh(originalPlaneID, {altitudeReference: maptiler3d.AltitudeReference[altRef]}); - }); - - gui.add( guiObj, "wireframe" ) - .onChange((wireframe) => { - layer3D.modifyMesh(originalPlaneID, {wireframe}); - }); - - gui.add( guiObj, "removePlane" ); + gui + .add(guiObj, 'projection', ["mercator", "globe"]) + .onChange((projection) => { + switch (projection) { + case "mercator": + map.enableMercatorProjection(true); + break; + + case "globe": + map.enableGlobeProjection(true); + break; + + default: + throw new Error("Unsupported projection"); + } + }); + + gui.add(guiObj, 'heading', 0, 360, 0.1) + .onChange((heading) => { + layer3D.modifyMesh(originalPlaneID, { heading }); + }); + + gui.add(guiObj, 'scale', 0.01, 1000, 0.01) + .onChange((scale) => { + layer3D.modifyMesh(originalPlaneID, { scale }); + }); + + gui.add(guiObj, 'altitude', 0, 10000, 1) + .onChange((altitude) => { + layer3D.modifyMesh(originalPlaneID, { altitude }); + }); + + gui.add(guiObj, 'opacity', 0, 1) + .onChange((opacity) => { + layer3D.modifyMesh(originalPlaneID, { opacity }); + }); + + + gui.add(guiObj, 'altitudeReference', ["MEAN_SEA_LEVEL", "GROUND"]) + .onChange((altRef) => { + layer3D.modifyMesh(originalPlaneID, { altitudeReference: maptiler3d.AltitudeReference[altRef] }); + }); + + gui.add(guiObj, "wireframe") + .onChange((wireframe) => { + layer3D.modifyMesh(originalPlaneID, { wireframe }); + }); + + gui.add(guiObj, "removePlane"); })() - + + \ No newline at end of file diff --git a/demos/point_cad_model01.html b/demos/point_cad_model01.html index 6062d97..83a2ae5 100644 --- a/demos/point_cad_model01.html +++ b/demos/point_cad_model01.html @@ -5,9 +5,11 @@ - - - + + + + +