-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a06a61
commit b2b7f90
Showing
12 changed files
with
157 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,8 @@ | |
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,[email protected],100..700,0..1,-50..200" /> | ||
|
||
<!-- Importing MapTiler SDK --> | ||
<script src="https://cdn.maptiler.com/maptiler-sdk-js/v2.5.0/maptiler-sdk.umd.min.js"></script> | ||
<link href="https://cdn.maptiler.com/maptiler-sdk-js/v2.5.0/maptiler-sdk.css" rel="stylesheet" /> | ||
<script src="https://cdn.maptiler.com/maptiler-sdk-js/v3.0.0-rc.2/maptiler-sdk.umd.min.js"></script> | ||
<link href="https://cdn.maptiler.com/maptiler-sdk-js/v3.0.0-rc.2/maptiler-sdk.css" rel="stylesheet" /> | ||
|
||
<!-- Importing MapTiler AR Control --> | ||
<script src="../build/maptiler-ar-control.umd.js"></script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,8 @@ | |
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,[email protected],100..700,0..1,-50..200" /> | ||
|
||
<!-- Importing MapTiler SDK --> | ||
<script src="https://cdn.maptiler.com/maptiler-sdk-js/v2.5.0/maptiler-sdk.umd.min.js"></script> | ||
<link href="https://cdn.maptiler.com/maptiler-sdk-js/v2.5.0/maptiler-sdk.css" rel="stylesheet" /> | ||
<script src="https://cdn.maptiler.com/maptiler-sdk-js/v3.0.0-rc.2/maptiler-sdk.umd.min.js"></script> | ||
<link href="https://cdn.maptiler.com/maptiler-sdk-js/v3.0.0-rc.2/maptiler-sdk.css" rel="stylesheet" /> | ||
|
||
<!-- Importing MapTiler AR Control --> | ||
<script src="../build/maptiler-ar-control.umd.js"></script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
<html> | ||
<head> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>MapTiler AR Control</title> | ||
<!-- Importing MapTiler SDK --> | ||
<script src="https://cdn.maptiler.com/maptiler-sdk-js/v3.0.0-rc.2/maptiler-sdk.umd.min.js"></script> | ||
<link href="https://cdn.maptiler.com/maptiler-sdk-js/v3.0.0-rc.2/maptiler-sdk.css" rel="stylesheet" /> | ||
|
||
<!-- Importing MapTiler AR Control --> | ||
<script src="../build/maptiler-ar-control.umd.js"></script> | ||
|
||
<style> | ||
html, body { | ||
margin: 0; | ||
} | ||
|
||
#map { | ||
position: absolute; | ||
top: 0; | ||
bottom: 0; | ||
width: 100%; | ||
} | ||
|
||
#overlay { | ||
position: absolute; | ||
top: 0; | ||
bottom: 0; | ||
width: 100vw; | ||
height: 100vh; | ||
background-color: #3e4c55; | ||
z-index: 3; | ||
display: none; | ||
} | ||
|
||
#overlay div { | ||
color: white; | ||
position: absolute; | ||
width: fit-content; | ||
height: fit-content; | ||
right: 0; | ||
left: 0; | ||
bottom: 0; | ||
top: 0; | ||
margin: auto; | ||
font-size: 2em; | ||
font-weight: 200; | ||
border: 4px solid white; | ||
padding: 30px; | ||
background: #0000001a; | ||
font-family: system-ui, sans-serif; | ||
} | ||
|
||
#center-marker { | ||
background: red; | ||
opacity: 0.3; | ||
width: 100px; | ||
height: 100px; | ||
position: absolute; | ||
left: 0; | ||
right: 0; | ||
top: 0; | ||
bottom: 0; | ||
margin: auto; | ||
z-index: 10000; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<!-- <div id="center-marker"></div> --> | ||
<div id="overlay"> | ||
<div>COMPUTING 3D MODEL</div> | ||
</div> | ||
|
||
<div id="map"></div> | ||
<script> | ||
|
||
function getKey() { | ||
const key = (new URLSearchParams(location.search)).get("key"); | ||
if (!key) { | ||
alert("The MapTiler Cloud key is missing. Add yours in the URL with \n?key=YOUR_KEY\nOr get one for free at https://www.maptiler.com/"); | ||
return "_MISSING_MAPTILER_API_KEY_"; | ||
} | ||
return key; | ||
} | ||
|
||
const overlay = document.getElementById("overlay"); | ||
|
||
// Setting up the config | ||
maptilersdk.config.apiKey = getKey(); | ||
|
||
// Creating a map | ||
const map = new maptilersdk.Map({ | ||
container: 'map', | ||
style: maptilersdk.MapStyle.OUTDOOR, | ||
terrain: false, | ||
hash: true, | ||
geolocate: true, | ||
projection: "globe", | ||
}); | ||
|
||
// Waiting for the map to be ready | ||
map.on("load", (e) => { | ||
const arControl = new maptilerarcontrol.MaptilerARControl(); | ||
|
||
console.log(arControl); | ||
|
||
// arControl.on("computeStart", (e) => { | ||
// overlay.style.display = "inherit"; | ||
// }) | ||
|
||
// arControl.on("computeEnd", (e) => { | ||
// overlay.style.display = "none"; | ||
// }) | ||
|
||
map.addControl(arControl, "top-left"); | ||
}) | ||
|
||
|
||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,8 @@ | |
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,[email protected],100..700,0..1,-50..200" /> | ||
|
||
<!-- Importing MapTiler SDK --> | ||
<script src="https://cdn.maptiler.com/maptiler-sdk-js/v2.5.0/maptiler-sdk.umd.min.js"></script> | ||
<link href="https://cdn.maptiler.com/maptiler-sdk-js/v2.5.0/maptiler-sdk.css" rel="stylesheet" /> | ||
<script src="https://cdn.maptiler.com/maptiler-sdk-js/v3.0.0-rc.2/maptiler-sdk.umd.min.js"></script> | ||
<link href="https://cdn.maptiler.com/maptiler-sdk-js/v3.0.0-rc.2/maptiler-sdk.css" rel="stylesheet" /> | ||
|
||
<!-- Importing MapTiler AR Control --> | ||
<script src="../build/maptiler-ar-control.umd.js"></script> | ||
|
Oops, something went wrong.