<|start_filename|>SampleAppResources/js/sampleIndices.js<|end_filename|>
// This file and it's content is automatically generated and should not be altered!
var samples = [
    [
        {
            "path": "www/world/01_ImageTracking_1_ImageOnTarget/index.html",
            "requiredFeatures": [
                "image_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/01_ImageTracking_2_DifferentTargets/index.html",
            "requiredFeatures": [
                "image_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/01_ImageTracking_3_Interactivity/index.html",
            "requiredFeatures": [
                "image_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/01_ImageTracking_4_HtmlDrawable/index.html",
            "requiredFeatures": [
                "image_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/01_ImageTracking_5_Bonus-Sparkles/index.html",
            "requiredFeatures": [
                "image_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        }
    ],
    [
        {
            "path": "www/world/02_AdvancedImageTracking_1_Gestures/index.html",
            "requiredFeatures": [
                "image_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/02_AdvancedImageTracking_2_DistanceToTarget/index.html",
            "requiredFeatures": [
                "image_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/02_AdvancedImageTracking_3_ExtendedTracking/index.html",
            "requiredFeatures": [
                "image_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "sd_640x480"
            }
        }
    ],
    [
        {
            "path": "www/world/03_MultipleTargets_1_MultipleTargets/index.html",
            "requiredFeatures": [
                "image_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/03_MultipleTargets_2_DistanceBetweenTargets/index.html",
            "requiredFeatures": [
                "image_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/03_MultipleTargets_3_TransformationBetweenTargets/index.html",
            "requiredFeatures": [
                "image_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        }
    ],
    [
        {
            "path": "www/world/04_CloudRecognition_1_SingleImageRecognition/index.html",
            "requiredFeatures": [
                "image_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back"
            }
        },
        {
            "path": "www/world/04_CloudRecognition_2_ContinuousImageRecognition/index.html",
            "requiredFeatures": [
                "image_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back"
            }
        },
        {
            "path": "www/world/04_CloudRecognition_3_UsingMetainformationInTheResponse/index.html",
            "requiredFeatures": [
                "image_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back"
            }
        }
    ],
    [
        {
            "path": "www/world/05_InstantTracking_1_SimpleInstantTracking/index.html",
            "requiredFeatures": [
                "instant_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back"
            }
        },
        {
            "path": "www/world/05_InstantTracking_2_3dModelOnPlane/index.html",
            "requiredFeatures": [
                "instant_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back"
            }
        },
        {
            "path": "www/world/05_InstantTracking_3_Interactivity/index.html",
            "requiredFeatures": [
                "instant_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back"
            }
        },
        {
            "path": "www/world/05_InstantTracking_4_SceneInteraction/index.html",
            "requiredFeatures": [
                "instant_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back"
            }
        },
        {
            "path": "www/world/05_InstantTracking_5_SaveInstantTarget/index.html",
            "requiredFeatures": [
                "instant_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back"
            }
        },
        {
            "path": "www/world/05_InstantTracking_6_LoadInstantTarget/index.html",
            "requiredFeatures": [
                "instant_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back"
            }
        }
    ],
    [
        {
            "path": "www/world/06_ObjectTracking_1_BasicObjectTracking/index.html",
            "requiredFeatures": [
                "object_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/06_ObjectTracking_2_2dImageAndSoundAugmentations/index.html",
            "requiredFeatures": [
                "object_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/06_ObjectTracking_3_Animated3dAugmentations/index.html",
            "requiredFeatures": [
                "object_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/06_ObjectTracking_4_ExtendedObjectTracking/index.html",
            "requiredFeatures": [
                "object_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        }
    ],
    [
        {
            "path": "www/world/07_3dModels_1_3dModelOnTarget/index.html",
            "requiredFeatures": [
                "image_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/07_3dModels_2_AppearingAnimation/index.html",
            "requiredFeatures": [
                "image_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/07_3dModels_3_Interactivity/index.html",
            "requiredFeatures": [
                "image_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/07_3dModels_4_SnapToScreen/index.html",
            "requiredFeatures": [
                "image_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/07_3dModels_5_AnimatedModelParts/index.html",
            "requiredFeatures": [
                "image_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/07_3dModels_6_3dModelAtGeoLocation/index.html",
            "requiredFeatures": [
                "geo"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        }
    ],
    [
        {
            "path": "www/world/08_PointOfInterest_1_PoiAtLocation/index.html",
            "requiredFeatures": [
                "geo"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/08_PointOfInterest_2_PoiWithLabel/index.html",
            "requiredFeatures": [
                "geo"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/08_PointOfInterest_3_MultiplePois/index.html",
            "requiredFeatures": [
                "geo"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/08_PointOfInterest_4_SelectingPois/index.html",
            "requiredFeatures": [
                "geo"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        }
    ],
    [
        {
            "path": "www/world/09_ObtainPoiData_1_FromApplicationModel/index.html",
            "requiredFeatures": [
                "geo"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            },
            "requiredExtension": "ObtainPoiDataFromApplicationModel"
        },
        {
            "path": "www/world/09_ObtainPoiData_2_FromLocalResource/index.html",
            "requiredFeatures": [
                "geo"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/09_ObtainPoiData_3_FromWebservice/index.html",
            "requiredFeatures": [
                "geo"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        }
    ],
    [
        {
            "path": "www/world/10_BrowsingPois_1_PresentingDetails/index.html",
            "requiredFeatures": [
                "geo"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/10_BrowsingPois_2_AddingRadar/index.html",
            "requiredFeatures": [
                "geo"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/10_BrowsingPois_3_LimitingRange/index.html",
            "requiredFeatures": [
                "geo"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/10_BrowsingPois_4_ReloadingContent/index.html",
            "requiredFeatures": [
                "geo"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/10_BrowsingPois_5_NativeDetailScreen/index.html",
            "requiredFeatures": [
                "geo"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/10_BrowsingPois_6_Bonus-CaptureScreen/index.html",
            "requiredFeatures": [
                "geo",
                "photo_library_screenshot_import"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        }
    ],
    [
        {
            "path": "www/world/11_Video_1_SimpleVideo/index.html",
            "requiredFeatures": [
                "image_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/11_Video_2_PlaybackStates/index.html",
            "requiredFeatures": [
                "image_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/11_Video_3_SnappingVideo/index.html",
            "requiredFeatures": [
                "image_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/11_Video_4_Bonus-TransparentVideo/index.html",
            "requiredFeatures": [
                "image_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        }
    ],
    [
        {
            "path": "www/world/12_HardwareControl_1_FrontCamera/index.html",
            "requiredFeatures": [
                "geo"
            ],
            "startupConfiguration": {
                "camera_position": "front",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/12_HardwareControl_2_CameraSwitching/index.html",
            "requiredFeatures": [
                "geo"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/12_HardwareControl_3_AdvancedFeatures/index.html",
            "requiredFeatures": [
                "geo"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        }
    ],
    [
        {
            "path": "www/world/x_Demo_1_2dTrackingAndGeo/index.html",
            "requiredFeatures": [
                "image_tracking",
                "geo"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/x_Demo_2_SolarSystem(Geo)/index.html",
            "requiredFeatures": [
                "geo"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        },
        {
            "path": "www/world/x_Demo_3_SolarSystem(2dTracking)/index.html",
            "requiredFeatures": [
                "image_tracking"
            ],
            "startupConfiguration": {
                "camera_position": "back",
                "camera_resolution": "auto"
            }
        }
    ]
]

function getSamplePath(category, sample) {
	return samples[category][sample];

}

<|start_filename|>SampleAppResources/world/10_BrowsingPois_6_Bonus-CaptureScreen/css/default.css<|end_filename|>
html, body {
    margin: 0;
    height: 100%;
    overflow: hidden
}

#mainHeader {
    background-color: #ddd;
    position: absolute;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: env(safe-area-inset-top);
}

#footer {
    position: absolute;
    text-align: center;
    width: 100%;
    bottom: calc(1vh + env(safe-area-inset-bottom));
}

#popupButton {
    margin: auto;
}

#popupButton img {
    width: 100%;
    height: 100%;
}

#popupButton img:hover {
    opacity: 0.7;
}

#popupButtonTooltip {
  visibility: hidden;
  background-color: #edeca8;
  color: #000;
  font-family: sans-serif;
  text-align: center;
  border-radius: 6px;
  padding: 5px 0;

  position: absolute;
  z-index: 1;
  bottom: 100%;
  left: 50%;
}

#popupButton:hover #popupButtonTooltip {
    visibility: visible
}

#panelPoiDetail {
    background-color: #eee;
    height: 100%;
    right: 0;
    position: absolute;
    font-family: sans-serif;
    visibility: hidden;
    margin-top: env(safe-area-inset-top);
}

#poiDetailDistance {
    color: #3979db;
}

#panelRange {
    background-color: #eee;
    height: 100%;
    left: 0;
    position: absolute;
    font-family: sans-serif;
    visibility: hidden;
    margin-top: env(safe-area-inset-top);
}

#panelRangeValue {
    color: #3979db;
}

#panelRangePlaces {
    color: #3979db;
}

#panelRangeSliderContainer {
    display: flex;
    align-items: center;
}

#panelRangeSliderValue{
    background-color: #ccc;
    border-radius: 4px;
    text-align: center;
}

.header {
    background-color: #ddd;
    position: absolute;
    width: 100%;
    align-items: center;
    display: flex;
}

.customButton {
    z-index: 1;
    border-radius: 20px;
    border-style: solid;
    border-color: #ccc;
    font-weight: bold;
    font-size: small;
    background-color: #fff;
    white-space: nowrap;
}

#\#poiDetailMoreButton {
    margin: 0;
}

.headerTitle {
    flex: 1;
    text-align:center;
    font-weight: normal;
}

.content {
    position: absolute;
}

@media screen and (orientation: portrait) {
    #popupButton {
        width: 5vh;
        height: 5vh;
    }

    #popupButtonTooltip {
        width: 40vw;
        margin-left: -20vw;
    }

    #panelPoiDetail {
        top: 5vh;
        width: 70vw;
    }

    #panelRange {
        top: 5vh;
        width: 70vw;
    }

    #panelRangeSliderValue{
        padding: 1vh;
        margin-right: 1vh;
        width: 8vw;
    }

    #mainHeader {
        height: 5vh;
    }

    .header {
        top: 2vh;
        height: 5vh;
    }

    .customButton {
        height: 4vh;
        width: 10vh;
        margin-left: 1vh;
        margin-right: 1vh;
    }

    #snapshotButton {
        width: 13vh;
    }

    .headerTitle {
        margin-left: -10vh;
        margin-right: 1vw;
    }

    .content {
        top: 7vh;
        margin-left: 5vw;
        margin-right: 5vw;
    }
}

@media screen and (orientation: landscape) {
    #popupButton {
        width: 5vw;
        height: 5vw;
    }

    #popupButtonTooltip {
        width: 40vh;
        margin-left: -20vh;
    }

    #panelPoiDetail {
        top: 5vw;
        width: calc(70vh + env(safe-area-inset-right));
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    #panelRange {
        top: 5vw;
        width: calc(70vh + env(safe-area-inset-left));
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    #panelRangeSliderValue{
        padding: 1vw;
        margin-right: 1vw;
        width: 8vh;
    }

    #mainHeader {
        height: 5vw;
    }

    .header {
        top: 2vw;
        height: 5vw;
        width: calc(100% - env(safe-area-inset-left) - env(safe-area-inset-right));
    }

    .customButton {
        height: 4vw;
        width: 10vw;
        margin-left: 1vw;
        margin-right: 1vw;
    }

    #snapshotButton {
        width: 13vw;
    }

    .headerTitle {
        margin-left: -10vw;
        margin-right: 1vh;
    }

    .content {
        top: 7vw;
        margin-left: 5vh;
        margin-right: 5vh;
    }
}


<|start_filename|>SampleAppResources/world/02_AdvancedImageTracking_1_Gestures/css/default.css<|end_filename|>
html, body {
    margin: 0;
    height: 100%;
    overflow: hidden
}

.info {
    font-size: large;
    position: absolute;
    width: 100%;
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-bottom: 12px;
    background-color: #BBBBBB;
    text-align: center;
    top: 0;
    left: 0;
    opacity: 0.7;
    display: table;
}

#infoBox {
    display: none;
}

#infoBox .text {
    display: table-cell;
    vertical-align: middle;
    text-align: right;
    width: 50%;
}

#infoBox .icons {
    display: table-cell;
    vertical-align: middle;
    text-align: left;
}

#infoBox .icons img {
    margin-left: 15px;
}


.overlayPickerInactive {
    opacity: 0.5;
}

.overlayPickerInactive a:hover {
    background: white;
    border-color: white;
    color: black;
    text-shadow: none;
}

.overlayPickerInactive a:active {
    background: white;
    border-color: white;
    color: black;
    text-shadow: none;
}

.overlayButton:active {
    opacity: 0.5;
}

.overlayButton img {
    height: 100%;
}

@media screen and (orientation: portrait) {
    #overlayContainer {
        background: none;
        position: absolute;
        right: 0;
        height: 100%;
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-right: calc(1vw + env(safe-area-inset-right));
    }

    #overlayPicker {
        display: none;
        overflow: hidden;
        height: 100%;
        text-align:right;
    }

    .overlayButton {
        text-align: center;
        vertical-align: middle;
        width: 10vh;
        height: 10vh;
        margin-top: 0.5vh;
        margin-bottom: 0.5vh;
        background-color: #fff;
        border-radius: 8px;
        box-shadow: 1px 1px #000;
    }
}

@media screen and (orientation: landscape) {
    #overlayContainer {
        background: none;
        position: absolute;
        bottom: 0;
        width: 100%;
        padding-bottom: calc(1vh + env(safe-area-inset-bottom));
    }

    #overlayPicker {
        display:none;
        text-align: center;
        width: 100%;
    }

    .overlayButton {
        padding: 0;
        display: inline-block;
        text-align: center;
        vertical-align: middle;
        width: 10vw;
        height: 10vw;
        margin-left: 0.5vw;
        margin-right: 0.5vw;
        background-color: #fff;
        border-radius: 8px;
        box-shadow: 1px 1px #000;
    }
}


<|start_filename|>SampleAppResources/js/index.js<|end_filename|>
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
var app = {

    // represents the device capability of launching ARchitect Worlds with specific features
    isDeviceSupported: false,
    isArchitectWorldLoaded: false,

    // Application Constructor
    initialize: function() {
        this.bindEvents();
    },
    // Bind Event Listeners
    //
    // Bind any events that are required on startup. Common events are:
    // 'load', 'deviceready', 'offline', and 'online'.
    bindEvents: function() {
        document.addEventListener('deviceready', this.onDeviceReady, false);
    },
    // deviceready Event Handler
    onDeviceReady: function() {
        app.wikitudePlugin = cordova.require("com.wikitude.phonegap.wikitudeplugin.WikitudePlugin");
        // set a callback that is called once the back button was clicked.
        app.wikitudePlugin.setBackButtonCallback(app.onBackButton);
        if (cordova.platform == "ios") {
            app.wikitudePlugin.setErrorHandler(app.onRuntimeError);
        }
        app.wikitudePlugin.setJSONObjectReceivedCallback(app.onJSONObjectReceived);
    },
    continueLoadingExampleARchitectWorld: function(example) {
        /* cordova.file.applicationDirectory is used to demonstrate the use of the cordova file plugin in combination with the Wikitude plugin */
        /* The length check here is only necessary because for each example the same 'example' object is given here and we only want to change the path once. */
        if ( example.path.length > cordova.file.applicationDirectory ) {
            if ( example.path.substring(0, cordova.file.applicationDirectory) != cordova.file.applicationDirectory ) {
                example.path = cordova.file.applicationDirectory + example.path;
            }
        }

        app.prepareArchitectWorld(example, function() {
            app.loadARchitectWorld(example);
        });
    },
    // --- Wikitude Plugin ---
    loadExampleARchitectWorld: function(example) {

        app.isArchitectWorldLoaded = false;

        if ( example.requiredExtension === "ObtainPoiDataFromApplicationModel" ) {
            navigator.geolocation.getCurrentPosition(
                function() {
                    app.continueLoadingExampleARchitectWorld(example);
                },
                function() {
                    app.wikitudePlugin.showAlert("Failed to get the current device position.");
                }, { enableHighAccuracy: true, maximumAge: Infinity, timeout: 5000 });
        } else {
            app.continueLoadingExampleARchitectWorld(example);
        }
    },
    loadCustomARchitectWorldFromURL: function(url) {
        var customArchitectWorld = {
            "path": url,
            "requiredFeatures": [
                "image_tracking",
                "geo"
            ],
            "startupConfiguration": {
                "camera_position": "back"
            }
        };
        app.isArchitectWorldLoaded = false;
        app.prepareArchitectWorld(customArchitectWorld, function() {
            app.loadARchitectWorld(customArchitectWorld);
        });
    },
    prepareArchitectWorld: function(architectWorld, successCallback) {
        app.wikitudePlugin.isDeviceSupported(function() {
            app.wikitudePlugin.requestAccess(
                function() {
                    successCallback();
                },
                function(error) {
                    /* The error object contains two error messages.
                        * userDescription is a end user formatted message that can be displayed with e.g. a JS alert
                        * developerDescription is a developer formatted message with more detailed information about the error
                     */
                    /* Here, the userDescription is used to show a confirmation box which, in case of a positive result, shows the applications settings so that user can grant access. */
                    var openAppSettings = confirm(error.userDescription + '\nOpen App Settings?');
                    if ( openAppSettings == true ) {
                        app.wikitudePlugin.openAppSettings();
                    }
                },
                architectWorld.requiredFeatures);
        }, function(errorMessage) {
            app.wikitudePlugin.showAlert(errorMessage);
        },
        architectWorld.requiredFeatures);
    },
    // Use this method to load a specific ARchitect World from either the local file system or a remote server
    loadARchitectWorld: function(architectWorld) {
        app.wikitudePlugin.loadARchitectWorld(function successFn(loadedURL) {
                /* Respond to successful world loading if you need to */
                app.isArchitectWorldLoaded = true;
                window.plugins.insomnia.keepAwake();

                /* in case the loaded Architect World belongs to the 'obtain poi data from application model' example, we can now safely inject poi data. */
                if ( architectWorld.requiredExtension === "ObtainPoiDataFromApplicationModel" ) {
                    prepareApplicationDataModel();
                    injectGeneratedPoiJsonData();
                }
            }, function errorFn(error) {
                app.isArchitectWorldLoaded = false;
                app.wikitudePlugin.showAlert('Loading AR web view failed: ' + error);
            },
            architectWorld.path, architectWorld.requiredFeatures, architectWorld.startupConfiguration
        );
    },
    // This function gets called if you call "AR.platform.sendJSONObject" in your ARchitect World
    onJSONObjectReceived: function (jsonObject) {
        if (typeof jsonObject.action !== 'undefined') {
            if ( jsonObject.action === "capture_screen" ) {
                app.wikitudePlugin.captureScreen(
                    function(absoluteFilePath) {
                        app.wikitudePlugin.showAlert("snapshot stored at:\n" + absoluteFilePath);
                    },
                    function (errorMessage) {
                        app.wikitudePlugin.showAlert(errorMessage);
                    },
                    true, null
                );
            } else if (jsonObject.action === "present_poi_details") {
                var alertMessage = "Poi '" + jsonObject.id + "' selected\nTitle: " + jsonObject.title + "\nDescription: " + jsonObject.description;
                app.wikitudePlugin.showAlert(alertMessage);
            } else if (jsonObject.action === "save_current_instant_target") {
                window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem){
                    fileSystem.root.getFile("SavedAugmentations.json", {create: true, exclusive: false}, function(fileEntry){
                        fileEntry.createWriter(function(writer){
                            writer.write(jsonObject.augmentations);
                        }, app.saveError);
                    }, app.saveError);
                }, app.saveError);
                app.wikitudePlugin.callJavaScript("World.saveCurrentInstantTargetToUrl(\"" + cordova.file.dataDirectory + "SavedInstantTarget.wto" + "\");")
            } else if (jsonObject.action === "load_existing_instant_target") {
                window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem){
                    fileSystem.root.getFile("SavedAugmentations.json", null, function(fileEntry){
                        fileEntry.file(function(file){
                            var reader = new FileReader();
                            reader.onloadend = function(evt) {
                                var augmentations = evt.target.result;
                                app.wikitudePlugin.callJavaScript("World.loadExistingInstantTargetFromUrl(\"" + cordova.file.dataDirectory + "SavedInstantTarget.wto" + "\"," + augmentations + ");");
                            };
                            reader.readAsText(file);
                        }, app.loadError);
                    }, app.loadError);
                }, app.loadError);
            }
        }
    },
    saveError: function(error) {
        app.wikitudePlugin.showAlert("Could not save the current instant target.");
    },
    loadError: function(error) {
        app.wikitudePlugin.showAlert("Could not load instant target, please save it first.");
    },
    onRuntimeError: function (error) {
        if (error.code == 960) {
            var openAppSettings = confirm(error.message + '\nOpen App Settings?');
            if (openAppSettings == true) {
                app.wikitudePlugin.openAppSettings();
            }
        }
    },
    onBackButton: function () {
        window.plugins.insomnia.allowSleepAgain();
    },
    showBuildInformation: function() {
        var sdkVersion = ""

        app.wikitudePlugin.getSDKVersion(function(version){ sdkVersion = version });

        app.wikitudePlugin.getSDKBuildInformation(function(buildInformationJSON) {
            var buildInformation = JSON.parse(buildInformationJSON);
            /*
             * Using app.wikitudePlugin.showAlert() is required for alerts to work while an Architect view is active.
             * Since there is no Architect view in use while we are in the main menu, we should just use a regular JS alert here.
             */
            var buildInformationText = "Build configuration: " + buildInformation.buildConfiguration + "\n" +
                                        "Build date: " + buildInformation.buildDate + "\n" +
                                        "Build number: " + buildInformation.buildNumber + "\n" +
                                        "Build version: " + sdkVersion;
            navigator.notification.alert(buildInformationText, null, "Build information", "OK");
        });
    }
    // --- End Wikitude Plugin ---
};

app.initialize();


<|start_filename|>SampleAppResources/world/05_InstantTracking_3_Interactivity/js/3dmodelsandgesturesinstanttracking.js<|end_filename|>
var defaultScaleValue = 0.045;
var defaultRotationValue = 0;

var rotationValues = [];
var scaleValues = [];

var allCurrentModels = [];

var oneFingerGestureAllowed = false;

/*
    This global callback can be utilized to react on the transition from and to 2 finger gestures; specifically, we
    disallow the drag gesture in this case to ensure an intuitive experience.
*/
AR.context.on2FingerGestureStarted = function() {
    oneFingerGestureAllowed = false;
};

var World = {

    platformAssisstedTrackingSupported: false,
    createOverlaysCalled: false,
    canStartTrackingIntervalHandle: null,

    modelPaths: [
        "assets/models/clock.wt3",
        "assets/models/couch.wt3",
        "assets/models/officechair.wt3",
        "assets/models/table.wt3",
        "assets/models/trainer.wt3"
    ],
    /*
        RequestedModel is the index of the next model to be created. This is necessary because we have to wait one
        frame in order to pass the correct initial position to the newly created model. InitialDrag is a boolean
        that serves the purpose of swiping the model into the scene. In the moment that the model is created, the
        drag event has already started and will not be caught by the model, so the motion has to be carried out by
        the tracking plane. LastAddedModel always holds the newest model in allCurrentModels so that the plane knows
         which model to apply the motion to.
    */
    requestedModel: -1,
    initialDrag: false,
    lastAddedModel: null,

    init: function initFn() {
        /*
            When you'd like to make use of the SMART feature, make sure to call this function and await the result
            in the AR.hardware.smart.onPlatformAssistedTrackingAvailabilityChanged callback.
         */
        AR.hardware.smart.isPlatformAssistedTrackingSupported();
    },

    createOverlays: function createOverlaysFn() {
        if (World.createOverlaysCalled) {
            return;
        }

        World.createOverlaysCalled = true;

        var crossHairsRedImage = new AR.ImageResource("assets/crosshairs_red.png", {
            onError: World.onError
        });
        this.crossHairsRedDrawable = new AR.ImageDrawable(crossHairsRedImage, 1.0);

        var crossHairsBlueImage = new AR.ImageResource("assets/crosshairs_blue.png", {
            onError: World.onError
        });
        this.crossHairsBlueDrawable = new AR.ImageDrawable(crossHairsBlueImage, 1.0);

        var crossHairsGreenImage = new AR.ImageResource("assets/crosshairs_green.png", {
            onError: World.onError
        });
        this.crossHairsGreenDrawable = new AR.ImageDrawable(crossHairsGreenImage, 1.0);

        this.tracker = new AR.InstantTracker({
            onChangedState: function onChangedStateFn(state) {
                var els = [].slice.apply(document.getElementsByClassName("model-button"));
                if (state === AR.InstantTrackerState.INITIALIZING) {
                    els.forEach(function(element) {
                        element.classList.add("image-button-inactive");
                    });

                    document.getElementById("tracking-start-stop-button").src = "assets/buttons/start.png";
                    document.getElementById("slider-container").style.visibility = "visible";
                } else {
                    if (World.platformAssisstedTrackingSupported) {
                        World.showUserInstructions("Running with platform assisted tracking(ARKit or ARCore).");
                    }

                    els.forEach(function(element) {
                        element.classList.remove("image-button-inactive");
                    });

                    document.getElementById("tracking-start-stop-button").src = "assets/buttons/stop.png";
                    document.getElementById("slider-container").style.visibility = "hidden";
                }
            },
            deviceHeight: 1.0,
            onError: World.onError,
            onChangeStateError: World.onError
        });

        this.instantTrackable = new AR.InstantTrackable(this.tracker, {
            drawables: {
                cam: World.crossHairsBlueDrawable,
                initialization: World.crossHairsRedDrawable
            },
            onTrackingStarted: function onTrackingStartedFn() {
                /* Do something when tracking is started (recognized). */
            },
            onTrackingStopped: function onTrackingStoppedFn() {
                World.changeTrackingHeight(this.tracker.deviceHeight);
            },
            onTrackingPlaneClick: function onTrackingPlaneClickFn(xPos, yPos) {
                /* React to a the tracking plane being clicked here. */
            },
            onTrackingPlaneDragBegan: function onTrackingPlaneDragBeganFn(xPos, yPos) {
                oneFingerGestureAllowed = true;
                World.updatePlaneDrag(xPos, yPos);
            },
            onTrackingPlaneDragChanged: function onTrackingPlaneDragChangedFn(xPos, yPos) {
                World.updatePlaneDrag(xPos, yPos);
            },
            onTrackingPlaneDragEnded: function onTrackingPlaneDragEndedFn(xPos, yPos) {
                World.updatePlaneDrag(xPos, yPos);
                World.initialDrag = false;
            },
            onError: World.onError
        });

        World.canStartTrackingIntervalHandle = setInterval(
            function() {
                if (World.tracker.canStartTracking) {
                    World.instantTrackable.drawables.initialization = [World.crossHairsGreenDrawable];
                } else {
                    World.instantTrackable.drawables.initialization = [World.crossHairsRedDrawable];
                }
            },
            1000
        );

        World.setupEventListeners()
    },

    setupEventListeners: function setupEventListenersFn() {
        document.getElementById("tracking-model-button-clock").addEventListener('touchstart', function( /*ev*/ ) {
            World.requestedModel = 0;
        }, false);
        document.getElementById("tracking-model-button-couch").addEventListener('touchstart', function( /*ev*/ ) {
            World.requestedModel = 1;
        }, false);
        document.getElementById("tracking-model-button-chair").addEventListener('touchstart', function( /*ev*/ ) {
            World.requestedModel = 2;
        }, false);
        document.getElementById("tracking-model-button-table").addEventListener('touchstart', function( /*ev*/ ) {
            World.requestedModel = 3;
        }, false);
        document.getElementById("tracking-model-button-trainer").addEventListener('touchstart', function( /*ev*/ ) {
            World.requestedModel = 4;
        }, false);
    },

    updatePlaneDrag: function updatePlaneDragFn(xPos, yPos) {
        if (World.requestedModel >= 0) {
            World.addModel(World.requestedModel, xPos, yPos);
            World.requestedModel = -1;
            World.initialDrag = true;
        }

        if (World.initialDrag && oneFingerGestureAllowed) {
            World.lastAddedModel.translate = {
                x: xPos,
                y: yPos
            };
        }
    },

    changeTrackerState: function changeTrackerStateFn() {
        if (this.tracker.deviceHeight > 2.0) this.tracker.deviceHeight = 2.0;
        if (this.tracker.deviceHeight < 0.1) this.tracker.deviceHeight = 0.1;
        if (this.tracker.state === AR.InstantTrackerState.INITIALIZING) {
            this.tracker.state = AR.InstantTrackerState.TRACKING;
        } else {
            this.tracker.state = AR.InstantTrackerState.INITIALIZING;
        }
    },

    changeTrackingHeight: function changeTrackingHeightFn(height) {
        this.tracker.deviceHeight = parseFloat(height);
        if (height > 2.0) height = 2.0;
        if (height < 0.1) height = 0.1;
        document.getElementById('height-value-text').value = height;
        document.getElementById('tracking-height-slider').value = height;
    },

    addModel: function addModelFn(pathIndex, xpos, ypos) {
        if (World.isTracking()) {
            var modelIndex = rotationValues.length;
            World.addModelValues();

            var model = new AR.Model(World.modelPaths[pathIndex], {
                scale: {
                    x: defaultScaleValue,
                    y: defaultScaleValue,
                    z: defaultScaleValue
                },
                translate: {
                    x: xpos,
                    y: ypos
                },
                /*
                    We recommend only implementing the callbacks actually needed as they will cause calls from
                    native to JavaScript being invoked. Especially for the frequently called changed callbacks this
                    should be avoided. In this sample all callbacks are implemented simply for demonstrative purposes.
                */
                onDragBegan: function( /*x, y*/ ) {
                    oneFingerGestureAllowed = true;
                },
                onDragChanged: function(relativeX, relativeY, intersectionX, intersectionY) {
                    if (oneFingerGestureAllowed) {
                        /*
                            We recommend setting the entire translate property rather than its individual components
                            as the latter would cause several call to native, which can potentially lead to performance
                            issues on older devices. The same applied to the rotate and scale property.
                        */
                        this.translate = {
                            x: intersectionX,
                            y: intersectionY
                        };
                    }
                },
                onDragEnded: function(x, y) {
                    /* React to the drag gesture ending. */
                },
                onRotationBegan: function(angleInDegrees) {
                    /* React to the rotation gesture beginning. */
                },
                onRotationChanged: function(angleInDegrees) {
                    this.rotate.z = rotationValues[modelIndex] - angleInDegrees;
                },
                onRotationEnded: function( /*angleInDegrees*/ ) {
                    rotationValues[modelIndex] = this.rotate.z
                },
                onScaleBegan: function(scale) {
                    /* React to the scale gesture beginning. */
                },
                onScaleChanged: function(scale) {
                    var scaleValue = scaleValues[modelIndex] * scale;
                    this.scale = {
                        x: scaleValue,
                        y: scaleValue,
                        z: scaleValue
                    };
                },
                onScaleEnded: function( /*scale*/ ) {
                    scaleValues[modelIndex] = this.scale.x;
                },
                onError: World.onError
            });

            allCurrentModels.push(model);
            World.lastAddedModel = model;
            this.instantTrackable.drawables.addCamDrawable(model);
        }
    },

    isTracking: function isTrackingFn() {
        return (this.tracker.state === AR.InstantTrackerState.TRACKING);
    },

    addModelValues: function addModelValuesFn() {
        rotationValues.push(defaultRotationValue);
        scaleValues.push(defaultScaleValue);
    },

    resetModels: function resetModelsFn() {
        this.instantTrackable.drawables.removeCamDrawable(allCurrentModels);

        allCurrentModels = [];
        World.resetAllModelValues();
    },

    resetAllModelValues: function resetAllModelValuesFn() {
        rotationValues = [];
        scaleValues = [];
    },

    onError: function onErrorFn(error) {
        alert(error);

        /* if license check failed, stop repeatedly calling `canStartTracking` */
        if (error.id === 1001 && error.domain === "InstantTracking") {
            clearInterval(World.canStartTrackingIntervalHandle);
        }
    },

    showUserInstructions: function showUserInstructionsFn(message) {
        document.getElementById('loadingMessage').innerHTML = message;
    }
};

AR.hardware.smart.onPlatformAssistedTrackingAvailabilityChanged = function(availability) {
    switch (availability) {
        case AR.hardware.smart.SmartAvailability.INDETERMINATE_QUERY_FAILED:
            /* Query failed for some reason; try again or accept the fact. */
            World.showUserInstructions("Could not determine if platform assisted tracking is supported.<br>" +
                "Running without platform assisted tracking (ARKit or ARCore).");
            World.createOverlays();
            break;
        case AR.hardware.smart.SmartAvailability.CHECKING_QUERY_ONGOING:
            /* Query currently ongoing; be patient and do nothing or inform the user about the ongoing process. */
            break;
        case AR.hardware.smart.SmartAvailability.UNSUPPORTED:
            /* Not supported, create the scene now without platform assisted tracking enabled. */
            World.showUserInstructions("Running without platform assisted tracking (ARKit or ARCore).");
            World.createOverlays();
            break;
        case AR.hardware.smart.SmartAvailability.SUPPORTED_UPDATE_REQUIRED:
        case AR.hardware.smart.SmartAvailability.SUPPORTED:
            /*
                Supported, create the scene now with platform assisted tracking enabled SUPPORTED_UPDATE_REQUIRED
                may be followed by SUPPORTED, make sure not to create the scene twice (see check in createOverlays).
             */
            World.platformAssisstedTrackingSupported = true;
            World.showUserInstructions("Running with platform assisted tracking(ARKit or ARCore). <br> " +
                "Move your phone around until the crosshair turns green, which is when you can start tracking.");
            World.createOverlays();
            break;
    }
};

World.init();

<|start_filename|>SampleAppResources/world/12_HardwareControl_1_FrontCamera/css/default.css<|end_filename|>
html, body {
    margin: 0;
    height: 100%;
    overflow: hidden
}

#footer {
    position: absolute;
    text-align: center;
    width: 100%;
    bottom: calc(1vh + env(safe-area-inset-bottom));
}

#popupButton {
    margin: auto;
}

#popupButton img {
    width: 100%;
    height: 100%;
}

#popupButton img:hover {
    opacity: 0.7;
}

#popupButtonTooltip {
  visibility: hidden;
  background-color: #edeca8;
  color: #000;
  font-family: sans-serif;
  text-align: center;
  border-radius: 6px;
  padding: 5px 0;

  position: absolute;
  z-index: 1;
  bottom: 100%;
  left: 50%;
}

#popupButton:hover #popupButtonTooltip {
    visibility: visible
}

