newbmap
修訂 | 1e243710b79f8616b16492eff9628339f6d2bf02 (tree) |
---|---|
時間 | 2012-04-10 21:54:17 |
作者 | unknown <hirom@hiro...> |
Commiter | unknown |
do code cleaning
@@ -14,13 +14,21 @@ function docReady() { | ||
14 | 14 | subDistances = new Array(); |
15 | 15 | } |
16 | 16 | |
17 | +function loadMap() { | |
18 | + map = new Bing.Map($('#map_body')[0], { | |
19 | + credentials: mapCredential, | |
20 | + center: new Bing.Location(35.69, 139.7), | |
21 | + zoom: 12, | |
22 | + mapTypeId:Microsoft.Maps.MapTypeId.road | |
23 | + }); | |
24 | +} | |
25 | + | |
17 | 26 | function mapOnMouseDown(e) { |
18 | 27 | mouseDownLocation = new Bing.Point(e.pageX, e.pageY); |
19 | 28 | } |
20 | 29 | |
21 | 30 | function mapOnMouseUp(e) { |
22 | 31 | var pixel = new Bing.Point(e.pageX, e.pageY); |
23 | - // Only add a pushpin if the user is not panning the map. | |
24 | 32 | if (mouseDownLocation != null |
25 | 33 | && mouseDownLocation.x == pixel.x |
26 | 34 | && mouseDownLocation.y == pixel.y) { |
@@ -73,15 +81,6 @@ function calcDistance(Loc1, Loc2) { | ||
73 | 81 | return dist; |
74 | 82 | } |
75 | 83 | |
76 | -function loadMap() { | |
77 | - map = new Bing.Map($('#map_body')[0], { | |
78 | - credentials: mapCredential, | |
79 | - center: new Bing.Location(35.69, 139.7), | |
80 | - zoom: 12, | |
81 | - mapTypeId:Microsoft.Maps.MapTypeId.road | |
82 | - }); | |
83 | -} | |
84 | - | |
85 | 84 | function doSearch() { |
86 | 85 | map.getCredentials(callSearchService); |
87 | 86 | return false; |
@@ -12,7 +12,7 @@ exports.published = function(req, res){ | ||
12 | 12 | pub_id = pub_id.replace("/", ""); |
13 | 13 | |
14 | 14 | res.render('published', { |
15 | - title: 'Express', | |
15 | + title: 'newb map: #' + pub_id, | |
16 | 16 | pub_id: pub_id |
17 | 17 | }) |
18 | 18 | }; |
@@ -21,6 +21,11 @@ exports.loadpins = function(req, res){ | ||
21 | 21 | // load data from windows azure storage |
22 | 22 | var pub_id = req.body.pub_id; |
23 | 23 | var azure = require('azure'); |
24 | +// var account = ""; | |
25 | +// var access_key = ""; | |
26 | +// var host = ""; | |
27 | + | |
28 | +// var client = azure.createTableService(account, access_key, host); | |
24 | 29 | var client = azure.createTableService(); |
25 | 30 | var tablename = "newbmap"; |
26 | 31 |
@@ -53,7 +58,13 @@ exports.publish = function(req, res){ | ||
53 | 58 | |
54 | 59 | // save data to windows azure storage |
55 | 60 | var azure = require('azure'); |
61 | +// var account = ""; | |
62 | +// var access_key = ""; | |
63 | +// var host = ""; | |
64 | + | |
65 | +// var client = azure.createTableService(account, access_key, host); | |
56 | 66 | var client = azure.createTableService(); |
67 | + | |
57 | 68 | var tablename = "newbmap"; |
58 | 69 | for (var i = 0; i < req.body.locations.length; i++) { |
59 | 70 | var item = { |
@@ -9,7 +9,7 @@ h1 | ||
9 | 9 | script(src='http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0') |
10 | 10 | #map_box |
11 | 11 | #map_body |
12 | - script(src='type=text/javascript', src='/javascripts/index.js') | |
12 | + script(src='/javascripts/index.js') | |
13 | 13 | #total_distance |
14 | 14 | span total distance: |
15 | 15 | span#total_result 0 |
@@ -25,5 +25,3 @@ h1 | ||
25 | 25 | th longtitude |
26 | 26 | th distance (km) |
27 | 27 | tbody |
28 | - | |
29 | - |
@@ -9,8 +9,8 @@ h1 | ||
9 | 9 | script(src='http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0') |
10 | 10 | #map_box |
11 | 11 | #map_body |
12 | - script(type='text/javascript', src='/javascripts/published.js') | |
13 | - script(type='text/javascript') | |
12 | + script(src='/javascripts/published.js') | |
13 | + script | |
14 | 14 | var pub_id = "#{pub_id}"; |
15 | 15 | #total_distance |
16 | 16 | span total distance: |