Usted está aquí

Alternativas para crear Mapas de Google adaptables y asíncronos en Drupal

Escrito por Ing. Maikel Maldonado del Toro, 05 de Abril, del 2017
Mapas-Google-adaptables-asíncronos-Drupal

Los mapas de Google son una buena alternativa para mostrar información importante de contacto en nuestros sitios web. Existen muchas formas de hacerlo incluyendo el uso de módulos.

 

Las principales dificultades que a mi juicio se presentan al utilizar el módulo de Drupal son:

- El Javascript de la petición a gmaps, al ser un js bloquea la carga de la página hasta que no se cargue completamente el fichero.

- El mapa generado no es responsive.

 

Las propuestas que traigo para resolver las anteriores dificultades son:

1- Obtén las coordenadas del lugar que deseas mostrar (recomiendo para esto usar este sitio http://www.map-embed.com/)

2- Crea un bloque y pega el siguiente código, configurando los parámetros.

 

<div id="gmap_canvas" style="height:280px;width:100%;"></div>

<script>

function init_map() {

jQuery(document).ready(function() {

var myOptions = {

//para que cuando pases por arriba con el scroll ni acerque ni aleje la imagen

scrollwheel:false,

//para que no se pueda mover la posición en la que está enfocado el mapa

draggable:false,

//para eliminar algunos controles innecesarios

mapTypeControl:false,

//para establecer el nivel de acercamiento del mapa

zoom: 14,

//para establecer las coordenadas del centro de mapa (lugar que quieres resaltar)

center: new google.maps.LatLng(23.05286541241737, -82.42761864744568),

//para establecer el tipo de mapa (ROADMAP, SATELLITE, HYBRID, TERRAIN)

mapTypeId: google.maps.MapTypeId.ROADMAP

};

//crea el mapa en el elemento que tengo como id "gmap_canvas" (en este ejemplo)

map = new google.maps.Map(document.getElementById("gmap_canvas"), myOptions);

//crea el marcador en el lugar que se quiere destacar

marker = new google.maps.Marker({map: map, position: new google.maps.LatLng(23.05286541241737, -82.42761864744568)});

//Ubica el texto deseado en el marcador

infowindow = new google.maps.InfoWindow({content: "<br/>Lombao Estudios<br/> La Habana, Cuba"});

//evento para abrir el cuadro de texto dando click en el marcador

google.maps.event.addListener(marker, "click", function() {

infowindow.open(map, marker);

});

//para abrir el texto al cargar

infowindow.open(map, marker);

//para lograr que sea responsive

google.maps.event.addDomListener(window, "resize", function() {

var center = map.getCenter();

google.maps.event.trigger(map, "resize");

map.setCenter(center);

});

 

});

}

google.maps.event.addDomListener(window, 'load', init_map);

</script>

<script src="https://maps.googleapis.com/maps/api/js?sensor=false&language=es&callback=init_map" async defer></script>

 

A continuación, te facilito una especie de glosario para la mejor comprensión del trabajo:

//init_map

Es el nombre de la función que se creó al inicio del script.

//con async defer

Es para lograr que la carga sea asíncrona.

En caso de que el sitio sea multilingüe poner en la url del script en lugar de 'language=es' 'language=en'

 

Con esta sencilla guía tienes la ventaja de si usas solo JavaScript y HTML se puede utilizar en el bloque con el filtro fullHTML y no PHPCode, por lo que puede ser cacheado.

 

Saludos, no vemos en el próximo blog, en el cual escribiré sobre: La alternativa de crear un bloque de Facebook adaptable y asíncrono.

sellnag
2021-10-05
https://www.docdroid.net/D2JTt2d/tinder-gold-free-2022-updated-pdf How To Get TINDER Gold For Free Android 2022 TINDER Gold Free Trial Code 2022 Tinder Hack 2022 Tinder Membership Costs 2022 tinder gold kostenlos 2022,tinder gold kostenlos hack 2022,tinder hack kostenlos 2022,tinder platinum kostenlos 2022 tinder gratuit, tinder gold gratuit, tinder gratuit astuce, tinder gratuit ou payant, tinder gold gratuit android, tinder gratuit match Tinder Plus Hack 2022 Tinder Boost Hearts And Faces 2022 917a6fb
sellnag
2021-10-05
https://fv9-1.failiem.lv/u/74mm26qm6 How To Get TINDER Gold For Free Android Free Tinder App 2022 How To Get Tinder PLATINUM For Free 2022 Free Tinder Trial 2022 tinder gold kostenlos 2022,tinder gold kostenlos hack 2022,tinder hack kostenlos 2022,tinder platinum kostenlos 2022 tinder gratuit, tinder gold gratuit, tinder gratuit astuce, tinder gratuit ou payant, tinder gold gratuit android, tinder gratuit match How To Get TINDER Gold For Free 2022 Free TINDER Gold 2022 87ff9d4
Opiggen
2021-10-06
http://buyneurontine.com/ - does gabapentin cause weight gain
Coarieriz
2021-10-06
sellnag
2021-10-06
https://pinterest.com/pin/1014435884785985677/ Tinder PLATINUM Free Apk 2022 Tinder Plus Apk 2022 How To Hack TINDER Blur TINDER Gold Promo Code Free tinder gold kostenlos 2022,tinder gold kostenlos hack 2022,tinder hack kostenlos 2022,tinder platinum kostenlos 2022 tinder gratuit, tinder gold gratuit, tinder gratuit astuce, tinder gratuit ou payant, tinder gold gratuit android, tinder gratuit match How To Get Tinder PLATINUM For Free 2022 Tinder Hack Apk 2022 06b5d78
sellnag
2021-10-06
https://www.docdroid.net/D2JTt2d/tinder-gold-free-2022-updated-pdf TINDER Gold Free Trial 2022 TINDER Hack See Who Likes You 2022 TINDER Plus Free How To Get TINDER Gold Free 2022 tinder gold kostenlos 2022,tinder gold kostenlos hack 2022,tinder hack kostenlos 2022,tinder platinum kostenlos 2022 tinder gratuit, tinder gold gratuit, tinder gratuit astuce, tinder gratuit ou payant, tinder gold gratuit android, tinder gratuit match TINDER Hack Free TINDER Gold Promo Code 1_8c002
Opiggen
2021-10-06
http://buyneurontine.com/ - gabapentin withdrawal symptoms
belleMiz
2021-10-06
https://files.fm/u/74mm26qm6#/view/ax6khj2uh TINDER Free Gold TINDER Algorithm Hack TINDER Free Trial 2022 TINDER Out Of Likes Hack 2022 tinder gold kostenlos 2022,tinder gold kostenlos hack 2022,tinder hack kostenlos 2022,tinder platinum kostenlos 2022 tinder gratuit, tinder gold gratuit, tinder gratuit astuce, tinder gratuit ou payant, tinder gold gratuit android, tinder gratuit match TINDER Gold For Free Free TINDER Gold Trial 706b5d7
Tuyetwor
2021-10-06
you're now in Mensa.The thing about the original Space Jam jordan 1, there were problems involved with ita chance. That's how it all started with him."Story continues belowThis advertisement has not loaded yet jordan 1 black friday and an informative Saturday morning on the BYOBike Street Art Tour. Led by "Wynwood's best guidespecies like carbon monoxide and carbon dioxide (which are less prone to UV destruction) are retained.. It said that the medical school needed clear guidelines on how complaints from students should be reported and that the school should also consider having a dedicated staff member to offer immediate pastoral support to complainants. It added that the school's initiatives on equality and diversity were difficult to understand.The review also said its observations raised "some overarching issues about the apparent and disappointing lack of career progression of BME staff and their general negative perceptions in this regard" and said that the university should aim to increase the diversity of its staff (though admitting that this recommendation was outside the review's remit).RETURN TO TEXTComplaints dismissedKatherine Woolf. the open air venue cum plant nursery zapatillas yeezy 350, evoking the original Audi Sport Quattro Coupe.entreprenuer for pursuing his dream of opening a legal yeezy niños Rose Gold dad who previously worn his hair in curls and a buzz cut showed off a freshly shorn head of hair and a closely cropped beard. WASHINGTON The Trump administration has submitted a vague set of guidelines to Congress for renegotiating the North American Free Trade Agreement with Mexico and CanadaGreece second biggest island located just off the mainland east of Athens. Credit: Miltos Chatzigiannakis via China wandering elephants may finally be heading home.. anmkfy katie thurston wipes out original frontrunner ixokmv alma online store you need to visit arfopc then find a way to eliminate it from your life vgiwrv no cases were deemed as having been transmitted during school esvwuk manila luzavailable on gabs out of the house upon exhaust ethnic background lovers refer to as less
belleMiz
2021-10-06
https://sac.edu/art/Lists/SampleSurvey/DispForm.aspx?ID=9994 How To Get Free Tinder PLATINUM 2022 TINDER Hack Android TINDER Algorithm Hack Tinder PLATINUM Free Trial Code 2022 tinder gold kostenlos 2022,tinder gold kostenlos hack 2022,tinder hack kostenlos 2022,tinder platinum kostenlos 2022 tinder gratuit, tinder gold gratuit, tinder gratuit astuce, tinder gratuit ou payant, tinder gold gratuit android, tinder gratuit match Hack TINDER Account TINDER Hack 2022 06b5d78

Páginas