.content {
    position: absolute;
}

@media screen and (orientation: portrait) {
    #popupButton {
        width: 5vh;
        height: 5vh;
    }

    #popupButtonTooltip {
        width: 40vw;
        margin-left: -20vw;
    }

    .content {
        top: 7vh;
        margin-left: 5vw;
        margin-right: 5vw;
    }
}

@media screen and (orientation: landscape) {
    #popupButton {
        width: 5vw;
        height: 5vw;
    }

    #popupButtonTooltip {
        width: 40vh;
        margin-left: -20vh;
    }

    .content {
        top: 7vw;
        margin-left: 5vh;
        margin-right: 5vh;
    }
}


<|start_filename|>SampleAppResources/world/12_HardwareControl_2_CameraSwitching/js/camSwitch.js<|end_filename|>
/* Implementation of AR-Experience (aka "World"). */
var World = {
    /* You may request new data from server periodically, however: in this sample data is only requested once. */
    isRequestingData: false,

    /* True once data was fetched. */
    initiallyLoadedData: false,

    /* Different POI-Marker assets. */
    markerDrawableIdle: null,
    markerDrawableSelected: null,
    markerDrawableDirectionIndicator: null,

    /* List of AR.GeoObjects that are currently shown in the scene / World. */
    markerList: [],

    /* the last selected marker. */
    currentMarker: null,

    /* Called to inject new POI data. */
    loadPoisFromJsonData: function loadPoisFromJsonDataFn(poiData) {

        /* Empty list of visible markers. */
        World.markerList = [];

        /* Start loading marker assets. */
        World.markerDrawableIdle = new AR.ImageResource("assets/marker_idle.png", {
            onError: World.onError
        });
        World.markerDrawableSelected = new AR.ImageResource("assets/marker_selected.png", {
            onError: World.onError
        });
        World.markerDrawableDirectionIndicator = new AR.ImageResource("assets/indi.png", {
            onError: World.onError
        });

        /* Loop through POI-information and create an AR.GeoObject (=Marker) per POI. */
        for (var currentPlaceNr = 0; currentPlaceNr < poiData.length; currentPlaceNr++) {
            var singlePoi = {
                "id": poiData[currentPlaceNr].id,
                "latitude": parseFloat(poiData[currentPlaceNr].latitude),
                "longitude": parseFloat(poiData[currentPlaceNr].longitude),
                "altitude": parseFloat(poiData[currentPlaceNr].altitude),
                "title": poiData[currentPlaceNr].name,
                "description": poiData[currentPlaceNr].description
            };

            World.markerList.push(new Marker(singlePoi));
        }

        World.updateStatusMessage(currentPlaceNr + ' places loaded');
    },

    /* Updates status message shown in small "i"-button aligned bottom center. */
    updateStatusMessage: function updateStatusMessageFn(message, isWarning) {
        document.getElementById("popupButtonImage").src = isWarning ? "assets/warning_icon.png" : "assets/info_icon.png";
        document.getElementById("popupButtonTooltip").innerHTML = message;
    },

    /* Location updates, fired every time you call architectView.setLocation() in native environment. */
    locationChanged: function locationChangedFn(lat, lon, alt, acc) {
        /* Request data if not already present. */
        if (!World.initiallyLoadedData) {
            World.requestDataFromLocal(lat, lon);
            World.initiallyLoadedData = true;
        }
    },

    /* Fired when user pressed maker in cam. */
    onMarkerSelected: function onMarkerSelectedFn(marker) {

        /* Deselect previous marker. */
        if (World.currentMarker) {
            if (World.currentMarker.poiData.id === marker.poiData.id) {
                return;
            }
            World.currentMarker.setDeselected(World.currentMarker);
        }

        /* Highlight current one. */
        marker.setSelected(marker);
        World.currentMarker = marker;
    },

    /* Screen was clicked but no geo-object was hit. */
    onScreenClick: function onScreenClickFn() {
        if (World.currentMarker) {
            World.currentMarker.setDeselected(World.currentMarker);
        }
    },

    /*
        In case the data of your ARchitect World is static the content should be stored within the application.
        Create a JavaScript file (e.g. myJsonData.js) where a globally accessible variable is defined.
        Include the JavaScript in the ARchitect Worlds HTML by adding <script src="js/myJsonData.js"/> to make POI
        information available anywhere in your JavaScript.
    */

    /* Request POI data. */
    requestDataFromLocal: function requestDataFromLocalFn(lat, lon) {

        var poisNearby = Helper.bringPlacesToUser(myJsonData, lat, lon);
        World.loadPoisFromJsonData(poisNearby);

    },

    /* Switch between front and back camera. */
    switchCam: function switchCamFn() {
        if (AR.hardware.camera.position === AR.CONST.CAMERA_POSITION.FRONT) {
            AR.hardware.camera.position = AR.CONST.CAMERA_POSITION.BACK
        } else {
            AR.hardware.camera.position = AR.CONST.CAMERA_POSITION.FRONT
        }
    },

    onError: function onErrorFn(error) {
        alert(error);
    }
};

