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

Globe #18

Open
wants to merge 4 commits into
base: using-sdk-v3
Choose a base branch
from
Open
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
21 changes: 18 additions & 3 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,28 @@ jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.target_commitish }}

- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run make
- run: npm publish --access public

- name: Publish NPM package (regular)
if: !github.event.release.prerelease
run: |
npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

- name: Publish NPM package (pre-release)
if: github.event.release.prerelease
run: |
npm publish --tag next
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# MapTiler AR Control Changelog

## 2.1.3
### Others
- Updating with SDK v2.4.0

## 2.1.2
### New Features
- Display the attribution on top of the 3D model view (web)
Expand Down
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/v1.2.1/maptiler-sdk.umd.min.js"></script>
<link href="https://cdn.maptiler.com/maptiler-sdk-js/v1.2.1/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/v1.2.1/maptiler-sdk.umd.min.js"></script>
<link href="https://cdn.maptiler.com/maptiler-sdk-js/v1.2.1/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/v1.2.1/maptiler-sdk.umd.min.js"></script>
<link href="https://cdn.maptiler.com/maptiler-sdk-js/v1.2.1/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/latest/maptiler-sdk.umd.min.js"></script>
<link href="https://cdn.maptiler.com/maptiler-sdk-js/latest/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/v1.2.1/maptiler-sdk.umd.min.js"></script>
<link href="https://cdn.maptiler.com/maptiler-sdk-js/v1.2.1/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/v1.2.1/maptiler-sdk.umd.min.js"></script>
<link href="https://cdn.maptiler.com/maptiler-sdk-js/v1.2.1/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/v1.2.1/maptiler-sdk.umd.min.js"></script>
<link href="https://cdn.maptiler.com/maptiler-sdk-js/v1.2.1/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
sebstryczek marked this conversation as resolved.
Show resolved Hide resolved
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/v1.2.1/maptiler-sdk.umd.min.js"></script>
<link href="https://cdn.maptiler.com/maptiler-sdk-js/v1.2.1/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/v1.2.1/maptiler-sdk.umd.min.js"></script>
<link href="https://cdn.maptiler.com/maptiler-sdk-js/v1.2.1/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
Loading