diff --git a/.eslintrc.cjs b/.eslintrc.cjs
index 4d43f8e..f29599d 100644
--- a/.eslintrc.cjs
+++ b/.eslintrc.cjs
@@ -3,7 +3,7 @@ module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
root: true,
- ignorePatterns: ["**/*.js"],
+ ignorePatterns: ["**/*.js", "src/platform-constants.ts"],
overrides: [
{
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0d6f905..f2e4dbd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,16 @@
# MapTiler AR Control Changelog
+## v1.2.0
+### New Features
+- Possibility to add a marketting image on top of the 3D view
+- Possibility to increase the resolution of the texture for non-iOS devices
+- if AR is automatically ran, the intermediate 3D view no longer shows on iOS (at both begining and end of AR)
+- The elevation padding of the 3D models now depends on zoom level and minimal elevation
+- If possible and desired to go straight to AR mode, the control icon now features a box logo with brackets
+
+### Bug Fixes
+- Very small extents at high zoom level are no longer possible as they were generating bad looking meshes. Min zoom: 16
+
## v1.1.0
### New Features
- Possibility to launch the AR mode automatically (when device allows) with the opt-in option `activateAR` set to `true`
diff --git a/demos/auto-activate.html b/demos/auto-activate.html
index d051deb..e212e67 100644
--- a/demos/auto-activate.html
+++ b/demos/auto-activate.html
@@ -31,7 +31,7 @@
width: 100vw;
height: 100vh;
background-color: #3e4c55;
- z-index: 3;
+ z-index: 4;
display: none;
}
diff --git a/package.json b/package.json
index 523eb11..249974e 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@maptiler/ar-control",
- "version": "1.1.0",
+ "version": "1.2.0",
"description": "AR Control for MapTiler SDK",
"type": "module",
"homepage": "https://docs.maptiler.com/sdk-js/modules/ar/",
diff --git a/readme.md b/readme.md
index 6e15f2a..31df6be 100644
--- a/readme.md
+++ b/readme.md
@@ -94,7 +94,7 @@ There are two events:
The AR control performs some temporary changes to the map view, so these events are handy to hide those transformations behind a curtain or displaying a message.
-In the [example](./examples/index.html), we show a fullscreen overlay with a waiting message at `computeStart` and hide it at `computeEnd`, just by dynamically updating the `.style.display` property of the overlay.
+In the [example](./examples/index.html), we show a fullscreen overlay with a waiting message at `computeStart` and hides it at `computeEnd`, just by dynamically updating the `.style.display` property of the overlay. Keep in mind that the `z-index` CSS property of this overlay must be higher than the 3D model view, so greater than `3`.
When using React, you may want to replace this logic by a change of state.
# Options
@@ -110,6 +110,7 @@ The constructor `MaptilerARControl` accepts an option object to customize the lo
- `logoHeight`(number): the height of the logo in pixels (if any). Default: `60`
- `logoClass` (string): CSS class to add to the class list of the `` element holding the logo (if any). If used, the `.logoHeight` as well as the default styling will no longer be applied.
- `activateAR` (boolean): When the platform allows, setting this to `true` automatically activates the AR mode as soon as the data is ready. Quick Look on iOS is likely to allow this, while WebXR on Android is not likeley to. Default: `false`
+- `highRes` (boolean): increases the resolution of the texture. Will most likely have no effect on iOS due to some format limitation. Default: `false`.
![](images/screenshot2.jpg)
diff --git a/src/MaptilerARControl.ts b/src/MaptilerARControl.ts
index 4064c0d..261e0e6 100644
--- a/src/MaptilerARControl.ts
+++ b/src/MaptilerARControl.ts
@@ -2,6 +2,7 @@
import { Map, LngLatBounds, LngLat, IControl } from "@maptiler/sdk";
import { ModelViewerElement } from "@google/model-viewer";
+import * as platformConstants from "./platform-constants.ts";
import EventEmitter from "events";
import * as THREE from "three";
@@ -34,6 +35,7 @@ function removeDomNode(node: HTMLElement) {
const MIN_TERRAIN_ZOOM = 12;
const TERRAIN_TILE_SIZE = 512;
+const MAX_ZOOM = 16;
function latLon2Tile(
zoom: number,
@@ -261,6 +263,12 @@ export type MaptilerARControlOptions = {
* Default: `false`
*/
activateAR?: boolean;
+
+ /**
+ * Generate a mesh with a higher resolution texture.
+ * Default: `false`
+ */
+ highRes?: false;
};
const defaultOptionValues: MaptilerARControlOptions = {
@@ -288,6 +296,7 @@ const defaultOptionValues: MaptilerARControlOptions = {
edgeColor: "#7b8487",
logo: "",
activateAR: false,
+ highRes: false,
};
const defaultArButtonStyle = {
@@ -389,12 +398,37 @@ export class MaptilerARControl extends EventEmitter implements IControl {
iconSpan.className = "maplibregl-ctrl-icon";
iconSpan.setAttribute("aria-hidden", "true");
this.controlButton.appendChild(iconSpan);
- iconSpan.innerHTML = `
-