var Helper = {

    /*
        For demo purpose only, this method takes poi data and a center point (latitude, longitude) to relocate the
        given places around the user.
    */
    bringPlacesToUser: function bringPlacesToUserFn(poiData, latitude, longitude) {
        for (var i = 0; i < poiData.length; i++) {
            poiData[i].latitude = latitude + parseInt(poiData[i].latitudeOffset) / 100;
            poiData[i].longitude = longitude + parseInt(poiData[i].longitudeOffset) / 100;
            /*
                Note: setting altitude to '0' will cause places being shown below / above user, depending on the
                user 's GPS signal altitude.
                Using this constant will ignore any altitude information and always show the places on user-level
                altitude.
            */
            poiData[i].altitude = AR.CONST.UNKNOWN_ALTITUDE;
        }
        return poiData;
    }
};


/* Forward locationChanges to custom function. */
AR.context.onLocationChanged = World.locationChanged;

/* Forward clicks in empty area to World. */
AR.context.onScreenClick = World.onScreenClick;

<|start_filename|>SampleAppResources/world/08_PointOfInterest_4_SelectingPois/js/selectingpois.js<|end_filename|>
/* Implementation of AR-Experience (aka "World"). */
var World = {
    /* You may request new data from server periodically, however: in this sample data is only requested once. */
    isRequestingData: false,

    /* True once data was fetched. */
    initiallyLoadedData: false,

    /* Different POI-Marker assets. */
    markerDrawableIdle: null,
    markerDrawableSelected: null,
    markerDrawableDirectionIndicator: null,


    /* List of AR.GeoObjects that are currently shown in the scene / World. */
    markerList: [],

    /* the last selected marker. */
    currentMarker: null,

    /* Called to inject new POI data. */
    loadPoisFromJsonData: function loadPoisFromJsonDataFn(poiData) {
        /* Empty list of visible markers. */
        World.markerList = [];

        /* Start loading marker assets. */
        World.markerDrawableIdle = new AR.ImageResource("assets/marker_idle.png", {
            onError: World.onError
        });
        World.markerDrawableSelected = new AR.ImageResource("assets/marker_selected.png", {
            onError: World.onError
        });
        World.markerDrawableDirectionIndicator = new AR.ImageResource("assets/indi.png", {
            onError: World.onError
        });


        /* Loop through POI-information and create an AR.GeoObject (=Marker) per POI. */
        for (var currentPlaceNr = 0; currentPlaceNr < poiData.length; currentPlaceNr++) {
            var singlePoi = {
                "id": poiData[currentPlaceNr].id,
                "latitude": parseFloat(poiData[currentPlaceNr].latitude),
                "longitude": parseFloat(poiData[currentPlaceNr].longitude),
                "altitude": parseFloat(poiData[currentPlaceNr].altitude),
                "title": poiData[currentPlaceNr].name,
                "description": poiData[currentPlaceNr].description
            };

            /*
                To be able to deselect a marker while the user taps on the empty screen, the World object holds an
                 array that contains each marker.
            */
            World.markerList.push(new Marker(singlePoi));
        }

        World.updateStatusMessage(currentPlaceNr + ' places loaded');
    },

    /* Updates status message shown in small "i"-button aligned bottom center. */
    updateStatusMessage: function updateStatusMessageFn(message, isWarning) {
        document.getElementById("popupButtonImage").src = isWarning ? "assets/warning_icon.png" : "assets/info_icon.png";
        document.getElementById("popupButtonTooltip").innerHTML = message;
    },

    /* Location updates, fired every time you call architectView.setLocation() in native environment. */
    locationChanged: function locationChangedFn(lat, lon, alt, acc) {

        /*
            The custom function World.onLocationChanged checks with the flag World.initiallyLoadedData if the
            function was already called. With the first call of World.onLocationChanged an object that contains geo
            information will be created which will be later used to create a marker using the
            World.loadPoisFromJsonData function.
        */
        if (!World.initiallyLoadedData) {
            /*
                requestDataFromLocal with the geo information as parameters (latitude, longitude) creates different
                poi data to a random location in the user's vicinity.
            */
            World.requestDataFromLocal(lat, lon);
            World.initiallyLoadedData = true;
        }
    },

    /* Fired when user pressed maker in cam. */
    onMarkerSelected: function onMarkerSelectedFn(marker) {

        /* Deselect previous marker. */
        if (World.currentMarker) {
            if (World.currentMarker.poiData.id === marker.poiData.id) {
                return;
            }
            World.currentMarker.setDeselected(World.currentMarker);
        }

        /* Highlight current one. */
        marker.setSelected(marker);
        World.currentMarker = marker;
    },

    /* Screen was clicked but no geo-object was hit. */
    onScreenClick: function onScreenClickFn() {
        if (World.currentMarker) {
            World.currentMarker.setDeselected(World.currentMarker);
        }
    },

    /* Request POI data. */
    requestDataFromLocal: function requestDataFromLocalFn(centerPointLatitude, centerPointLongitude) {
        var poisToCreate = 20;
        var poiData = [];

        for (var i = 0; i < poisToCreate; i++) {
            poiData.push({
                "id": (i + 1),
                "longitude": (centerPointLongitude + (Math.random() / 5 - 0.1)),
                "latitude": (centerPointLatitude + (Math.random() / 5 - 0.1)),
                "description": ("This is the description of POI#" + (i + 1)),
                /* Use this value to ignore altitude information in general - marker will always be on user-level. */
                "altitude": AR.CONST.UNKNOWN_ALTITUDE,
                "name": ("POI#" + (i + 1))
            });
        }
        World.loadPoisFromJsonData(poiData);
    },

    onError: function onErrorFn(error) {
        alert(error);
    }
};

