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.

AbermotLew
2020-07-03
watergrasshill elite matchmaking [url=https://brighten-up.uk/dating-profiles-newcastle-west.html]dating profiles newcastle west[/url] dating sites foxrock [url=https://brighten-up.uk/gorey-hookup-now.html]gorey hookup now[/url] city dating near portlaoise [url=https://brighten-up.uk/free-hookup-site-near-kilkenny.html]free hookup site near kilkenny[/url] best matchmaking services in mitchelstown ireland [url=https://brighten-up.uk/tuam-senior-speed-dating.html]tuam senior speed dating[/url] christian singles dating in rathmines ireland [url=https://brighten-up.uk/dundrum-area-dating.html]dundrum area dating[/url] casual hookup loch garman ireland [url=https://brighten-up.uk/rathmines-online-dating-site.html]rathmines online dating site[/url] e dating service in cahir [url=https://brighten-up.uk/dating-photography-nenagh-ireland.html]dating photography nenagh ireland[/url] dating event in donabate [url=https://brighten-up.uk/kells-best-hookup-apps.html]kells best hookup apps[/url] speed dating area clane [url=https://brighten-up.uk/speed-dating-asian-near-birr.html]speed dating asian near birr[/url] speed dating black wexford ireland [url=https://brighten-up.uk/loughrea-dating-anyone.html]loughrea dating anyone[/url] charleville dating personals [url=https://brighten-up.uk/city-dating-websites-near-shannon.html]city dating websites near shannon[/url] dating english south dublin ireland [url=https://brighten-up.uk/online-dating-photography-in-lusk.html]online dating photography in lusk[/url] buncrana online dating region [url=https://brighten-up.uk/central-dating-sites-near-drogheda.html]central dating sites near drogheda[/url] newbridge dating locations [url=https://brighten-up.uk/free-hookup-near-clonakilty.html]free hookup near clonakilty[/url] killarney dating region [url=https://brighten-up.uk/dungarvan-dating-apps-city.html]dungarvan dating apps city[/url] hookup site tramore ireland [url=https://brighten-up.uk/dating-women-in-port-laoise-ireland.html]dating women in port laoise ireland[/url] new ross internet dating sites [url=https://brighten-up.uk/dating-beach-birr.html]dating beach birr[/url] an muileann gcearr lunch dating [url=https://brighten-up.uk/beach-dating-kilrush.html]beach dating kilrush[/url] ireland hook up beach [url=https://brighten-up.uk/geek-speed-dating-in-monaghan-ireland.html]geek speed dating in monaghan ireland[/url] ballyhaunis online dating sites man [url=https://brighten-up.uk/knock-asian-dating-website.html]knock asian dating website[/url] letterkenny 8 minute speed dating
Jameswhoms
2020-07-03
Regards. I value this! [url=https://paydayloansttf.com/]usda loans[/url] loans online
RobertZeste
2020-07-03
Thanks, A lot of info! no credit check payday loans instant approval small personal loan
AbermotLew
2020-07-03
top dating app near bagenalstown area speed dating sligo ireland online dating city curragh ireland hookup city near carrick on suir italian dating castlerea ireland dating a guy in crookstown ireland mitchelstown best hookup spot dating south dunmanway ireland gay dating service in bray rathmines dating services city dating life in oranmore dating beach tramore dating agencies man laytown ireland ballyboughal speeding dating sex hook up killarney dundalk matchmaker dating service donabate hookup clubs donabate hookup clubs online dating man in rathmines full hook up campsites portmarnock ireland mitchelstown singles dating site online dating photography in offaly ireland asian american dating castlerea the league dating app in blanchardstown ireland city dating site derry belturbet dating show housewives of speed dating in ratoath ireland dating agency man mountmellick ireland dating night in carrigtwohill ireland online dating site in crookstown clare handler dating on line dating near laois matchmaking enniscorthy bray adult personals dating sligo free online dating balbriggan african american speed dating senior dating service near cashel women dating in cashel ireland matchmaking agency near thurles hook up guys clonmel senior dating service in newbridge ireland
AbermotLew
2020-07-03
private dating services in tuam ireland [url=https://tonyshirley.co.uk/central-speed-dating-athenry.html]central speed dating athenry[/url] crumlin elite dating app [url=https://tonyshirley.co.uk/state-dating-laws-in-bray-ireland.html]state dating laws in bray ireland[/url] online dating man in shannon [url=https://tonyshirley.co.uk/free-christian-dating-galway.html]free christian dating galway[/url] gay dating city near clonmel [url=https://tonyshirley.co.uk/your-dating-site-in-lucan-ireland.html]your dating site in lucan ireland[/url] date hookup wicklow [url=https://tonyshirley.co.uk/mature-dating-mitchelstown.html]mature dating mitchelstown[/url] drogheda dating apps for android [url=https://tonyshirley.co.uk/best-dating-site-finglas-ireland.html]best dating site finglas ireland[/url] portarlington half hookup [url=https://tonyshirley.co.uk/expat-dating-near-ballinasloe.html]expat dating near ballinasloe[/url] hook up websites in donabate ireland [url=https://tonyshirley.co.uk/speed-dating-central-kildare-ireland.html]speed dating central kildare ireland[/url] newcastle west dating matchmaker [url=https://tonyshirley.co.uk/best-dating-apps-city-near-enfield.html]best dating apps city near enfield[/url] matchmaking companies wexford [url=https://tonyshirley.co.uk/state-speed-dating-derry-ireland.html]state speed dating derry ireland[/url] online dating city dunmanway ireland [url=https://tonyshirley.co.uk/tipperary-casual-hook-up.html]tipperary casual hook up[/url] killarney interracial dating sites [url=https://tonyshirley.co.uk/mullingar-hook-up-apps.html]mullingar hook up apps[/url] full hookup campgrounds in donnybrook [url=https://tonyshirley.co.uk/black-dating-sites-in-kinsale-ireland.html]black dating sites in kinsale ireland[/url] knock free interracial dating [url=https://tonyshirley.co.uk/internet-dating-newcastle-west-ireland.html]internet dating newcastle west ireland[/url] dating dc caherciveen ireland [url=https://tonyshirley.co.uk/ratoath-casual-hookup.html]ratoath casual hookup[/url] best hookup sites glanmire ireland [url=https://tonyshirley.co.uk/curragh-interracial-dating.html]curragh interracial dating[/url] carrick on suir free lesbian dating sites [url=https://tonyshirley.co.uk/carrigtwohill-free-dating-app.html]carrigtwohill free dating app[/url] dating sites can clonakilty [url=https://tonyshirley.co.uk/enfield-bbw-dating.html]enfield bbw dating[/url] blanchardstown christian dating sites [url=https://tonyshirley.co.uk/carrickmacross-dating-events-man.html]carrickmacross dating events man[/url] uni dating ashbourne ireland [url=https://tonyshirley.co.uk/charleville-island-dating-sites.html]charleville island dating sites[/url] dating agencies swords
DustinLak
2020-07-03
Terrific material. Appreciate it! 3 month loans eloans
AbermotLew
2020-07-03
online gay dating near enniscorthy executive dating services in clonakilty full hookup campground in lusk ireland tipperary interacial dating celbridge dating photography area dating services in wicklow ireland shankill online dating site free dating man blessington ireland gay asian dating monasterevin ireland donabate college speed dating free dating sites city in loughrea ireland kildare lunch dating louth online dating region dating times athenry ireland gorey alternative dating dating again in derry ireland online dating site monaghan ireland dating clubs near maynooth matchmaking cost in mitchelstown rathcoole best free online dating sites best gay hookup apps in mallow ireland louth italian dating dinner dating caherciveen mountmellick best lesbian dating app hook up sites in mullingar ireland dunmanway speed dating beach custom matchmaking on swords malahide hookup county dating married in sandyford dunmanway dating girl number black dating sites in tralee ireland central dating in loch garman loughrea black lesbian dating dating seniors cahir executive dating services in clonakilty online dating sites city in cork city northside ireland dating website city clane speed dating christian near nenagh black speed dating events near tullow knocklyon hook up free dating around near ratoath
AbermotLew
2020-07-03
tralee dating sites man [url=https://sil0.co.uk/adult-dating-sites-blessington-ireland.html]adult dating sites blessington ireland[/url] dating coaches in jobstown [url=https://sil0.co.uk/senior-dating-service-in-tralee-ireland.html]senior dating service in tralee ireland[/url] hookup clubs in mountmellick [url=https://sil0.co.uk/dating-man-in-thurles-ireland.html]dating man in thurles ireland[/url] louth casual dating [url=https://sil0.co.uk/executive-search-dating-kilmallock.html]executive search dating kilmallock[/url] 5 minute dating westmeath [url=https://sil0.co.uk/newcastle-west-dating-websites.html]newcastle west dating websites[/url] gay asian dating ballymote ireland [url=https://sil0.co.uk/jobstown-asian-dating-service.html]jobstown asian dating service[/url] dating bloom in laytown [url=https://sil0.co.uk/free-lesbian-dating-sites-mayo.html]free lesbian dating sites mayo[/url] dating agency near cashel [url=https://sil0.co.uk/ballina-online-gay-dating.html]ballina online gay dating[/url] dating girls number in blanchardstown [url=https://sil0.co.uk/castlerea-best-lesbian-dating-app.html]castlerea best lesbian dating app[/url] matchmaker dating service in droichead nua ireland [url=https://sil0.co.uk/kinsealy-drinan-christian-dating-site.html]kinsealy-drinan christian dating site[/url] blessington dating on [url=https://sil0.co.uk/urban-speed-dating-clondalkin-ireland.html]urban speed dating clondalkin ireland[/url] ballyhaunis exclusive dating agency [url=https://sil0.co.uk/dating-sites-mel-donnybrook-ireland.html]dating sites mel donnybrook ireland[/url] matchmaker dating service in knocklyon ireland [url=https://sil0.co.uk/malahide-owen-dating.html]malahide owen dating[/url] athenry dating services area [url=https://sil0.co.uk/online-dating-free-in-limerick-ireland.html]online dating free in limerick ireland[/url] bagenalstown hook up free [url=https://sil0.co.uk/local-hook-up-in-meath-ireland.html]local hook up in meath ireland[/url] state speed dating ennis ireland [url=https://sil0.co.uk/monaghan-male-dating.html]monaghan male dating[/url] places hook up in cashel [url=https://sil0.co.uk/cluain-meala-onlinedating.html]cluain meala onlinedating[/url] single dating events in wexford [url=https://sil0.co.uk/millionaire-speed-dating-in-finglas.html]millionaire speed dating in finglas[/url] online dating photography in blackrock ireland [url=https://sil0.co.uk/dating-apps-for-android-in-monaghan.html]dating apps for android in monaghan[/url] hook up home passage west ireland [url=https://sil0.co.uk/dating-sites-island-kilmallock-ireland.html]dating sites island kilmallock ireland[/url] singles matchmaking in donegal
Jameswhoms
2020-07-03
Wonderful postings, Thank you. [url=https://payday8online.com/]online loans no credit check[/url] easy online loans
AbermotLew
2020-07-03
online gay dating near cahir bisexual dating in cork city northside bbw dating service near clare kilmallock elite speed dating dating a man foxrock ireland wicklow dating night speed dating gorey dating polis skibbereen clifden classifieds dating beach hook up letterkenny personals dating meath black lesbian dating clonakilty ireland best place hook up in carrick on shannon ireland blackrock interatial dating clonakilty dating over 50 speed dating in ballinasloe ireland black lesbian dating in clonakilty power hook up naas ireland louth hookup free russian dating in charleville portlaoise lesbian online dating newbridge city dating sites youghal gay matchmaking services free hookup buncrana ireland fingal new dating site auto hook up in newbridge college speed dating donaghmede ireland enfield speed dating man lesbian dating app in newbridge ireland listowel dating south speed dating meetup in enfield ireland bray local dating sites mitchelstown asian dating website dating company near mitchelstown newbridge online dating region hook up tonight in navan ireland cabinteely beach hookup west dating trim ireland cavan student dating skibbereen hook up app malahide hookup now

Páginas