User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

Next revision Both sides next revision
layarmmo-poi [2012/05/14 11:49]
matthewleach Content moved here from basic layer page
layarmmo-poi [2012/08/29 11:27]
Line 1: Line 1:
-Add a hotspot/Point of Interest+===Add a hotspot/Point of Interest== 
 +Time to add a "hotspot" This is how you place something in the environment.  Each will have its own unique ID, which you set yourself, and various other optional settings.  The snippet of code below, shows the mandatory parameters.  If you visit the [[|API page]], then the structure graph at the top of the page shows mandatory parameters marked with an asterisk.  Note that the parameters can be empty - you just need to include them for each hotspot.
 <code php> <code php>
Line 8: Line 10:
     "hotspots": [     "hotspots": [
         {         {
-            "id": "28",+            "id": "01",
             "anchor":{             "anchor":{
      },      },
Line 22: Line 24:
 </code> </code>
-Positioning in space+===Positioning in Space=== 
 +The code above is missing a very important part of Augmented Reality - the position.  At this point I'll briefly introduce the "GetPOIs Request" Essentially the Layar app tries to send information to your server so that you can load the right thing.  If you're familiar with web development, then these parameters are sent as GET variables.  Two parameters that are sent are the **latitude** and **longitude** (location) of the phone.   
 +Here we add 0.00003 to the latitude to move the hotspot roughly [[|3.33 metres]] north of wherever the phone is.  Note that this doesn't work for the longitude because of the Earth's shape, but more on that later. 
 +Layar supports two types of anchors - either to a geo-location (latitude and longitude), or relative to a reference image. We can also add a title in the text section so that our hotspot has a name. 
 <code php> <code php>
 <?php <?php
-$latitude = $_GET['lat'] + 0.00001;+$latitude = $_GET['lat'] + 0.00003;
 $longitude = $_GET['lon']; $longitude = $_GET['lon'];
layarmmo-poi.txt · Last modified: 2012/11/07 17:00 by matthewleach