/*
    Set a custom function where location changes are forwarded to. There is also a possibility to set
    AR.context.onLocationChanged to null. In this case the function will not be called anymore and no further
    location updates will be received.
*/
AR.context.onLocationChanged = World.locationChanged;

/*
    To detect clicks where no drawable was hit set a custom function on AR.context.onScreenClick where the
    currently selected marker is deselected.
*/
AR.context.onScreenClick = World.onScreenClick;

<|start_filename|>SampleAppResources/world/04_CloudRecognition_1_SingleImageRecognition/css/default.css<|end_filename|>
.info {
    font-size: large;
    position: absolute;
    width: 100%;
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-bottom: 12px;
    background-color: #BBBBBB;
    text-align: center;
    top: 0;
    left: 0;
    opacity: 0.7;
    display: table;
}

#infoBox {
    display: none;
}

#infoBox .text {
    display: table-cell;
    vertical-align: middle;
    text-align: right;
    width: 20%;
}

#infoBox .icons {
    display: table-cell;
    vertical-align: middle;
    text-align: left;
}

#infoBox .icons img {
    margin-left: 15px;
}

#scanButtonWrapper {
    position: absolute;
    width: 100%;
    padding-top: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    background-color: rgba(187, 187, 187, 0.7);
    text-align: center;
    vertical-align: middle;
    bottom: 0;
    left: 0;
    display: table;
}

