var iconBase = 'https://developers.google.com/maps/documentation/javascript/examples/full/images/'; var data = [ { position: {lng: -66.056812, lat: 18.415312}, title: "Centro de Ayuda a Víctimas de Violación" }, { position: {lng: -66.227438, lat: 18.218187}, title: "Casa Juana Colón" }, { position: {lng: -66.265938, lat: 18.140312}, title: "Envejecer en Armonía" }, { position: {lng: -66.703438, lat: 18.265812}, title: "Fundación Alas a la Mujer" }, { position: {lng: -66.740563, lat: 18.444438}, title: "Oficina para Promoción y Desarrollo Humano" }, { position: {lng: -66.051063, lat: 18.219813}, title: "Centro Salud Justicia de Puerto Rico" }, { position: {lng: -66.051687, lat: 18.412188}, title: "Centro Comunitario LGBT" }, { position: {lng: -65.833312, lat: 18.422687}, title: "Taller Salud" }, { position: {lng: -66.075187, lat: 18.399687}, title: "Profamilias" }, { position: {lng: -66.056437, lat: 18.402188}, title: "Instituto del Hogar Celia y Harrys Bunker, Proyecto Criando para la Paz" }, { position: {lng: -66.052188, lat: 18.403937}, title: "Centro de Apoyo para Víctimas el Crimen" }, { position: {lng: -66.058062, lat: 18.427938}, title: "Oficina de la Procuradora de las Mujeres" }, { position: {lng: -66.074562, lat: 18.396437}, title: "Instituto de Deficiencias en el Desarrollo, UPR RCM" }, { position: {lng: -67.139813, lat: 18.212188}, title: "Proyecto Apoyo a Mujeres Sobrevivientes de Violencia Doméstica, Siempre Vivas, UPRM" } ]; var app = { // Application Constructor initialize: function() { document.addEventListener('deviceready', this.onDeviceReady.bind(this), false); }, // deviceready Event Handler // // Bind any cordova events here. Common events are: // 'pause', 'resume', etc. onDeviceReady: function() { this.receivedEvent('deviceready'); }, // Update DOM on a Received Event receivedEvent: function(id) { navigator.geolocation.getCurrentPosition(onMapSuccess, onMapError, { enableHighAccuracy: true }); } }; app.initialize(); // Success callback for get geo coordinates var onMapSuccess = function (position) { Latitude = position.coords.latitude; Longitude = position.coords.longitude; getMap(Latitude, Longitude); } function getMap(Latitude, Longitude){ var latLong = new google.maps.LatLng(Latitude, Longitude); var mapOptions = { center: latLong, zoom: 8, mapTypeId: google.maps.MapTypeId.ROADMAP }; //MAPA var map = new google.maps.Map(document.getElementById("map"), mapOptions); //MARKERS var contentString = '
'+ '
'+ '
'+ '

Centro de Ayuda a Víctimas de Violación

'+ '

Attribution: Uluru, '+ '(last visited June 22, 2009).

'+ '
'; var infowindow = new google.maps.InfoWindow({ content: contentString, maxWidth: 200 }); var marker = new google.maps.Marker({position: data[0]['position'], title: data[0]['title'], map: map}); marker.addListener('click', function() { infowindow.open(map, marker); }); ///////////////////////////////////////////////////////////////////////////// var contentString1 = '
'+ '
'+ '
'+ '

Casa Juana Colón

'+ '
'+ '

Attribution: Uluru, '+ 'https://en.wikipedia.org '+ '(last visited June 22, 2009).

'+ '
'; var infowindow1 = new google.maps.InfoWindow({ content: contentString1, maxWidth: 200 }); var marker1 = new google.maps.Marker({position: data[1]['position'], title: data[1]['title'],map: map}); marker1.addListener('click', function() { infowindow1.open(map, marker1); }); //////////////////////////////////////////////////////////////////////////////// var contentString2 = '
'+ '
'+ '
'+ '

Envejecer en Armonía

'+ '
'+ '

Attribution: Uluru, '+ 'https://en.wikipedia.org '+ '(last visited June 22, 2009).

'+ '
'; var infowindow2 = new google.maps.InfoWindow({ content: contentString2, maxWidth: 200 }); var marker2 = new google.maps.Marker({position: data[2]['position'], title: data[2]['title'],map: map}); marker2.addListener('click', function() { infowindow2.open(map, marker2); }); ///////////////////////////////////////////////////////////////////////////////// var contentString3 = '
'+ '
'+ '
'+ '

Fundación Alas a la Mujer

'+ '
'+ '

Attribution: Uluru, '+ 'https://en.wikipedia.org '+ '(last visited June 22, 2009).

'+ '
'; var infowindow3 = new google.maps.InfoWindow({ content: contentString3, maxWidth: 200 }); var marker3 = new google.maps.Marker({position: data[3]['position'], title: data[3]['title'],map: map}); marker3.addListener('click', function() { infowindow3.open(map, marker3); }); //////////////////////////////////////////////////////////////////////////////////// var contentString4 = '
'+ '
'+ '
'+ '

Oficina para Promoción y Desarrollo Humano

'+ '
'+ '

Attribution: Uluru, '+ 'https://en.wikipedia.org '+ '(last visited June 22, 2009).

'+ '
'; var infowindow4 = new google.maps.InfoWindow({ content: contentString4, maxWidth: 200 }); var marker4 = new google.maps.Marker({position: data[4]['position'], title: data[4]['title'],map: map}); marker4.addListener('click', function() { infowindow4.open(map, marker4); }); ////////////////////////////////////////////////////////////////////////////////// var contentString5 = '
'+ '
'+ '
'+ '

Centro Salud Justicia de Puerto Rico

'+ '
'+ '

Attribution: Uluru, '+ 'https://en.wikipedia.org '+ '(last visited June 22, 2009).

'+ '
'; var infowindow5 = new google.maps.InfoWindow({ content: contentString5, maxWidth: 200 }); var marker5 = new google.maps.Marker({position: data[5]['position'], title: data[5]['title'],map: map}); marker5.addListener('click', function() { infowindow5.open(map, marker5); }); ////////////////////////////////////////////////////////////////////////////////// var contentString6 = '
'+ '
'+ '
'+ '

Centro Comunitario LGBT

'+ '
'+ '

Attribution: Uluru, '+ 'https://en.wikipedia.org '+ '(last visited June 22, 2009).

'+ '
'; var infowindow6 = new google.maps.InfoWindow({ content: contentString6, maxWidth: 200 }); var marker6 = new google.maps.Marker({position: data[6]['position'], title: data[6]['title'],map: map}); marker6.addListener('click', function() { infowindow6.open(map, marker6); }); ////////////////////////////////////////////////////////////////////////////////// var contentString7 = '
'+ '
'+ '
'+ '

Taller Salud

'+ '
'+ '

Attribution: Uluru, '+ 'https://en.wikipedia.org '+ '(last visited June 22, 2009).

'+ '
'; var infowindow7 = new google.maps.InfoWindow({ content: contentString7, maxWidth: 200 }); var marker7 = new google.maps.Marker({position: data[7]['position'], title: data[7]['title'],map: map}); marker7.addListener('click', function() { infowindow7.open(map, marker7); }); ////////////////////////////////////////////////////////////////////////////////// var contentString8 = '
'+ '
'+ '
'+ '

Profamilias

'+ '
'+ '

Attribution: Uluru, '+ 'https://en.wikipedia.org '+ '(last visited June 22, 2009).

'+ '
'; var infowindow8 = new google.maps.InfoWindow({ content: contentString8, maxWidth: 200 }); var marker8 = new google.maps.Marker({position: data[8]['position'], title: data[8]['title'],map: map}); marker8.addListener('click', function() { infowindow8.open(map, marker8); }); ////////////////////////////////////////////////////////////////////////////////// var contentString9 = '
'+ '
'+ '
'+ '

Instituto del Hogar Celia y Harrys Bunker, Proyecto Criando para la Paz

'+ '
'+ '

Attribution: Uluru, '+ 'https://en.wikipedia.org '+ '(last visited June 22, 2009).

'+ '
'; var infowindow9 = new google.maps.InfoWindow({ content: contentString9, maxWidth: 200 }); var marker9 = new google.maps.Marker({position: data[9]['position'], title: data[9]['title'],map: map}) marker9.addListener('click', function() { infowindow9.open(map, marker9); }); ///////////////////////////////////////////////////////////////////////////////////// var contentString10 = '
'+ '
'+ '
'+ '

Centro de Apoyo para Víctimas el Crimen

'+ '
'+ '

Attribution: Uluru, '+ 'https://en.wikipedia.org '+ '(last visited June 22, 2009).

'+ '
'; var infowindow10 = new google.maps.InfoWindow({ content: contentString10, maxWidth: 200 }); var marker10 = new google.maps.Marker({position: data[10]['position'], title: data[10]['title'],map: map}) marker10.addListener('click', function() { infowindow10.open(map, marker10); }); //////////////////////////////////////////////////////////////////////////////////////// var contentString11 = '
'+ '
'+ '
'+ '

Oficina de la Procuradora de las Mujeres

'+ '
'+ '

Attribution: Uluru, '+ 'https://en.wikipedia.org '+ '(last visited June 22, 2009).

'+ '
'; var infowindow11 = new google.maps.InfoWindow({ content: contentString11, maxWidth: 200 }); var marker11 = new google.maps.Marker({position: data[11]['position'], title: data[11]['title'],map: map}) marker11.addListener('click', function() { infowindow11.open(map, marker11); }); ///////////////////////////////////////////////////////////////////////////////////////////// var contentString12 = '
'+ '
'+ '
'+ '

Instituto de Deficiencias en el Desarrollo, UPR RCM

'+ '
'+ '

Attribution: Uluru, '+ 'https://en.wikipedia.org '+ '(last visited June 22, 2009).

'+ '
'; var infowindow12 = new google.maps.InfoWindow({ content: contentString12, maxWidth: 200 }); var marker12 = new google.maps.Marker({position: data[12]['position'], title: data[12]['title'],map: map}) marker12.addListener('click', function() { infowindow12.open(map, marker12); }); ////////////////////////////////////////////////////////////////////////////////////////////// var contentString13 = '
'+ '
'+ '
'+ '

Proyecto Apoyo a Mujeres Sobrevivientes de Violencia Doméstica, Siempre Vivas, UPRM

'+ '
'+ '

Attribution: Uluru, '+ 'https://en.wikipedia.org '+ '(last visited June 22, 2009).

'+ '
'; var infowindow13 = new google.maps.InfoWindow({ content: contentString13 }); var marker13 = new google.maps.Marker({position: data[13]['position'], title: data[13]['title'],map: map}) marker13.addListener('click', function() { infowindow13.open(map, marker13); }); } // Error callback function onMapError(error) { console.log('code: ' + error.code + '\n' + 'message: ' + error.message + '\n'); }