123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415 |
- 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 = '<div id="content">'+
- '<div id="siteNotice">'+
- '</div>'+
- '<h1 id="firstHeading" class="firstHeading">Centro de Ayuda a Víctimas de Violación</h1>'+
- '<p>Attribution: Uluru, <a href="https://www.google.com/maps/dir/?api=1&origin=' + latLong + '&destination=' + data[0]['title'] + '>"'
- 'Get Directions</a> '+
- '(last visited June 22, 2009).</p>'+
- '</div>';
-
-
- 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 = '<div id="content">'+
- '<div id="siteNotice">'+
- '</div>'+
- '<h1 id="firstHeading" class="firstHeading">Casa Juana Colón</h1>'+
- '<div id="bodyContent">'+
- '<p>Attribution: Uluru, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
- 'https://en.wikipedia.org</a> '+
- '(last visited June 22, 2009).</p>'+
- '</div>';
-
- 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 = '<div id="content">'+
- '<div id="siteNotice">'+
- '</div>'+
- '<h1 id="firstHeading" class="firstHeading">Envejecer en Armonía</h1>'+
- '<div id="bodyContent">'+
- '<p>Attribution: Uluru, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
- 'https://en.wikipedia.org</a> '+
- '(last visited June 22, 2009).</p>'+
- '</div>';
-
- 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 = '<div id="content">'+
- '<div id="siteNotice">'+
- '</div>'+
- '<h1 id="firstHeading" class="firstHeading">Fundación Alas a la Mujer</h1>'+
- '<div id="bodyContent">'+
- '<p>Attribution: Uluru, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
- 'https://en.wikipedia.org</a> '+
- '(last visited June 22, 2009).</p>'+
- '</div>';
-
- 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 = '<div id="content">'+
- '<div id="siteNotice">'+
- '</div>'+
- '<h1 id="firstHeading" class="firstHeading">Oficina para Promoción y Desarrollo Humano</h1>'+
- '<div id="bodyContent">'+
- '<p>Attribution: Uluru, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
- 'https://en.wikipedia.org</a> '+
- '(last visited June 22, 2009).</p>'+
- '</div>';
-
- 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 = '<div id="content">'+
- '<div id="siteNotice">'+
- '</div>'+
- '<h1 id="firstHeading" class="firstHeading">Centro Salud Justicia de Puerto Rico</h1>'+
- '<div id="bodyContent">'+
- '<p>Attribution: Uluru, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
- 'https://en.wikipedia.org</a> '+
- '(last visited June 22, 2009).</p>'+
- '</div>';
-
- 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 = '<div id="content">'+
- '<div id="siteNotice">'+
- '</div>'+
- '<h1 id="firstHeading" class="firstHeading">Centro Comunitario LGBT</h1>'+
- '<div id="bodyContent">'+
- '<p>Attribution: Uluru, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
- 'https://en.wikipedia.org</a> '+
- '(last visited June 22, 2009).</p>'+
- '</div>';
-
- 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 = '<div id="content">'+
- '<div id="siteNotice">'+
- '</div>'+
- '<h1 id="firstHeading" class="firstHeading">Taller Salud</h1>'+
- '<div id="bodyContent">'+
- '<p>Attribution: Uluru, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
- 'https://en.wikipedia.org</a> '+
- '(last visited June 22, 2009).</p>'+
- '</div>';
-
- 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 = '<div id="content">'+
- '<div id="siteNotice">'+
- '</div>'+
- '<h1 id="firstHeading" class="firstHeading">Profamilias</h1>'+
- '<div id="bodyContent">'+
- '<p>Attribution: Uluru, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
- 'https://en.wikipedia.org</a> '+
- '(last visited June 22, 2009).</p>'+
- '</div>';
-
- 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 = '<div id="content">'+
- '<div id="siteNotice">'+
- '</div>'+
- '<h1 id="firstHeading" class="firstHeading">Instituto del Hogar Celia y Harrys Bunker, Proyecto Criando para la Paz</h1>'+
- '<div id="bodyContent">'+
- '<p>Attribution: Uluru, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
- 'https://en.wikipedia.org</a> '+
- '(last visited June 22, 2009).</p>'+
- '</div>';
-
- 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 = '<div id="content">'+
- '<div id="siteNotice">'+
- '</div>'+
- '<h1 id="firstHeading" class="firstHeading">Centro de Apoyo para Víctimas el Crimen</h1>'+
- '<div id="bodyContent">'+
- '<p>Attribution: Uluru, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
- 'https://en.wikipedia.org</a> '+
- '(last visited June 22, 2009).</p>'+
- '</div>';
-
- 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 = '<div id="content">'+
- '<div id="siteNotice">'+
- '</div>'+
- '<h1 id="firstHeading" class="firstHeading">Oficina de la Procuradora de las Mujeres</h1>'+
- '<div id="bodyContent">'+
- '<p>Attribution: Uluru, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
- 'https://en.wikipedia.org</a> '+
- '(last visited June 22, 2009).</p>'+
- '</div>';
-
- 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 = '<div id="content">'+
- '<div id="siteNotice">'+
- '</div>'+
- '<h1 id="firstHeading" class="firstHeading">Instituto de Deficiencias en el Desarrollo, UPR RCM</h1>'+
- '<div id="bodyContent">'+
- '<p>Attribution: Uluru, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
- 'https://en.wikipedia.org</a> '+
- '(last visited June 22, 2009).</p>'+
- '</div>';
-
- 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 = '<div id="content">'+
- '<div id="siteNotice">'+
- '</div>'+
- '<h1 id="firstHeading" class="firstHeading">Proyecto Apoyo a Mujeres Sobrevivientes de Violencia Doméstica, Siempre Vivas, UPRM</h1>'+
- '<div id="bodyContent">'+
- '<p>Attribution: Uluru, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
- 'https://en.wikipedia.org</a> '+
- '(last visited June 22, 2009).</p>'+
- '</div>';
-
- 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');
- }
-
|