#scanButton {
    font-size: large;
    background-color: #fff;
}

#scanButton:active {
    opacity: 0.5;
}

#scanButton:focus{
    outline: none;
}

@media screen and (orientation: portrait) {
    #scanButton {
        width: 15vh;
        height: 5vh;
    }
}
@media screen and (orientation: landscape) {
    #scanButton {
        width: 15vw;
        height: 5vw;
    }
}

.errorMessage {
    font-size: large;
    position: absolute;
    width: 100%;
    padding-top: 12px;
    padding-bottom: 12px;
    background-color: #BBBBBB;
    text-align: center;
    top: 50%;
    left: 0;
    opacity: 0.7;
    display: table;
}


<|start_filename|>SampleAppResources/world/05_InstantTracking_5_SaveInstantTarget/css/default.css<|end_filename|>
body {
    margin: 0;
}

#height-value-text {
    font-size: large;
    text-align: center;
    float: right;
    box-sizing: border-box;
    border-color: #aaa;
}

#tracking-height-slider-container {
    display:inline-block;
    text-align: center;
}

#slider-container {
    display: inline-block;
}

#height-value-text-container {
    float: left;
    width: 20vw;
}

#save-button-container {
    float: right;
    width: 20vw;
}

.image-button {
    margin-bottom: env(safe-area-inset-bottom);
}

