5 formas de añadir mapas responsivos de Google a tu sitio web

March 31, 2021
0 minute read

 

De vez en cuando, es posible que un cliente de diseño web te pregunte específicamente por los mapas responsivos de Google. Ahora bien, si ya estás familiarizado con la plataforma de Duda, sabrás que su constructor de sitios web de nivel profesional viene con un fantástico widget de mapas responsivos impulsado por Mapbox.

Nos encanta Mapbox porque permite una fácil integración en aplicaciones móviles y en línea, y es muy adaptable a nuevos diseños y disposiciones de mapas. Por no mencionar que tiene una gran cobertura global.


Dicho esto, si se requiere un mapa de Google para un proyecto, continúas teniendo cobertura. La plataforma flexible de Duda te permite añadir fácilmente casi cualquier tipo de mapa que tú y tus clientes quieran utilizar.


Aquí hay cinco maneras de añadir un mapa responsivo de Google a cualquier sitio web...

 

UN POCO SOBRE GOOGLE MAPS

 

Más de 150 millones de usuarios acceden a Google Maps mensualmente.  Añadir un widget responsivo de Google Maps puede ayudar a los consumidores a localizar los negocios de sus clientes, da credibilidad a sus organizaciones y mejora la experiencia general del usuario.

La incorporación de un mapa en tu sitio web también puede reducir la tasa de rebote y ayuda a tus esfuerzos de optimización de motores de búsqueda.

Los mapas de Google son interactivos de por sí, y Google facilita su integración en los sitios web. Sin embargo, Google Maps no es responsivo por defecto, lo que significa que no cambia de tamaño automáticamente en función del tamaño de la pantalla del dispositivo. Se necesita una programación adicional para hacer posible el cambio de tamaño automático. 


¿Hay que pagar por Google Maps para ponerlo en un sitio web?

Sí y no. El acoplamiento básico es gratuito e incluye una vista sencilla, un pin del mapa y la información de tu empresa.

Sin embargo, para las funciones más complejas, se cobra una tasa, por ejemplo, para mostrar varias ubicaciones o implementar funciones más avanzadas como Google Street View, encontrar rutas y buscar lugares, Google empieza a cobrar una vez que se alcanzan las cuotas de uso.


 

¿CÓMO PUEDO ACOPLAR GOOGLE MAPS EN MI SITIO WEB?

La incrustación de Google Maps en cualquier sitio web se puede hacer de varias maneras.

Un novato puede manejar la mayor parte del código, aunque es útil cierto conocimiento de HTML, CSS y JavaScript. Google proporciona el código y hay varias formas de incrustar Google Maps responsivo en cualquier sitio web usando Iframes.

En esta publicación, abordaremos varios métodos de bricolaje describiendo procedimientos paso a paso sobre cómo incrustar mapas responsivos en cualquier plataforma de sitio web, incluidos Duda y otros.

INTEGRACIÓN DE GOOGLE MAPS USANDO UN SIMPLE CÓDIGO IFRAME ACOPLADO DE GOOGLE


Esta sección cubrirá la copia del código de inserción de Google de los mapas de Google en el código HTML de un sitio. No se aplica ningún otro código de formato.

Obtener un código de acoplamiento de Google

  • Ir a Google Maps
  • Coloca la dirección de la empresa en la barra de búsqueda y haz clic en el botón de búsqueda
  • Haz clic en el icono Compartir
  • Selecciona "Acoplar mapa".
  • Selecciona el tamaño del mapa en el menú desplegable
  • Selecciona y copia el código HTML iframe de inserción
responsive map 1

Pega el código de inserción en tu página HTML o widget

El código debería verse así. El "xxxxxxxxx" representa el código de ubicación de Google.

 

<iframe src=”https://xxxxxxxxxx” width=”600” height=”450” frameborder=”0” style=”border:0;” allowfullscreen=”" aria-hidden="false" tabindex="0"></iframe>

Este mapa resultante tiene un ancho y alto estáticos de 600 y 450 píxeles respectivamente.

