User Tools

Site Tools


layarmmo-poi

This is an old revision of the document!


Add a hotspot/Point of Interest

<?php
 
echo '{
    "layer": "mmo-demo",
    "hotspots": [
        {
            "id": "28",
            "anchor":{
	    },
	    "text":{
	    }
        }
    ],
    "errorCode": 0,
    "errorString": "ok"
}';
 
?>

Positioning in space

<?php
 
$latitude = $_GET['lat'] + 0.00001;
$longitude = $_GET['lon'];
 
echo '{
    "layer": "mmodemo",
    "hotspots": [
        {
            "id": "01",
            "anchor":{
		"geolocation":{
		    "lat": '.$latitude.',
		    "lon": '.$longitude.'
		}
	    },
	    "text":{
		"title": "Monster"
	    }
        }
    ],
    "errorCode": 0,
    "errorString": "ok"
}';
 
?>

Full layer with an image

<?php
 
$latitude = $_GET['lat'] + 0.00001;
$longitude = $_GET['lon'];
 
echo '{
    "layer": "mmodemo",
    "hotspots": [
        {
            "id": "01",
            "anchor":{
	        "geolocation":{
		    "lat": '.$latitude.',
		    "lon": '.$longitude.'
		}
	    },
	    "text":{
		"title": "Monster"
	    },
	    "object":{
		"contentType": "image/png",
		"url": "http://www.wheretheimageis/imagename.png",
		"size": 1.8
	    }
        }
    ],
    "errorCode": 0,
    "errorString": "ok"
}';
 
?>

Add the transformation to make it always face you.

"object":{
    "contentType": "image/png",
    "url": "http://www.thoughtfulmonkey.com/layar/gilt/Banker.png",
    "size": 1.8
},
"transform":{
    "rotate": { 
    "axis": { 
	"x": 0, 
	"y": 0, 
	"z": 1
    }, 
    "angle": 0, 
    "rel": true 
}
layarmmo-poi.1336996165.txt.gz · Last modified: 2012/05/14 11:49 by matthewleach