.image-button-inactive {
    opacity: 0.1;
}

#tracking-height-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 5vw;
    position: relative;
    background: none;
    top: 50%;
    transform: translate(0, -55%);
    border-color: #aaa;
}

#tracking-height-slider::-webkit-slider-thumb {
    top: 50%;
    transform: translate(0, -30%);
    border-color: #aaa;
    border-radius: 100%;
}

#tracking-height-slider::-webkit-slider-thumb:active {
    background: #ddd;
    border-color: #287bba;
}

#tracking-height-slider::-webkit-slider-runnable-track {
    background: #bbb;
    border-radius: 5px;
}

#tracking-controls-container-lower {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
}

#top-wrapper {
    position: absolute;
    right: 0;
    top: 0;
    left: 0;
    width: 100%;
}

.info {
    font-size: medium;
    width: 100%;
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-bottom: 12px;
    background-color: #BBBBBB;
    text-align: center;
    opacity: 0.7;
    display: table;
}

#tracking-controls-container-lower-spacing {
    display: inline-block;
}

@media screen and (orientation: portrait) {
    #slider-container {
        height: 8vh;
        margin-top: 1vh;
    }

    #save-button-container {
        height: 8vh;
        margin-top: 1vh;
    }

    #height-value-text {
        width: 8vh;
        height: 8vh;
    }

    #tracking-height-slider-container {
        width: 60vw;
        height: 100%;
    }

    #tracking-height-slider {
        width: 50vw;
    }

    #tracking-height-slider::-webkit-slider-thumb {
        width: 5vh;
        height: 5vh;
    }

    #tracking-height-slider::-webkit-slider-runnable-track {
        height: 2vh;
    }

    .image-button {
        width: 16vw;
        height: 16vw;
    }
}

@media screen and (orientation: landscape) {
    #slider-container {
        height: 8vw;
        margin-top: 1vw;
    }

    #save-button-container {
        height: 8vw;
        margin-top: 1vw;
    }

    #height-value-text {
        width: 8vw;
        height: 8vw;
    }

    #tracking-height-slider-container {
        width: 60vw;
        height: 100%;
    }

    #tracking-height-slider {
        width: 50vw;
    }

    #tracking-height-slider::-webkit-slider-thumb {
        width: 5vw;
        height: 5vw;
    }

    #tracking-height-slider::-webkit-slider-runnable-track {
        height: 2vw;
    }

    .image-button {
        width: 16vh;
        height: 16vh;
    }
}