El tamaño se puede ajustar cambiando estos atributos de tamaño, pero este mapa no es un mapa de Google receptivo que cambiará de tamaño automáticamente en varios dispositivos. Para hacer un mapa receptivo, necesitamos profundizar un poco más.

map 3

CREAR MAPAS RESPONSIVOS DE GOOGLE SIN CLAVE API

 

Es posible acoplar un mapa responsivo de Google en un sitio web sin utilizar la API de Google Map.  A continuación se explica cómo hacerlo. 

 

Obtener un código de acoplamiento de Google

  • Ir a Google Maps
  • Coloca la dirección de la empresa en la barra de búsqueda y haz clic en el botón de búsqueda
  • Haz clic en el icono Compartir
  • Selecciona "Incrustar mapa".
  • Selecciona el tamaño del mapa en el menú desplegable
  • Selecciona y copia el código HTML iframe de inserción

Pega el código de acoplamiento en tu página HTML o widget

 

<iframe src=" https://xxxxxxxxxx " width="600" height="450" frameborder="0" style="border:0;" allowfullscreen="" aria-hidden="false" tabindex="0"></iframe>

Modificar el código de acoplamiento

Añade una clase de llamada CSS map-responsive alrededor del iframe como sigue:

 

<div class="map-responsive">

<iframe src="xxx" width="600" height="450" frameborder="0" style="border:0" allowfullscreen></iframe>

</div>

Editar el CSS del sitio

Añade el código CSS de Google Maps de la siguiente manera:

 

.map-responsive{

    overflow:hidden;

    padding-bottom:56.25%;

    position:relative;

    height:0;

}

.map-responsive iframe{

    left:0;

    top:0;

    height:100%;

    width:100%;

    position:absolute;

}

Puedes cambiar la altura del mapa ajustando el valor de padding-bottom así: padding-bottom:40%;

google map 2

Ahora tienes un mapa responsivo de Google sin usar una clave API. Este método de acoplamiento y estilo CSS debería funcionar para cualquier sitio web basado en HTML.

Aprende a utilizar las consultas de medios para dispositivos estándar aquí.

CÓMO ACOPLAR UN MAPA DE GOOGLE RESPONSIVO SIN APIS DE GOOGLE O MÁS ESTILOS CSS

 

Aunque este tipo de integración de mapas responsivos de Google es necesario para que funcione en plataformas más antiguas como WordPress y otros constructores de sitios web, el widget HTML de Duda hace que la implementación de mapas responsivos de Google sea muy sencilla y rápida si quieres acoplar uno en un sitio web de Duda. Solo hay que hacer un par de cosas.

 

Obtener un código de acoplamiento de Google

  • Ir a Google Maps
  • Coloca la dirección de la empresa en la barra de búsqueda y haz clic en el botón de búsqueda
  • Haz clic en el icono de compartir
  • Selecciona "Acoplar mapa".
  • Selecciona el tamaño del mapa en el menú desplegable
  • Selecciona y copia el código HTML iframe de inserción

Pegue el código de inserción en su página HTML o widget

 

<iframe src=”xxxxxxxx” width=”100%” height=”100%” frameborder=”0” style=”border:0” allowfullscreen></iframe>


Cambiar el ancho y el alto del iframe al 100 por ciento permitirá que el mapa de Google abarque completamente el contenedor de widgets HTML, lo que hará que Google Map responda y sea fácil de cambiar de tamaño en cualquier dispositivo.

No se necesita más estilo CSS o uso de consultas de medios cuando se usa este método de inserción.

map4

ACOPLAR UN MAPA DE GOOGLE MEDIANTE JAVASCRIPT A TRAVÉS DE GOOGLE MAPS APIS

 

Google Maps puede integrarse en un sitio web a través de las API. Además de HTML y CSS, es necesario tener conocimientos de JavaScript. 

