ADD keyboard shortcuts , and . (< and >) to step node by node along a way. Maintain...
[potlatch2.git] / resources / potlatch2.html
1 <html>
2
3 <!-- Potlatch 2 script -->
4
5 <head>
6 <title>Potlatch TWO</title>
7 <script type="text/javascript" src="swfobject.js"></script>
8 </head>
9
10 <body>
11
12 <div id="map" style="width:100%; height: 100%; border: 1px solid black">
13 </div>
14
15 <script>
16         function getArgs() {
17                 var args = new Object();
18                 var query = location.search.substring(1);
19                 var pairs = query.split("&");
20                 for(var i = 0; i < pairs.length; i++) {
21                         var pos = pairs[i].indexOf('=');
22                         if (pos == -1) continue;
23                         var argname = pairs[i].substring(0,pos);
24                         var value = pairs[i].substring(pos+1);
25                         args[argname] = unescape(value);
26                 }
27                 return args;
28         }
29
30     var changesaved=true;
31   
32     window.onbeforeunload=function() {
33         if (!changesaved) {
34             return 'You have unsaved changes. You need to press the Save button to save them';
35         }
36     }
37
38     function markChanged(a) { changesaved=a; } /* called from flash */
39
40         var args = getArgs();
41         var lat;
42         var lon;
43         var zoom;
44         if (args.lat && args.lon) {
45                 lat = parseFloat(args.lat);
46                 lon = parseFloat(args.lon);
47         } else {
48                 lat=51.875;
49                 lon=-1.492;
50         }
51
52         if (args.zoom) {
53                 zoom = parseInt(args.zoom);
54         } else {
55                 zoom = 16;
56         }
57
58         var fo = new SWFObject("potlatch2.swf?d="+Math.round(Math.random()*1000), "map", "100%", "100%", "9", "#FFFFFF");
59         fo.addVariable("lat",lat);
60         fo.addVariable("lon",lon);
61         fo.addVariable("zoom",zoom);
62         fo.addVariable("api","http://api06.dev.openstreetmap.org/api/0.6/");
63         fo.addVariable("policy","http://api06.dev.openstreetmap.org/api/crossdomain.xml");
64         fo.addVariable("connection","XML");
65         fo.addVariable("oauth_policy", "http://api06.dev.openstreetmap.org/oauth/crossdomain.xml");
66         fo.addVariable("oauth_request_url", "http://api06.dev.openstreetmap.org/oauth/request_token");
67         fo.addVariable("oauth_access_url", "http://api06.dev.openstreetmap.org/oauth/access_token");
68         fo.addVariable("oauth_auth_url", "http://api06.dev.openstreetmap.org/oauth/authorize");
69         fo.addVariable("oauth_consumer_key", "fiM1IoqnKJk4JCfcl63DA");
70         fo.addVariable("oauth_consumer_secret", "7fYgJK9M4vB1CvBZ6jEsPGxYK9UD1hEnI6NqTxNGs");
71         fo.addVariable("serverName", "api06 Test On Dev");
72         fo.write("map");
73
74
75 </script>
76
77 </body>
78 </html>
79