forked from angular-ui/angular-google-maps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.html
300 lines (279 loc) · 13.7 KB
/
example.html
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
<!DOCTYPE html>
<html xmlns:ng="http://angularjs.org" id='ng-app' ng-app="angular-google-maps-example">
<head>
<meta charset="UTF-8">
<title>angular-google-maps example page</title>
<!-- See https://rawgithub.com/ as it returns the correct mimetypes that are requested from github.-->
<!-- make IE Happy , http://docs.angularjs.org/guide/ie -->
<!--[if lte IE 9]>
<script>
window.html5 = {
'elements': 'marker window windows markers trafficlayer polyline marker-label ng-controller ng-repeat ng-init ng-model'
};
</script>
<script src="https://rawgithub.com/bestiejs/json3/v3.2.5a/lib/json3.min.js"></script>
<script src="https://rawgithub.com/kriskowal/es5-shim/v2.1.0/es5-shim.min.js"></script>
<script src="https://rawgithub.com/jwmcpeak/EventShim/master/eventShim.js"></script>
<script src="https://rawgithub.com/aFarkas/html5shiv/3.7.0/src/html5shiv.js"></script>
<![endif]-->
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"
type="text/css">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,800,600,300,700'
rel='stylesheet' type='text/css'>
<link href="example.css" rel="stylesheet" type="text/css">
</head>
<body ng-controller="ExampleController">
<!-- You can use either a div having class 'google-map' or the '<google-map>' element; in
the latter case, uncomment the style above to make sure the custom elements gets block display -->
<div class="page-title affix">
<h1>angular-google-maps example</h1>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span7">
<div class="google-map affix span7"
center="map.center"
zoom="map.zoom"
draggable="true"
dragging="map.dragging"
bounds="map.bounds"
events="map.events"
options="map.options">
<layer type="TrafficLayer" show="map.showTraffic"></layer>
<layer type="BicyclingLayer" show="map.showBicycling"></layer>
<layer namespace="weather" type="WeatherLayer" show="map.showWeather"></layer>
<marker coords="searchLocation"/>
<markers models="map.randomMarkers" coords="'self'" icon="'icon'" click="'onClicked'"
doCluster="map.doClusterRandomMarkers" clusterOptions="map.clusterOptions">
</markers>
<markers models="map.markers2" coords="'self'" icon="'icon'" click="'onClicked'"
labelContent="'title'" labelAnchor="22 0" labelClass="marker-labels">
<windows show="'showWindow'" closeClick="'closeClick'">
<p ng-non-bindable>This is an info window at {{ latitude | number:4 }}, {{ longitude | number:4 }}!</p>
<p class="muted">My marker will stay open when the window is popped up!</p>
</windows>
</markers>
<markers models="map.dynamicMarkers" coords="'self'" icon="'icon'" click="'onClicked'" fit='true'>
<windows show="'showWindow'" closeClick="'closeClick'">
<p>Dynamic Marker created via a delay!</p>
<p ng-non-bindable>This is an info window at {{ latitude | number:4 }}, {{ longitude | number:4 }}!</p>
<p class="muted">My marker will stay open when the window is popped up!</p>
</windows>
</markers>
<!-- prefedined markers -->
<!-- rendering via ng-repear, HIGH OVERHEAD via DOM Manipulation -->
<marker ng-repeat="m in map.markers" coords="m" icon="m.icon" click="onMarkerClicked(m)">
<marker-label content="m.title" anchor="22 0" class="marker-labels"/>
<window show="m.showWindow" closeClick="m.closeClick()">
<p>This is an info window at {{ m.latitude | number:4 }}, {{ m.longitude | number:4 }}!</p>
<p class="muted">My marker will stay open when the window is popped up!</p>
</window>
</marker>
<!-- marker for clicked position -->
<!-- can not put google.map.animations.BOUNCE , since it is not initiaized yet -->
<div ng-init="opts = {animation:1}">
<marker coords="map.clickedMarker" options="opts">
<!--<marker-label content="map.clickedMarker.title" anchor="24 40" class="marker-labels"/>-->
<window isIconVisibleOnClick="true">This is my clicked marker!
<p class="muted">My marker will reappear when you close me.</p>
</window>
</marker>
</div>
<!--WINDOWS without markers-->
<window show="map.infoWindow.show" coords="map.infoWindow.coords" isIconVisibleOnClick="false">
I should not be attached to a
marker.
</window>
<window show="map.templatedInfoWindow.show" coords="map.templatedInfoWindow.coords"
templateUrl="map.templatedInfoWindow.templateUrl"
templateParameter="map.templatedInfoWindow.templateParameter">
</window>
<polyline ng-repeat="p in map.polylines" path="p.path" stroke="p.stroke" visible='p.visible'
geodesic='p.geodesic' fit="false" editable="p.editable" draggable="p.draggable"></polyline>
</div>
<button class="btn btn-danger pull-right" ng-click="removeMarkers()">Clear Map</button>
</div>
<div class="span5">
<fieldset>
<table class="table">
<tbody>
<tr>
<td>
<strong>Layers</strong>
</td>
<td>
Traffic: <input type="checkbox" text="TrafficLayer On/Off" ng-model="map.showTraffic">
Bicycling: <input type="checkbox" text="BicyclingLayer On/Off" ng-model="map.showBicycling">
Weather: <input type="checkbox" text="Weather On/Off" ng-model="map.showWeather">
</td>
</tr>
<tr>
<td>Generate Random Markers</td>
<td>
<div>Do Cluster?: <input type="checkbox" ng-model="map.doClusterRandomMarkers"></div>
<div>Cluster Options: <input type="text" ng-model='map.clusterOptionsText'>
<div>Use Ugly Cluster Image?: <input type="checkbox" ng-model="map.doUgly"></div>
</div>
<div ng-init="numOfMarkers = 1000">
<input type="text" text="Number of Markers" ng-model="numOfMarkers">
<button ng-click="genRandomMarkers(numOfMarkers)">Generate</button>
</div>
</td>
</tr>
<tr ng-show="map.markers.length >= 0">
<td>markers</td>
<td>
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li ng-repeat="m in map.markers" ng-click="m.showWindow = true">
<a href="#">
<i class="i" title="Click me to Show InfoWindow!">
Marker: {{m}}
</i>
</a>
</li>
</ul>
</div>
</td>
</tr>
<tr ng-show="map.markers2.length >= 0">
<td>markers2</td>
<td>
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li ng-repeat="m in map.markers2" ng-click="m.showWindow = true">
<a href="#">
<i class="i" title="Click me to Show InfoWindow!">
Marker: {{m}}
</i>
</a>
</li>
</ul>
</div>
</td>
</tr>
<tr ng-show="map.dynamicMarkers.length >= 0">
<td>dynamicMarkers</td>
<td>
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li ng-repeat="m in map.dynamicMarkers" ng-click="m.showWindow = true">
<a href="#">
<i class="i" title="Click me to Show InfoWindow!">
Marker: {{m}}
</i>
</a>
</li>
</ul>
</div>
</td>
</tr>
<tr>
<td>center</td>
<td>
<pre>
<span ng-show="map.center.latitude >= 0">
</span>
{{ map.center.latitude | number:4 }} lat
<br>
<span ng-show="map.center.longitude >= 0">
</span>{{ map.center.longitude | number:4 }} lng
</pre>
</td>
</tr>
<tr>
<td>zoom</td>
<td>{{ map.zoom }}</td>
</tr>
<tr>
<td>bounds</td>
<td>
<pre>
north-east: {{ map.bounds.northeast.latitude | number:4 }},{{ map.bounds.northeast.longitude | number:4 }}
<br>
south-west: {{ map.bounds.southwest.latitude | number:4 }},{{ map.bounds.southwest.longitude | number:4 }}
</pre>
</td>
</tr>
<tr>
<td>dragging</td>
<td>{{ map.dragging }}</td>
</tr>
<tr>
<td>clicked position</td>
<td>
<pre ng-show="map.clickedMarker.latitude != null && map.clickedMarker.longitude != null">
<span ng-show="map.clickedMarker.latitude >= 0">
</span>
{{ map.clickedMarker.latitude | number:4 }} lat
<br>
<span ng-show="map.clickedMarker.longitude >= 0"> </span>
{{ map.clickedMarker.longitude | number:4 }} lng
</pre>
<span ng-show="map.clickedMarker.latitude == null || map.clickedMarker.longitude == null">Click the map to see</span>
</td>
</tr>
<tr>
<td>polylines</td>
<td>
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li ng-repeat="p in map.polylines">
<a href="#">
<i class="i" title="Click me to Show InfoWindow!">
<span class="{{p.visible}}" ng-click="p.visible = !p.visible">Polyline:</span> {<br/>
<span style="padding-left: 5em" class="{{p.visible}}"
ng-click="p.visible = !p.visible">visible: {{p.visible}}</span>, <br/>
<span style="padding-left: 5em" class="{{p.editable}}"
ng-click="p.editable = !p.editable">editable: {{p.editable}}</span>,
<br/>
<span style="padding-left: 5em" class="{{p.draggable}}"
ng-click="p.draggable = !p.draggable">draggable: {{p.draggable}}</span>,
<br/>
<span style="padding-left: 5em" class="{{p.geodesic}}"
ng-click="p.geodesic = !p.geodesic">geodesic: {{p.geodesic}}</span>,
<br/>
<span style="padding-left: 5em">stroke: {</span> <br/>
<span ng-click="p.stroke.weight = (p.stroke.weight % 5) +1"
style="padding-left: 10em">weight: {{p.stroke.weight}}</span> <br/>
<span ng-click="p.stroke.color = toggleColor(p.stroke.color)"
style="padding-left: 10em">color: {{p.stroke.color}}</span> <br/>
<span style="padding-left: 5em">},</span> <br/>
<span style="padding-left: 5em">path: [ </span> <br/>
<span style="padding-left: 10em" class="false" ng-repeat="pt in p.path"
ng-click="p.path.splice($index,1)">
{
latitude:{{pt.latitude | number:2}},
longitude:{{pt.longitude | number:2}}
},
<br/>
</span>
<span style="padding-left: 5em">] </span> <br/>
}
</i>
</a>
</li>
</ul>
</div>
</td>
</tr>
</tbody>
</table>
</fieldset>
</div>
</div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://maps.googleapis.com/maps/api/js?libraries=weather&sensor=false&language=en&v=3.13"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.js"></script>
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<script src="http://underscorejs.org/underscore-min.js"></script>
<script src="angular-google-maps.js"></script>
<script src="example-controller.js"></script>
<script src="templates/infoController.js"></script>
<script src="http://localhost:35729/livereload.js"></script>
<script type="text/javascript">
directives.api.utils.Logger.doLog = true;
</script>
</body>
</html>