Layar Developer Documentation

Back to layar.com

reference Images

Starting with Layar API v8.3, you can specify links between reference images, so that when the Layar app tracks any of these reference images, it knows how it relates to the rest of the scene and therefore how to render the objects in the scene. 

You can use this feature for two purposes:  

In order to specify additional linked reference images, just add a referenceImages array at the top level of the getPOI response, next to the hotspots array. 

  Image Map

JSON Response - reference Images

keystring The reference image key 
Introduced API: v8.3
Mandatory/Optional: mandatory
Path: root.referenceImage
Detailed Description: The image key of the reference image uploaded to the publishing site.
Example:
{ "key": "test1" }
links array An array holding information regarding linked images
Mandatory/Optional: mandatory
Path: root.referenceImage
Detailed Description: Each element in links contains a to specifying which other reference image this one relates to and a transform specification that describes how to transform this reference image's coordinate system into the one that's being linked to.

Complete JSON Response Example

  • Linking two images
{
    "referenceImages": [
        {
            "key": "test1"
        },
        {
            "key": "jenstest1_a",
            "links": [
                {
                    "to": "jenstest1"
                }
            ]
        },
        {
            "key": "jenstest1_b",
            "featuresUrl": "http: //url_to_features",
            "links": [
                {
                    "to": "jenstest1",
                    "transform": {
                        "translate": {
                            "x": 1,
                            "y": 2,
                            "z": 3
                        }
                    }
                }
            ]
        }
    ]
}