-
Notifications
You must be signed in to change notification settings - Fork 0
/
cityexplorer.js
95 lines (88 loc) · 3.86 KB
/
cityexplorer.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
////////////////////////////////////////////////////////////
var mapCenterCoordinates = '51.521428,-0.071754';
var mapCenter = { 'center': mapCenterCoordinates };
var mapCenterMarker = { /*id:'m_1',*/ 'position': mapCenterCoordinates }
var mapZoom = 16;
$( document ).delegate("#home", "pageshow", function() {
$('#map_canvas_home').gmap(mapCenter);
$('#map_canvas_home').gmap('option', 'zoom', mapZoom);
$('#map_canvas_home').gmap('addMarker', mapCenterMarker );
});
$( document ).delegate("#route_search_results", "pageshow", function() {
$('#map_canvas_route_search_results').gmap(mapCenter);
$('#map_canvas_route_search_results').gmap('option', 'zoom', mapZoom);
$('#map_canvas_route_search_results').gmap('addMarker', mapCenterMarker );
$('#map_canvas_route_search_results').gmap('displayDirections',
{
'origin': '51.521428,-0.071754',
'destination': '51.521428,-0.071754',
'waypoints': [
{ "location": '51.522483,-0.070157' },
{ "location": 'Weavers Community Space 15 Kelsey St, London, UK E2 6HD' },
{ "location": 'Tas Firin Restaurant, 160 Bethnal Green Road, City of London, London, Greater London E2 6DG' },
{ "location": 'Elemental - Antiques, 67 Brushfield Street, City of London, London, Greater London E1 6AA' },
{ "location": '51.521849,-0.067776' }
],
'travelMode': google.maps.DirectionsTravelMode.WALKING
},
{},
function(result, status) {}
);
});
$( document ).delegate("#route_progress", "pageshow", function() {
$('#map_canvas_route_progress').gmap(mapCenter);
$('#map_canvas_route_progress').gmap('option', 'zoom', mapZoom);
$('#map_canvas_route_progress').gmap('addMarker', mapCenterMarker );
$('#map_canvas_route_progress').gmap('displayDirections',
{
'origin': '51.521428,-0.071754',
'destination': '51.521428,-0.071754',
'waypoints': [
{ "location": '51.522483,-0.070157' },
{ "location": 'Weavers Community Space 15 Kelsey St, London, UK E2 6HD' },
{ "location": 'Tas Firin Restaurant, 160 Bethnal Green Road, City of London, London, Greater London E2 6DG' },
{ "location": 'Elemental - Antiques, 67 Brushfield Street, City of London, London, Greater London E1 6AA' },
{ "location": '51.521849,-0.067776' }
],
'travelMode': google.maps.DirectionsTravelMode.WALKING
},
{},
function(result, status) {}
);
});
////////////////////////////////////////////////////////////
var prevSelection = "tab1";
$("#navbar ul li").live("click",function(){
var newSelection = $(this).children("a").attr("data-tab-class");
$("."+prevSelection).addClass("ui-screen-hidden");
$("."+newSelection).removeClass("ui-screen-hidden");
prevSelection = newSelection;
});
var prevSelectionFilter = "tab2_filter";
$("#navbar_filter ul li").live("click",function(){
var newSelection = $(this).children("a").attr("data-tab-class");
$("."+prevSelectionFilter).addClass("ui-screen-hidden");
$("."+newSelection).removeClass("ui-screen-hidden");
if(newSelection == "tab1_filter") {
$('#map_canvas_route_search_results_filtered').gmap(mapCenter);
$('#map_canvas_route_search_results_filtered').gmap('option', 'zoom', mapZoom);
$('#map_canvas_route_search_results_filtered').gmap('addMarker', mapCenterMarker );
$('#map_canvas_route_search_results_filtered').gmap('displayDirections',
{
'origin': '51.521428,-0.071754',
'destination': '51.521428,-0.071754',
'waypoints': [
{ "location": '51.522483,-0.070157' },
{ "location": 'Weavers Community Space 15 Kelsey St, London, UK E2 6HD' },
{ "location": 'Tas Firin Restaurant, 160 Bethnal Green Road, City of London, London, Greater London E2 6DG' },
{ "location": 'Elemental - Antiques, 67 Brushfield Street, City of London, London, Greater London E1 6AA' },
{ "location": '51.521849,-0.067776' }
],
'travelMode': google.maps.DirectionsTravelMode.WALKING
},
{},
function(result, status) {}
);
}
prevSelectionFilter = newSelection;
});