Skip to content

Commit

Permalink
adding example
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanlurie committed Dec 9, 2024
1 parent 9a06a61 commit b2b7f90
Show file tree
Hide file tree
Showing 12 changed files with 157 additions and 228 deletions.
4 changes: 2 additions & 2 deletions demos/QR.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<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/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>
Expand Down
4 changes: 2 additions & 2 deletions demos/activate.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
4 changes: 2 additions & 2 deletions demos/auto-activate.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<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/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>
Expand Down
4 changes: 2 additions & 2 deletions demos/auto-activate2.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<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/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>
Expand Down
4 changes: 2 additions & 2 deletions demos/custom.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
121 changes: 121 additions & 0 deletions demos/globe.html
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>
4 changes: 2 additions & 2 deletions demos/image.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<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/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>
Expand Down
4 changes: 2 additions & 2 deletions demos/image_overlay.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<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/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>
Expand Down
4 changes: 2 additions & 2 deletions demos/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<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/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>
Expand Down
4 changes: 2 additions & 2 deletions demos/no-button.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Loading

0 comments on commit b2b7f90

Please sign in to comment.