Aunque nuestro ejemplo es bastante sencillo, la plataforma de Google Maps ofrece funciones complejas, como el dibujo de marcadores de mapa, el cálculo de distancias y áreas, la visualización de puntos de interés destacados, los mapas térmicos, etc. 

Puedes encontrar más detalles en las bibliotecas de Google Maps.

 

Crear una clave API

  • Dirígete a la consola de Google Cloud Platform Console
  • Selecciona o crea el proyecto para el que quieras añadir una clave de API
  • Selecciona API y servicios > Credenciales
  • Haz clic en Crear credenciales > Clave de API

Es importante restringir la clave de API restringir la clave de API antes de utilizarla en producción. Las restricciones proporcionan mayor seguridad y ayudan a garantizar que solo se realicen solicitudes autorizadas con tu clave de API.

Añada los scripts y el código de la API

Agregue el código de estilo del mapa a su página:

 

<style>

 #map {

    width: 100%;

    height: 400px;

    background-color: grey;

}

</style>

Añade el script del mapa que propaga el elemento del mapa, y edita las coordenadas:

 

<script>

    function initMap() {

      var macc = {lat: 42.1382114, lng: -71.5212585};

      var map = new google.maps.Map(

          document.getElementById('map'), {zoom: 15, center: macc});

      var marker = new google.maps.Marker({position: macc, map: map});

    }

 </script>

Añade el script de la API de Google Maps:

 

<script async defer

    src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap">

    </script>


Ahora tiene un mapa receptivo creado con la API de JavaScript de Google Maps.

map5

ACOPLAMIENTO DE MAPAS DE GOOGLE USANDO WIDGETS Y PLUGINS DE TERCEROS

 

Es posible que no te apetezca complicarte con el código y quieras un widget ya hecho. Pues bien, ¡buenas noticias! TheCamel.co, aliado de Duda desde hace mucho tiempo, ha creado un widget de Google Map específicamente para el uso en la plataforma Duda.

Este widget funciona muy bien para los negocios locales que tienen varias ubicaciones y tiene características avanzadas como la personalización del tema y de los pines, la visualización del logotipo, de la información del negocio y la posibilidad de zoom para la vista de la calle y del mapa.

 

map6

 

Cuando se trata de la integración de Google Maps, hay múltiples maneras de hacer el trabajo. Van desde métodos de DIY para una simple integración de mapas y widgets personalizados hasta la implementación avanzada de la API de Google Maps en JavaScript.

 

 

 Google Maps  ofrece APIs, SDKs y muchos tutoriales paso a paso y ejemplos de código para ayudar a los usuarios a crear sencillos Google Maps responsivos o mapas altamente personalizados que puedan hacer todo tipo de cosas interesantes.

Con solo unos pocos pasos, puedes aumentar tu sitio con una serie de funcionalidades, desde una simple vista de mapa hasta herramientas cartográficas altamente complejas e interactivas.

 


Did you find this article interesting?


