Repositorio del curso CCOM4030 el semestre B91 del proyecto Paz para la Mujer

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