Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RD-369_v3.0.0 (globe) #130

Closed
wants to merge 11 commits into from
Closed
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
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# MapTiler SDK Changelog

## NEXT
### New Features
- New `MaptilerProjectionControl` to toggle globe/Mercator projection
- Add metric collection and plugin registration feature

### Bug Fixes
- Navigation now relies on `Map` methods instead of `Transform` methods for bearing due to globe projection being available


## 2.4.2
### Bug Fixes
- The language switching is now more robust and preserves the original formatting from the style (`Map.setPrimaryLangage()`) (https://github.com/maptiler/maptiler-sdk-js/pull/134)
Expand All @@ -9,7 +18,6 @@
- Updated GH action to v4



## 2.4.1
### Bug Fixes
- The class `AJAXError` is now imported as part of the `maplibregl` namespace (CommonJS limitation from Maplibre GL JS) (https://github.com/maptiler/maptiler-sdk-js/pull/129)
Expand Down
3 changes: 3 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
},
"linter": {
"rules": {
"style": {
"noInferrableTypes": "off"
},
"suspicious": {
"noExplicitAny": {
"level": "off"
Expand Down
2 changes: 1 addition & 1 deletion demos/sky_day.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
</div>
</div>

<script src ="../build/maptiler-sdk.umd.js"></script>
<script src ="../build/maptiler-sdk.umd.min.js"></script>

<script>
maptilersdk.config.apiKey = "YOUR_API_KEY";
Expand Down
145 changes: 145 additions & 0 deletions demos/sky_day_globe.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
<html>
<head>
<title>MapTiler JS SDK example</title>
<style>
html, body {
margin: 0;
}

#map-container {
position: absolute;
width: 100vw;
height: 100vh;
background: #ccc;
/* background: radial-gradient(circle, rgb(186 226 255) 5%, rgb(0 100 159) 98%); */
}

#style-picker-container {
position: absolute;
z-index: 2;
margin: 10px;
}

</style>

<link rel="stylesheet" href="../build/maptiler-sdk.css">
</head>

<body>
<div id="map-container"></div>
<div id="style-picker-container">
<div>
<label for="sky-color">sky-color</label>
<input id="sky-color" type="color" value="#027bdb"></input>
</div>

<div>
<label for="horizon-color">horizon-color</label>
<input id="horizon-color" type="color" value="#ffffff"></input>
</div>

<div>
<label for="fog-color">fog-color</label>
<input id="fog-color" type="color" value="#ffffff"></input>
</div>

<div>
<label for="fog-ground-blend">fog-ground-blend</label>
<input id="fog-ground-blend" type="range" min="0" max="1" step="0.01" value="0.1"></input>
</div>

<div>
<label for="horizon-fog-blend">horizon-fog-blend</label>
<input id="horizon-fog-blend" type="range" min="0" max="1" step="0.01" value="0.5"></input>
</div>

<div>
<label for="sky-horizon-blend">sky-horizon-blend</label>
<input id="sky-horizon-blend" type="range" min="0" max="1" step="0.01" value="0.75"></input>
</div>

<div>
<label for="atmosphere-blend">atmosphere-blend</label>
<input id="atmosphere-blend" type="range" min="0" max="1" step="0.01" value="0.5"></input>
</div>
</div>

<script src ="../build/maptiler-sdk.umd.min.js"></script>

<script>
maptilersdk.config.apiKey = "YOUR_API_KEY";

const map = new maptilersdk.Map({
container: document.getElementById("map-container"),
style: maptilersdk.MapStyle.OUTDOOR,
hash: false,
terrainControl: true,
geolocate: true,
maxPitch: 85,
terrain: true,
pitch: 0,
bearing: 0,
center: [7.8097, 46.0739],
zoom: 2,
projection: "globe"
})


document.getElementById("sky-color").addEventListener("input", (e) => {
map.setSky({
"sky-color": e.target.value,
});
});

document.getElementById("horizon-color").addEventListener("input", (e) => {
map.setSky({
"horizon-color": e.target.value,
});
});

document.getElementById("fog-color").addEventListener("input", (e) => {
map.setSky({
"fog-color": e.target.value,
});
});

document.getElementById("fog-ground-blend").addEventListener("input", (e) => {
map.setSky({
"fog-ground-blend": parseFloat(e.target.value),
});
});

document.getElementById("horizon-fog-blend").addEventListener("input", (e) => {
map.setSky({
"horizon-fog-blend": parseFloat(e.target.value),
});
});

document.getElementById("sky-horizon-blend").addEventListener("input", (e) => {
map.setSky({
"sky-horizon-blend": parseFloat(e.target.value),
});
});

document.getElementById("atmosphere-blend").addEventListener("input", (e) => {
map.setSky({
"atmosphere-blend": parseFloat(e.target.value),
});
});


map.on("ready", () => {
map.setSky({
"sky-color": "#027bdb",
"horizon-color": "#ffffff",
"fog-color": "#ffffff",
"fog-ground-blend": 0.1,
"horizon-fog-blend": 0.5,
"sky-horizon-blend": 0.75,
"atmosphere-blend": 0.5,
})
})

</script>
</body>
</html>
2 changes: 1 addition & 1 deletion demos/sky_night.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
</div>
</div>

<script src ="../build/maptiler-sdk.umd.js"></script>
<script src ="../build/maptiler-sdk.umd.min.js"></script>

<script>
maptilersdk.config.apiKey = "YOUR_API_KEY";
Expand Down
147 changes: 147 additions & 0 deletions demos/sky_night_globe.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
<html>
<head>
<title>MapTiler JS SDK example</title>
<style>
html, body {
margin: 0;
}

#map-container {
position: absolute;
width: 100vw;
height: 100vh;
background: #ccc;
/* background: radial-gradient(circle, rgb(186 226 255) 5%, rgb(0 100 159) 98%); */
}

#ctrl-panel {
position: absolute;
z-index: 2;
margin: 10px;
color: white;
}

</style>

<link rel="stylesheet" href="../build/maptiler-sdk.css">
</head>

<body>
<div id="map-container"></div>
<div id="ctrl-panel">
<div>
<label for="sky-color">sky-color</label>
<input id="sky-color" type="color" value="#0C2E4B"></input>
</div>

<div>
<label for="horizon-color">horizon-color</label>
<input id="horizon-color" type="color" value="#09112F"></input>
</div>

<div>
<label for="fog-color">fog-color</label>
<input id="fog-color" type="color" value="#09112F"></input>
</div>

<div>
<label for="fog-ground-blend">fog-ground-blend</label>
<input id="fog-ground-blend" type="range" min="0" max="1" step="0.01" value="0.0"></input>
</div>

<div>
<label for="horizon-fog-blend">horizon-fog-blend</label>
<input id="horizon-fog-blend" type="range" min="0" max="1" step="0.01" value="0.1"></input>
</div>

<div>
<label for="sky-horizon-blend">sky-horizon-blend</label>
<input id="sky-horizon-blend" type="range" min="0" max="1" step="0.01" value="1.0"></input>
</div>

<div>
<label for="atmosphere-blend">atmosphere-blend</label>
<input id="atmosphere-blend" type="range" min="0" max="1" step="0.01" value="0.5"></input>
</div>
</div>

<script src ="../build/maptiler-sdk.umd.min.js"></script>

<script>
maptilersdk.config.apiKey = "YOUR_API_KEY";

const map = new maptilersdk.Map({
container: document.getElementById("map-container"),
style: maptilersdk.MapStyle.OUTDOOR.DARK,
hash: false,
terrainControl: true,
geolocate: true,
maxPitch: 85,
terrain: true,
pitch: 0,
bearing: 0,
center: [7.8097, 46.0739],
zoom: 2,
projection: "globe"
});


document.getElementById("sky-color").addEventListener("input", (e) => {
map.setSky({
"sky-color": e.target.value,
});
});

document.getElementById("horizon-color").addEventListener("input", (e) => {
map.setSky({
"horizon-color": e.target.value,
});
});

document.getElementById("fog-color").addEventListener("input", (e) => {
map.setSky({
"fog-color": e.target.value,
});
});

document.getElementById("fog-ground-blend").addEventListener("input", (e) => {
map.setSky({
"fog-ground-blend": parseFloat(e.target.value),
});
});

document.getElementById("horizon-fog-blend").addEventListener("input", (e) => {
map.setSky({
"horizon-fog-blend": parseFloat(e.target.value),
});
});

document.getElementById("sky-horizon-blend").addEventListener("input", (e) => {
map.setSky({
"sky-horizon-blend": parseFloat(e.target.value),
});
});

document.getElementById("atmosphere-blend").addEventListener("input", (e) => {
map.setSky({
"atmosphere-blend": parseFloat(e.target.value),
});
});


map.on("ready", () => {
map.setSky({
"sky-color": "#0C2E4B",
"horizon-color": "#09112F",
"fog-color": "#09112F",
"fog-ground-blend": 0.0,
"horizon-fog-blend": 0.1,
"sky-horizon-blend": 1.0,
"atmosphere-blend": 0.5,
})
})


</script>
</body>
</html>
Binary file added images/screenshots/fov_1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshots/fov_10.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshots/fov_20.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshots/fov_30.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshots/fov_37.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshots/fov_40.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshots/fov_50.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshots/fov_60.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshots/globe_hybrid.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshots/globe_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshots/globe_outdoor_alaska.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshots/globe_outdoor_emea.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshots/globe_outdoor_panamerica.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshots/globe_projection.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshots/globe_topo_arctica.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshots/mercator_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshots/mercator_projection.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading