|
@@ -0,0 +1,415 @@
|
|
1
|
+var iconBase = 'https://developers.google.com/maps/documentation/javascript/examples/full/images/';
|
|
2
|
+
|
|
3
|
+var data = [
|
|
4
|
+ {
|
|
5
|
+ position: {lng: -66.056812, lat: 18.415312},
|
|
6
|
+ title: "Centro de Ayuda a Víctimas de Violación"
|
|
7
|
+ },
|
|
8
|
+ {
|
|
9
|
+ position: {lng: -66.227438, lat: 18.218187},
|
|
10
|
+ title: "Casa Juana Colón"
|
|
11
|
+ },
|
|
12
|
+ {
|
|
13
|
+ position: {lng: -66.265938, lat: 18.140312},
|
|
14
|
+ title: "Envejecer en Armonía"
|
|
15
|
+ },
|
|
16
|
+ {
|
|
17
|
+ position: {lng: -66.703438, lat: 18.265812},
|
|
18
|
+ title: "Fundación Alas a la Mujer"
|
|
19
|
+ },
|
|
20
|
+ {
|
|
21
|
+ position: {lng: -66.740563, lat: 18.444438},
|
|
22
|
+ title: "Oficina para Promoción y Desarrollo Humano"
|
|
23
|
+ },
|
|
24
|
+ {
|
|
25
|
+ position: {lng: -66.051063, lat: 18.219813},
|
|
26
|
+ title: "Centro Salud Justicia de Puerto Rico"
|
|
27
|
+ },
|
|
28
|
+ {
|
|
29
|
+ position: {lng: -66.051687, lat: 18.412188},
|
|
30
|
+ title: "Centro Comunitario LGBT"
|
|
31
|
+ },
|
|
32
|
+ {
|
|
33
|
+ position: {lng: -65.833312, lat: 18.422687},
|
|
34
|
+ title: "Taller Salud"
|
|
35
|
+ },
|
|
36
|
+ {
|
|
37
|
+ position: {lng: -66.075187, lat: 18.399687},
|
|
38
|
+ title: "Profamilias"
|
|
39
|
+ },
|
|
40
|
+ {
|
|
41
|
+ position: {lng: -66.056437, lat: 18.402188},
|
|
42
|
+ title: "Instituto del Hogar Celia y Harrys Bunker, Proyecto Criando para la Paz"
|
|
43
|
+ },
|
|
44
|
+ {
|
|
45
|
+ position: {lng: -66.052188, lat: 18.403937},
|
|
46
|
+ title: "Centro de Apoyo para Víctimas el Crimen"
|
|
47
|
+ },
|
|
48
|
+ {
|
|
49
|
+ position: {lng: -66.058062, lat: 18.427938},
|
|
50
|
+ title: "Oficina de la Procuradora de las Mujeres"
|
|
51
|
+ },
|
|
52
|
+ {
|
|
53
|
+ position: {lng: -66.074562, lat: 18.396437},
|
|
54
|
+ title: "Instituto de Deficiencias en el Desarrollo, UPR RCM"
|
|
55
|
+ },
|
|
56
|
+ {
|
|
57
|
+ position: {lng: -67.139813, lat: 18.212188},
|
|
58
|
+ title: "Proyecto Apoyo a Mujeres Sobrevivientes de Violencia Doméstica, Siempre Vivas, UPRM"
|
|
59
|
+ }
|
|
60
|
+
|
|
61
|
+];
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+ var app = {
|
|
65
|
+ // Application Constructor
|
|
66
|
+ initialize: function() {
|
|
67
|
+ document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
|
|
68
|
+ },
|
|
69
|
+
|
|
70
|
+ // deviceready Event Handler
|
|
71
|
+ //
|
|
72
|
+ // Bind any cordova events here. Common events are:
|
|
73
|
+ // 'pause', 'resume', etc.
|
|
74
|
+ onDeviceReady: function() {
|
|
75
|
+ this.receivedEvent('deviceready');
|
|
76
|
+ },
|
|
77
|
+
|
|
78
|
+ // Update DOM on a Received Event
|
|
79
|
+ receivedEvent: function(id) {
|
|
80
|
+ navigator.geolocation.getCurrentPosition(onMapSuccess, onMapError, { enableHighAccuracy: true });
|
|
81
|
+
|
|
82
|
+ }
|
|
83
|
+
|
|
84
|
+ };
|
|
85
|
+
|
|
86
|
+ app.initialize();
|
|
87
|
+
|
|
88
|
+ // Success callback for get geo coordinates
|
|
89
|
+
|
|
90
|
+ var onMapSuccess = function (position) {
|
|
91
|
+
|
|
92
|
+ Latitude = position.coords.latitude;
|
|
93
|
+ Longitude = position.coords.longitude;
|
|
94
|
+
|
|
95
|
+ getMap(Latitude, Longitude);
|
|
96
|
+
|
|
97
|
+ }
|
|
98
|
+
|
|
99
|
+ function getMap(Latitude, Longitude){
|
|
100
|
+ var latLong = new google.maps.LatLng(Latitude, Longitude);
|
|
101
|
+
|
|
102
|
+ var mapOptions = {
|
|
103
|
+ center: latLong,
|
|
104
|
+ zoom: 8,
|
|
105
|
+ mapTypeId: google.maps.MapTypeId.ROADMAP
|
|
106
|
+ };
|
|
107
|
+ //MAPA
|
|
108
|
+ var map = new google.maps.Map(document.getElementById("map"), mapOptions);
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+ //MARKERS
|
|
112
|
+ var contentString = '<div id="content">'+
|
|
113
|
+ '<div id="siteNotice">'+
|
|
114
|
+ '</div>'+
|
|
115
|
+ '<h1 id="firstHeading" class="firstHeading">Centro de Ayuda a Víctimas de Violación</h1>'+
|
|
116
|
+ '<p>Attribution: Uluru, <a href="https://www.google.com/maps/dir/?api=1&origin=' + latLong + '&destination=' + data[0]['title'] + '>"'
|
|
117
|
+ 'Get Directions</a> '+
|
|
118
|
+ '(last visited June 22, 2009).</p>'+
|
|
119
|
+ '</div>';
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+ var infowindow = new google.maps.InfoWindow({
|
|
123
|
+ content: contentString,
|
|
124
|
+ maxWidth: 200
|
|
125
|
+ });
|
|
126
|
+
|
|
127
|
+ var marker = new google.maps.Marker({position: data[0]['position'], title: data[0]['title'], map: map});
|
|
128
|
+ marker.addListener('click', function() {
|
|
129
|
+ infowindow.open(map, marker);
|
|
130
|
+ });
|
|
131
|
+
|
|
132
|
+ /////////////////////////////////////////////////////////////////////////////
|
|
133
|
+
|
|
134
|
+ var contentString1 = '<div id="content">'+
|
|
135
|
+ '<div id="siteNotice">'+
|
|
136
|
+ '</div>'+
|
|
137
|
+ '<h1 id="firstHeading" class="firstHeading">Casa Juana Colón</h1>'+
|
|
138
|
+ '<div id="bodyContent">'+
|
|
139
|
+ '<p>Attribution: Uluru, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
|
|
140
|
+ 'https://en.wikipedia.org</a> '+
|
|
141
|
+ '(last visited June 22, 2009).</p>'+
|
|
142
|
+ '</div>';
|
|
143
|
+
|
|
144
|
+ var infowindow1 = new google.maps.InfoWindow({
|
|
145
|
+ content: contentString1,
|
|
146
|
+ maxWidth: 200
|
|
147
|
+ });
|
|
148
|
+
|
|
149
|
+ var marker1 = new google.maps.Marker({position: data[1]['position'], title: data[1]['title'],map: map});
|
|
150
|
+ marker1.addListener('click', function() {
|
|
151
|
+ infowindow1.open(map, marker1);
|
|
152
|
+ });
|
|
153
|
+
|
|
154
|
+ ////////////////////////////////////////////////////////////////////////////////
|
|
155
|
+
|
|
156
|
+ var contentString2 = '<div id="content">'+
|
|
157
|
+ '<div id="siteNotice">'+
|
|
158
|
+ '</div>'+
|
|
159
|
+ '<h1 id="firstHeading" class="firstHeading">Envejecer en Armonía</h1>'+
|
|
160
|
+ '<div id="bodyContent">'+
|
|
161
|
+ '<p>Attribution: Uluru, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
|
|
162
|
+ 'https://en.wikipedia.org</a> '+
|
|
163
|
+ '(last visited June 22, 2009).</p>'+
|
|
164
|
+ '</div>';
|
|
165
|
+
|
|
166
|
+ var infowindow2 = new google.maps.InfoWindow({
|
|
167
|
+ content: contentString2,
|
|
168
|
+ maxWidth: 200
|
|
169
|
+ });
|
|
170
|
+
|
|
171
|
+ var marker2 = new google.maps.Marker({position: data[2]['position'], title: data[2]['title'],map: map});
|
|
172
|
+ marker2.addListener('click', function() {
|
|
173
|
+ infowindow2.open(map, marker2);
|
|
174
|
+ });
|
|
175
|
+
|
|
176
|
+ /////////////////////////////////////////////////////////////////////////////////
|
|
177
|
+ var contentString3 = '<div id="content">'+
|
|
178
|
+ '<div id="siteNotice">'+
|
|
179
|
+ '</div>'+
|
|
180
|
+ '<h1 id="firstHeading" class="firstHeading">Fundación Alas a la Mujer</h1>'+
|
|
181
|
+ '<div id="bodyContent">'+
|
|
182
|
+ '<p>Attribution: Uluru, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
|
|
183
|
+ 'https://en.wikipedia.org</a> '+
|
|
184
|
+ '(last visited June 22, 2009).</p>'+
|
|
185
|
+ '</div>';
|
|
186
|
+
|
|
187
|
+ var infowindow3 = new google.maps.InfoWindow({
|
|
188
|
+ content: contentString3,
|
|
189
|
+ maxWidth: 200
|
|
190
|
+ });
|
|
191
|
+
|
|
192
|
+ var marker3 = new google.maps.Marker({position: data[3]['position'], title: data[3]['title'],map: map});
|
|
193
|
+ marker3.addListener('click', function() {
|
|
194
|
+ infowindow3.open(map, marker3);
|
|
195
|
+ });
|
|
196
|
+
|
|
197
|
+ ////////////////////////////////////////////////////////////////////////////////////
|
|
198
|
+ var contentString4 = '<div id="content">'+
|
|
199
|
+ '<div id="siteNotice">'+
|
|
200
|
+ '</div>'+
|
|
201
|
+ '<h1 id="firstHeading" class="firstHeading">Oficina para Promoción y Desarrollo Humano</h1>'+
|
|
202
|
+ '<div id="bodyContent">'+
|
|
203
|
+ '<p>Attribution: Uluru, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
|
|
204
|
+ 'https://en.wikipedia.org</a> '+
|
|
205
|
+ '(last visited June 22, 2009).</p>'+
|
|
206
|
+ '</div>';
|
|
207
|
+
|
|
208
|
+ var infowindow4 = new google.maps.InfoWindow({
|
|
209
|
+ content: contentString4,
|
|
210
|
+ maxWidth: 200
|
|
211
|
+ });
|
|
212
|
+
|
|
213
|
+ var marker4 = new google.maps.Marker({position: data[4]['position'], title: data[4]['title'],map: map});
|
|
214
|
+ marker4.addListener('click', function() {
|
|
215
|
+ infowindow4.open(map, marker4);
|
|
216
|
+ });
|
|
217
|
+
|
|
218
|
+ //////////////////////////////////////////////////////////////////////////////////
|
|
219
|
+ var contentString5 = '<div id="content">'+
|
|
220
|
+ '<div id="siteNotice">'+
|
|
221
|
+ '</div>'+
|
|
222
|
+ '<h1 id="firstHeading" class="firstHeading">Centro Salud Justicia de Puerto Rico</h1>'+
|
|
223
|
+ '<div id="bodyContent">'+
|
|
224
|
+ '<p>Attribution: Uluru, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
|
|
225
|
+ 'https://en.wikipedia.org</a> '+
|
|
226
|
+ '(last visited June 22, 2009).</p>'+
|
|
227
|
+ '</div>';
|
|
228
|
+
|
|
229
|
+ var infowindow5 = new google.maps.InfoWindow({
|
|
230
|
+ content: contentString5,
|
|
231
|
+ maxWidth: 200
|
|
232
|
+ });
|
|
233
|
+
|
|
234
|
+ var marker5 = new google.maps.Marker({position: data[5]['position'], title: data[5]['title'],map: map});
|
|
235
|
+ marker5.addListener('click', function() {
|
|
236
|
+ infowindow5.open(map, marker5);
|
|
237
|
+ });
|
|
238
|
+ //////////////////////////////////////////////////////////////////////////////////
|
|
239
|
+ var contentString6 = '<div id="content">'+
|
|
240
|
+ '<div id="siteNotice">'+
|
|
241
|
+ '</div>'+
|
|
242
|
+ '<h1 id="firstHeading" class="firstHeading">Centro Comunitario LGBT</h1>'+
|
|
243
|
+ '<div id="bodyContent">'+
|
|
244
|
+ '<p>Attribution: Uluru, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
|
|
245
|
+ 'https://en.wikipedia.org</a> '+
|
|
246
|
+ '(last visited June 22, 2009).</p>'+
|
|
247
|
+ '</div>';
|
|
248
|
+
|
|
249
|
+ var infowindow6 = new google.maps.InfoWindow({
|
|
250
|
+ content: contentString6,
|
|
251
|
+ maxWidth: 200
|
|
252
|
+ });
|
|
253
|
+ var marker6 = new google.maps.Marker({position: data[6]['position'], title: data[6]['title'],map: map});
|
|
254
|
+ marker6.addListener('click', function() {
|
|
255
|
+ infowindow6.open(map, marker6);
|
|
256
|
+ });
|
|
257
|
+ //////////////////////////////////////////////////////////////////////////////////
|
|
258
|
+ var contentString7 = '<div id="content">'+
|
|
259
|
+ '<div id="siteNotice">'+
|
|
260
|
+ '</div>'+
|
|
261
|
+ '<h1 id="firstHeading" class="firstHeading">Taller Salud</h1>'+
|
|
262
|
+ '<div id="bodyContent">'+
|
|
263
|
+ '<p>Attribution: Uluru, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
|
|
264
|
+ 'https://en.wikipedia.org</a> '+
|
|
265
|
+ '(last visited June 22, 2009).</p>'+
|
|
266
|
+ '</div>';
|
|
267
|
+
|
|
268
|
+ var infowindow7 = new google.maps.InfoWindow({
|
|
269
|
+ content: contentString7,
|
|
270
|
+ maxWidth: 200
|
|
271
|
+ });
|
|
272
|
+
|
|
273
|
+ var marker7 = new google.maps.Marker({position: data[7]['position'], title: data[7]['title'],map: map});
|
|
274
|
+ marker7.addListener('click', function() {
|
|
275
|
+ infowindow7.open(map, marker7);
|
|
276
|
+ });
|
|
277
|
+ //////////////////////////////////////////////////////////////////////////////////
|
|
278
|
+
|
|
279
|
+ var contentString8 = '<div id="content">'+
|
|
280
|
+ '<div id="siteNotice">'+
|
|
281
|
+ '</div>'+
|
|
282
|
+ '<h1 id="firstHeading" class="firstHeading">Profamilias</h1>'+
|
|
283
|
+ '<div id="bodyContent">'+
|
|
284
|
+ '<p>Attribution: Uluru, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
|
|
285
|
+ 'https://en.wikipedia.org</a> '+
|
|
286
|
+ '(last visited June 22, 2009).</p>'+
|
|
287
|
+ '</div>';
|
|
288
|
+
|
|
289
|
+ var infowindow8 = new google.maps.InfoWindow({
|
|
290
|
+ content: contentString8,
|
|
291
|
+ maxWidth: 200
|
|
292
|
+ });
|
|
293
|
+
|
|
294
|
+ var marker8 = new google.maps.Marker({position: data[8]['position'], title: data[8]['title'],map: map});
|
|
295
|
+ marker8.addListener('click', function() {
|
|
296
|
+ infowindow8.open(map, marker8);
|
|
297
|
+ });
|
|
298
|
+ //////////////////////////////////////////////////////////////////////////////////
|
|
299
|
+ var contentString9 = '<div id="content">'+
|
|
300
|
+ '<div id="siteNotice">'+
|
|
301
|
+ '</div>'+
|
|
302
|
+ '<h1 id="firstHeading" class="firstHeading">Instituto del Hogar Celia y Harrys Bunker, Proyecto Criando para la Paz</h1>'+
|
|
303
|
+ '<div id="bodyContent">'+
|
|
304
|
+ '<p>Attribution: Uluru, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
|
|
305
|
+ 'https://en.wikipedia.org</a> '+
|
|
306
|
+ '(last visited June 22, 2009).</p>'+
|
|
307
|
+ '</div>';
|
|
308
|
+
|
|
309
|
+ var infowindow9 = new google.maps.InfoWindow({
|
|
310
|
+ content: contentString9,
|
|
311
|
+ maxWidth: 200
|
|
312
|
+ });
|
|
313
|
+
|
|
314
|
+ var marker9 = new google.maps.Marker({position: data[9]['position'], title: data[9]['title'],map: map})
|
|
315
|
+ marker9.addListener('click', function() {
|
|
316
|
+ infowindow9.open(map, marker9);
|
|
317
|
+ });
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+ /////////////////////////////////////////////////////////////////////////////////////
|
|
321
|
+ var contentString10 = '<div id="content">'+
|
|
322
|
+ '<div id="siteNotice">'+
|
|
323
|
+ '</div>'+
|
|
324
|
+ '<h1 id="firstHeading" class="firstHeading">Centro de Apoyo para Víctimas el Crimen</h1>'+
|
|
325
|
+ '<div id="bodyContent">'+
|
|
326
|
+ '<p>Attribution: Uluru, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
|
|
327
|
+ 'https://en.wikipedia.org</a> '+
|
|
328
|
+ '(last visited June 22, 2009).</p>'+
|
|
329
|
+ '</div>';
|
|
330
|
+
|
|
331
|
+ var infowindow10 = new google.maps.InfoWindow({
|
|
332
|
+ content: contentString10,
|
|
333
|
+ maxWidth: 200
|
|
334
|
+ });
|
|
335
|
+
|
|
336
|
+ var marker10 = new google.maps.Marker({position: data[10]['position'], title: data[10]['title'],map: map})
|
|
337
|
+ marker10.addListener('click', function() {
|
|
338
|
+ infowindow10.open(map, marker10);
|
|
339
|
+ });
|
|
340
|
+
|
|
341
|
+ ////////////////////////////////////////////////////////////////////////////////////////
|
|
342
|
+ var contentString11 = '<div id="content">'+
|
|
343
|
+ '<div id="siteNotice">'+
|
|
344
|
+ '</div>'+
|
|
345
|
+ '<h1 id="firstHeading" class="firstHeading">Oficina de la Procuradora de las Mujeres</h1>'+
|
|
346
|
+ '<div id="bodyContent">'+
|
|
347
|
+ '<p>Attribution: Uluru, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
|
|
348
|
+ 'https://en.wikipedia.org</a> '+
|
|
349
|
+ '(last visited June 22, 2009).</p>'+
|
|
350
|
+ '</div>';
|
|
351
|
+
|
|
352
|
+ var infowindow11 = new google.maps.InfoWindow({
|
|
353
|
+ content: contentString11,
|
|
354
|
+ maxWidth: 200
|
|
355
|
+ });
|
|
356
|
+
|
|
357
|
+ var marker11 = new google.maps.Marker({position: data[11]['position'], title: data[11]['title'],map: map})
|
|
358
|
+ marker11.addListener('click', function() {
|
|
359
|
+ infowindow11.open(map, marker11);
|
|
360
|
+ });
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+ /////////////////////////////////////////////////////////////////////////////////////////////
|
|
365
|
+
|
|
366
|
+ var contentString12 = '<div id="content">'+
|
|
367
|
+ '<div id="siteNotice">'+
|
|
368
|
+ '</div>'+
|
|
369
|
+ '<h1 id="firstHeading" class="firstHeading">Instituto de Deficiencias en el Desarrollo, UPR RCM</h1>'+
|
|
370
|
+ '<div id="bodyContent">'+
|
|
371
|
+ '<p>Attribution: Uluru, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
|
|
372
|
+ 'https://en.wikipedia.org</a> '+
|
|
373
|
+ '(last visited June 22, 2009).</p>'+
|
|
374
|
+ '</div>';
|
|
375
|
+
|
|
376
|
+ var infowindow12 = new google.maps.InfoWindow({
|
|
377
|
+ content: contentString12,
|
|
378
|
+ maxWidth: 200
|
|
379
|
+ });
|
|
380
|
+
|
|
381
|
+ var marker12 = new google.maps.Marker({position: data[12]['position'], title: data[12]['title'],map: map})
|
|
382
|
+ marker12.addListener('click', function() {
|
|
383
|
+ infowindow12.open(map, marker12);
|
|
384
|
+ });
|
|
385
|
+
|
|
386
|
+ //////////////////////////////////////////////////////////////////////////////////////////////
|
|
387
|
+
|
|
388
|
+ var contentString13 = '<div id="content">'+
|
|
389
|
+ '<div id="siteNotice">'+
|
|
390
|
+ '</div>'+
|
|
391
|
+ '<h1 id="firstHeading" class="firstHeading">Proyecto Apoyo a Mujeres Sobrevivientes de Violencia Doméstica, Siempre Vivas, UPRM</h1>'+
|
|
392
|
+ '<div id="bodyContent">'+
|
|
393
|
+ '<p>Attribution: Uluru, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
|
|
394
|
+ 'https://en.wikipedia.org</a> '+
|
|
395
|
+ '(last visited June 22, 2009).</p>'+
|
|
396
|
+ '</div>';
|
|
397
|
+
|
|
398
|
+ var infowindow13 = new google.maps.InfoWindow({
|
|
399
|
+ content: contentString13
|
|
400
|
+
|
|
401
|
+ });
|
|
402
|
+
|
|
403
|
+ var marker13 = new google.maps.Marker({position: data[13]['position'], title: data[13]['title'],map: map})
|
|
404
|
+ marker13.addListener('click', function() {
|
|
405
|
+ infowindow13.open(map, marker13);
|
|
406
|
+ });
|
|
407
|
+ }
|
|
408
|
+
|
|
409
|
+ // Error callback
|
|
410
|
+
|
|
411
|
+ function onMapError(error) {
|
|
412
|
+ console.log('code: ' + error.code + '\n' +
|
|
413
|
+ 'message: ' + error.message + '\n');
|
|
414
|
+ }
|
|
415
|
+
|