Integrating maps with your web projects can offer your visitors a more interactive experience of your website and assist with the understanding of events and places. As a Blogger, you might write for many different reasons, but no matter the genre of the subject matter, there will come times when area maps relevant to your posts may enhance the experience for your readers. In an earlier post, we learned how to embed Bing Maps to a website, and to add interactive features with it such as real-time Tweets on Bing Maps. Let's now take a look at embedding the most popular map application to a webpage - Google Maps.
As opposed to Bing Maps, where you get three different map types (road, bird's eye and aerial view), Google Maps offers just two easily-embeddable map types; Satellite view and a 2-D road map view.
There are two ways to embed Google Maps to your website. You can either get the iframe code Generated by Google Maps, or use the Google Maps creator.
Getting the iframe embed code
This is the much simpler method. All you need to do is, go to the Google Maps website, and navigate to the place you want to display on your map. You can do that manually, or search for an address.Once you have your desired location on the map, click on the Link button on the top-left of the map.
You will now get the quick embed code. But you can customize your map by clicking on the Customize and preview embed link. Here, you can customize the size of your map to embed. Once done, simply copy the code generated, and paste it inside a blog post HTML editor, and you're all done! (see below for a demonstration).
View Larger Map
Google Maps Creator
Now the map embedded above shows me a location on the map, but I can't personalize it. Wouldn't it help out readers more if you could add personal messages or highlight places? You can't do that with a simple embed. For that, you'll have to use the Google Maps Creator.Step 1: Get Google Maps API key
- Go to the API signup page
- Accept the terms and conditions
- Provide your website URL. Note: The API key is specific to each website, so one key can only be used with only one domain.
- Once your key is generated, save it somewhere. You'll need it later.
Step 2: Generate Map
- Visit the Google Maps Creator page
- Fill out the form with the information as needed
- Make changes as necessary, and click on the Generate this Map button. You will see the code below update itself.
- Customize the code, and replace the YOURKEY part with your API key.
Now, simply paste the code generated into your website's source code, and you're all done! You can get the full code (for full site access) or the portable code (for partial site access).
Got any questions or confusions? Please feel free to ask in the comments section below. Cheers :)
Filed Under: blogger tricks, How To Source : mybloggertricks[dot]com
No comments:
Post a Comment