Thanks for the feedback!
A computer screen with a graph on it and a purple background.
By Santi Clarke April 24, 2025
Learn how platform ecosystems drive revenue and why they are essential for the growth of SaaS businesses.
By Santi Clarke April 24, 2025
One of the greatest challenges for SaaS platforms is keeping users engaged long-term. The term “stickiness” refers to a product's ability to retain users and make them want to return. In the context of SaaS platforms, creating a sticky product means that users consistently find value, experience seamless interactions, and continue using the product over time. The following are 7 practical strategies you can take to improve the stickiness of your SaaS solution. 1. Offer websites that help customers build their digital presence One of the most effective ways to make your SaaS platform sticky is by offering websites to your users. Many businesses today need an online presence, and by providing a platform where your customers can easily build and manage their websites, you increase their reliance on your product. When you offer users a website-building solution, you’re helping them create something foundational to their business. Websites, in this case, aren’t just a tool—they become a part of their identity and brand. This deepens their engagement with your platform, as they need your product to maintain and update their site, ultimately making them less likely to churn. Plus, websites naturally encourage frequent updates, content creation, and customer interactions, which means your users will return to your platform regularly. When you can give your users the tools to create something so essential to their business, you make them more dependent on your platform. This creates a higher barrier to exit, as migrating a fully built website to another service is no small task. In fact, websites are some of the stickiest products you can sell, so adding them to your product portfolio can be one of the best decisions you can to keep your customers using your technology for the long haul. 2. Deliver continuous value through product innovation The key to keeping users coming back to your SaaS platform is ensuring that they consistently see value in it. This means not only meeting their immediate needs but also evolving to address their growing demands. Constant product innovation is essential for keeping your users satisfied and invested in your platform. One way to achieve this is through regular updates that add new features or improvements based on user feedback. A SaaS platform that evolves with its users will keep them engaged longer, making it harder for competitors to steal their attention. Encourage user feedback and prioritize updates that create tangible improvements. This creates an ongoing relationship with your users, which boosts stickiness. 3. Offer a multi-product solution Another powerful way to increase your platform’s stickiness is by offering a suite of products or features that integrate well together. When your users adopt multiple products, they are more likely to stay because they become embedded in your ecosystem. The benefits of this strategy are clear. Research shows that once users adopt more than one product, especially when they integrate >4 tools into their workflow, their likelihood of churn decreases significantly. This happens because the more a user integrates into your suite of products, the harder it is for them to switch to a competitor. These users have invested time in learning your ecosystem and rely on it for their day-to-day operations, making it much harder for them to make the switch. 4. Create a personal connection with your users Human connection is one of the most powerful drivers of user retention. People don’t want to feel like they’re using a cold, faceless platform. By offering exceptional customer support, personalized communication, and community engagement, you build a relationship with your users that goes beyond the product itself. Make sure your support team is responsive, knowledgeable, and empathetic. You can also consider offering tailored onboarding experiences to ensure users understand how to make the most of your platform. When users feel like their success matters to you, they are more likely to remain loyal. 5. Leverage data to personalize the user experience Using data to drive personalization is another strategy that can significantly increase the stickiness of your platform. By tracking user behavior and usage patterns, you can tailor the experience to each individual user’s needs. This could mean recommending features they haven’t yet explored or sending them reminders about tools they may not be fully utilizing. Personalization gives users the feeling that the platform was designed specifically for them, making it harder to walk away from. By demonstrating that you understand their unique needs, you can build a stronger connection and ultimately increase retention rates. 6. Focus on seamless integrations and API capabilities To further increase stickiness, consider expanding your product’s ability to integrate with other tools your users already rely on. Whether it’s email marketing software, CRM systems, or social media management tools, seamless integrations add tremendous value by making it easier for users to incorporate your platform into their existing workflows. The more your product can work in tandem with other popular tools, the more indispensable it becomes. In fact, users who depend on integrations are less likely to churn since their entire ecosystem is tied to your platform’s functionality. 7. Encourage user advocacy and community building User advocacy is another powerful tool in building a sticky product. When users feel a sense of community or even ownership over the platform, they become your most passionate promoters. Encourage your users to share their success stories, join community forums, or contribute to product development through beta testing or feedback loops. A thriving user community not only increases user engagement but also creates a sense of loyalty. When users are part of something larger than themselves, they are more likely to remain committed to your platform, reducing churn and increasing lifetime value. Create deep, lasting customer relationships Making your SaaS platform sticky is all about creating a deep, lasting connection with your users. This requires building a platform that continuously delivers value, creating a seamless and personalized experience, and integrating features that keep users coming back. By focusing on product innovation, offering a multi-product ecosystem, and fostering strong user relationships, you’ll be well on your way to reducing churn and boosting user retention. Stickiness isn’t just a nice-to-have; it’s essential for long-term success. Focus on creating a platform that users can’t imagine living without, and you’ll see them stick around for the long haul.
By Shawn Davis April 24, 2025
Your team is likely pretty familiar with the products they built, but what about the ones they didn’t? Integrated tools can throw a wrench into your support operations, but they don’t have to.
Show More

Latest posts