+CREATE A LAYAR WITH DRUPALTutorial Edward Mac Gillavry 29th December 2010
CAVEATS    Layar module for Drupal abstracted from     homebrewed module    Only basic Layar GetPOIs-Request:        Lo...
INSTALLATION REQUIREMENTS     Drupal Core     Modules:         CCK (content, content_copy, optionwidgets, text)       ...
PREPARE Gmap MODULE    Supports (deprecated) Google Maps API v.2    Requires API key    Log in with Google account at  ...
CONFIGURE Gmap MODULE    Drupal: admin > settings > gmap    Fill in Google Maps API key in “Google Map     Initialize” ...
CONFIGURE Location MODULE     Drupal: admin > settings > location > main     Toggle location display:         Enable th...
CREATE Poi CONTENT TYPE     Drupal: admin > content > types > add     Identification:         Name: Poi         Type: ...
CREATE Poi CONTENT     Drupal: node > add > poi     Fill in:         Name         Body     Click map to add location ...
CREATE Layar VIEW (1)     Drupal: admin > build > views > add         View name: Layar         View description: Combin...
CREATE Layar VIEW (2)     Drupal: admin > build > views > edit > Layar     Select “Feed” from dropdown box     Click “A...
CREATE Layar VIEW (3)     Fields:         Location: Latitude (decimal degrees)         Location: Longitude (decimal deg...
CREATE Layar VIEW (4)     Click the gears behind “Style” in Basic settings     Feed: Style options         Layar Unique...
CREATE Layar CONTENT     Drupal: node > add > layar         Name: Pois         Layar Display View: Layar > Feed     Cl...
TEST POI URL     Open POI URL in browser      http://www.yourdomain.com/layar/1?      lang=NL&countryCode=NL&userId=93527...
SUGGESTIONS FOR 2011?     Add support for latest Layar API (version 4.0)     Allow content managers to adjust Layer-leve...
REFERENCES    Layar     http://www.layar.com    Howto: Create some basic location aware nodes     http://drupal.org/node...
Edward Mac Gillavry          edward@webmapper.net          @emacgillavry          http://drupal.org/user/682868CONTACT INF...
Upcoming SlideShare
Loading in …5
×

Create a Layar with Drupal

3,956 views

Published on

This tutorial shows how to show your Drupal content in Layar, the augmented reality browser.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,956
On SlideShare
0
From Embeds
0
Number of Embeds
93
Actions
Shares
0
Downloads
71
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Create a Layar with Drupal

  1. 1. +CREATE A LAYAR WITH DRUPALTutorial Edward Mac Gillavry 29th December 2010
  2. 2. CAVEATS  Layar module for Drupal abstracted from homebrewed module  Only basic Layar GetPOIs-Request:  Lon,Lat,Radius, layerName  Only basic Layar GetPOIs-JSON Response:  1d objects only  Appears to be on par with Layar API version 2.1
  3. 3. INSTALLATION REQUIREMENTS  Drupal Core  Modules:  CCK (content, content_copy, optionwidgets, text)  Views (views, views_ui)  Location (location, location_cck, location_node)  Gmap (gmap, gmap_location)  Layar
  4. 4. PREPARE Gmap MODULE  Supports (deprecated) Google Maps API v.2  Requires API key  Log in with Google account at http://code.google.com/apis/maps/signup.html  Fill in website URL  Click “Generate API key”  Next page provides the API key, for example: ABQIAAAAXL4B_6HzzOGB4k4meSzVJRQAUgWGYxiuj_fVy2Vtau11dGUdwh QWbsemrSoWUer_2wFVxZtOeFP6wA
  5. 5. CONFIGURE Gmap MODULE  Drupal: admin > settings > gmap  Fill in Google Maps API key in “Google Map Initialize”  Configure:  Default map settings  Map type control  Click “Save configuration”
  6. 6. CONFIGURE Location MODULE  Drupal: admin > settings > location > main  Toggle location display:  Enable the display of locations  Check “Use a Google Map to set latitude and longitude”  Click “Save configuration”  Users that are allowed to manually enter latitude/longitude coordinates will be able to do so with an interactive Google Map!
  7. 7. CREATE Poi CONTENT TYPE  Drupal: admin > content > types > add  Identification:  Name: Poi  Type: poi  Description: Point of Interest  Locative Information  Number of locations:  Minimum number of locations: 1  Maximum number of locations: 1  Number of locations that can be added at once: 1  Click “Save content type”.
  8. 8. CREATE Poi CONTENT  Drupal: node > add > poi  Fill in:  Name  Body  Click map to add location  Drag marker to adjust location  Click “Save”
  9. 9. CREATE Layar VIEW (1)  Drupal: admin > build > views > add  View name: Layar  View description: Combine POIs for Layar  View tag: layar  View type: Node  Click “Next”
  10. 10. CREATE Layar VIEW (2)  Drupal: admin > build > views > edit > Layar  Select “Feed” from dropdown box  Click “Add display”  Basic settings:  Name: Feed  Title: POI layer  Style: Layar JSON
  11. 11. CREATE Layar VIEW (3)  Fields:  Location: Latitude (decimal degrees)  Location: Longitude (decimal degrees)  Node: Title  Node: Nid  Node: Body  Filters:  Node: Published (Yes)  Node: Type (Poi)  Layar: Location latitude/longitude is within Layars requested Proximity
  12. 12. CREATE Layar VIEW (4)  Click the gears behind “Style” in Basic settings  Feed: Style options  Layar Unique ID *: node: Nid  Layar Latitude *: node: Latitude  Layar Longitude *: node: Longitude  Layar Title *: node: Title  Layar Line 2: node_revisions: Body  Feed settings:  Path: pois
  13. 13. CREATE Layar CONTENT  Drupal: node > add > layar  Name: Pois  Layar Display View: Layar > Feed  Click “Save”  Next page provides the POI URL e.g. http://www.yourdomain.com/layar/1
  14. 14. TEST POI URL  Open POI URL in browser http://www.yourdomain.com/layar/1? lang=NL&countryCode=NL&userId=93527657b34ce7f&L on=5.11034&action=refresh&Version=4.0&Lat=52.09 62453&layerName=pois&Accuracy=252&radius=250000  For explanation of parameters, check: http://layar.pbworks.com/w/page/28473504/GetPOI s-Request  Adjust Lat and Lon parameters to center search area around your POI locations  Browser returns Layar JSON-object!
  15. 15. SUGGESTIONS FOR 2011?  Add support for latest Layar API (version 4.0)  Allow content managers to adjust Layer-level JSON response elements (e.g. Actions)  Support for Geo module (to benefit from spatial database capabilities) http://drupal.org.project/geo/  Investigate REST Server and Services modules as alternatives http://drupal.org/project/rest_server http://drupal.org/project/services
  16. 16. REFERENCES  Layar http://www.layar.com  Howto: Create some basic location aware nodes http://drupal.org/node/817592  Layar module http://www.drupal.org/project/layar  Explanation from module maintainer http://drupal.org/node/950944#comment-3619706
  17. 17. Edward Mac Gillavry edward@webmapper.net @emacgillavry http://drupal.org/user/682868CONTACT INFORMATION www.webmapper.net

×