How to Get Google Map Code for Your Website

If you want to share a certain map or provide directions getting to a venue or place, you can use Google Maps for this. You can share or embed a map on a website. There’s no need for you to figure out the HTML code for the map you want to share or embed, as Google Maps has that done for you. All you have to do is get the exact code for the map and paste it on your website, blog, or forums.

Steps

  1. Go to Google Maps. Open any web browser on your computer and visit the Google Maps website.
  2. Identify a location. You can use the location button on the lower right corner to set the map to your current location, or you can use the search box on the upper right corner to find another place on the map.
    • Finding your current location—Click on the compass button on the lower right corner of the page. The map will adjust based on your current location. Your current location will be identified by a blue dot on the map.
    • Finding another location—Use the search box and type in the location you want. A shortlist of possible results will drop down. Click on the location you want, and the map will automatically draw to the location you’ve set.

  • Adjust the map to how you want it to be viewed. Use your mouse to move the map around, and use the zoom in or out buttons on the bottom right corner of the page to zoom in or out. The view you set here will be the view embedded to the code when you share it.
  • Create the embed code and share link. Click on the “Share” icon on the left centre of the page to bring out a small menu. Click on “Share or embed map” from here. A small window will appear.
  • Get the code. You can either get the exact URL for your map view or get the exact HTML code to embed the map to your website.
    • To get the share link, click on the “COPY LINK” on the small window. You will be shown the exact URL for your map view. You can also convert this URL to a shorter one by ticking on the checkbox for “Short URL” above the main URL box. Copy either URLs. Both will link to the same map.
    • To get the embed code, click on the “Embed a map” tab on the small window. You will be shown a preview of how your map will look like when embedded on a website. You can resize your map by selecting size options from the drop-down list. When you’re done, click “COPY HTML” on the URL box. This is the exact HTML code you need to paste on your website in order for this map to be displayed correctly.