-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmapcustomizer.html
More file actions
executable file
·168 lines (140 loc) · 3.7 KB
/
mapcustomizer.html
File metadata and controls
executable file
·168 lines (140 loc) · 3.7 KB
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<!DOCTYPE html>
<html ng-app>
<head>
<title>Map Customizer - Yukiko Ishida</title>
<meta charset="utf-8">
<!-- Google maps api -->
<script type="text/javascript"
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyD9dWUuIWs1AaO_frUNzqGo7pRGtQW-Jug&libraries=places&sensor=false"
></script>
<!-- angular js -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.min.js"></script>
<!-- jquery -->
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"
></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" type="text/css" href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.3/themes/dot-luv/jquery-ui.min.css">
<!-- map features -->
<script type="text/javascript" src="mapFeatures.js"></script>
<script type="text/javascript" src="custommap.js"></script>
<style type="text/css">
html, body{
margin: 0;
padding: 0;
font-family: arial, sans-serif;
height: 100%;
width: 100%;
}
#map-canvas{
height: 100%;
width: 100%;
}
#control-panel{
width: 400px;
height: 100%;
position: absolute;
background-color: rgba(255, 255, 255, 0.8);
top: 0px;
left: 30px;
overflow: hidden;
}
.titlecard{
position: absolute;
top:0px;
height: 100px;
width: 100%;
z-index: 100;
border: 1px solid #ddd;
background-color: #ffffff;
}
.controls-spacer-top{
height: 100px;
width: 100%;
}
.controls-spacer-bottom{
height: 20px;
width: 100%;
}
.controls{
overflow: auto;
height: 100%;
padding: 0px 20px 0px 0px;
}
h1{
padding: 20px 0 0 20px;
margin: 0;
}
h4{
padding: 0 20px;
margin: 0;
}
.slider{
width: 200px;
}
.settings{
position: fixed;
top: 10%;
left: 430px;
padding: 20px;
width: 300px;
background-color: rgba(0,0,0,0.5);
border-radius: 0 5px 5px 0;
color: #ffffff;
}
.accordian .ui-widget-content {
background-image: none;
padding: 0 20px;
}
</style>
<script type="text/javascript">
$(function() {
$( ".slider" ).slider({
min: -100,
max: 100,
value: 0,
slide: function( event, ui ) {
var val = ui.value;
var styler, feature;
var styles;
//console.log('#' + event.target.id + '-label, val=' + val);
//console.log(event.target.getAttribute('styler'));
styler = event.target.getAttribute('styler');
//console.log(event.target.getAttribute('feature'));
feature = event.target.getAttribute('feature');
var temp = {};
temp[styler] = val;
styles = [{
featureType: feature,
stylers: [ temp ]
}];
// console.log(styles);
map.setOptions({'styles': styles });
// console.log('#' + feature+'-'+styler + '-label, val=' + val);
$('#' + feature+'-'+styler + '-label').text( val );
}
});
});
</script>
</head>
<body>
<div id="map-canvas"></div>
<div id="control-panel">
<div class="titlecard">
<h1>Map Customizer</h1>{{stuff}}!
<h4>by Yukiko Ishida</h4>
</div>
<div class="controls" ng-model="yourName">
<div class="controls-spacer-top"></div>
<input type="text" ng-model="stuff" placeholder="Enter a name here">
<h3>Road</h3>
<span>Saturation: </span> <span id="road-saturation-label" class="feature-label">0</span>
<div feature="road" styler="saturation" class="slider"></div>
<span>Lightness: </span> <span id="road-lightness-label" class="feature-label">0</span>
<div feature="road" styler="lightness" class="slider"></div>
<div id="accordian"></div>
<div class="controls-spacer-bottom"></div>
</div>
</div>
</body>
</html>