Permalink
Browse files

Initial commit of basic loki sample which prints current address

  • Loading branch information...
0 parents commit 3baec1053227571b2deeaf55c0648ef48a213944 @nesquena committed Apr 17, 2009
Showing with 40 additions and 0 deletions.
  1. +11 −0 index.html
  2. +11 −0 loki.js
  3. +18 −0 prototype.js
@@ -0,0 +1,11 @@
+<html>
+ <head>
+ <title>Loki Location Testing</title>
+ <script type="text/javascript" src="prototype.js"></script>
+ <script type="text/javascript" src="http://loki.com/plugin/files/loki.js"></script>
+ <script type="text/javascript" src="loki.js"></script>
+ </head>
+ <body>
+ <div id="address"></div>
+ </body>
+</html>
11 loki.js
@@ -0,0 +1,11 @@
+document.observe('dom:loaded', function(){
+ var loki = new LokiAPI();
+ loki.onSuccess = function(location) {
+ $('address').update(location.house_number+' '+location.street+'<br/>'+location.city+', '+location.region_code+' '+location.postal_code+'<br/>'+location.latitude+', '+location.longitude);
+ };
+ loki.onFailure = function(error, msg){
+ alert('An error has been encountered ('+error+'). '+msg);
+ };
+ loki.setKey('beta');
+ loki.requestLocation(true,loki.FULL_STREET_ADDRESS_LOOKUP);
+});

Large diffs are not rendered by default.

Oops, something went wrong.

0 comments on commit 3baec10

Please sign in to comment.