Brian Moreau

Search my site


Plasma
   Home   
    Solutions    
    Articles   
    Projects   
    Blog   
    Contact   
    Maker Portfolio   
 
 
 

Hacking Google Maps API

How to put map markers on embedded maps.

August
2014

If you want to display markers at specific latitude and longitude locations on Google maps you have to use Static Maps. Or I believe pay for business use.

I wanted to use the interactive map and I also wanted to display markers so I have discovered two ways that you can do this with the Google Maps Embed API.

One map marker
The first and most simple way if you only want to display one marker is to simply enter the latitude and longitude into the search query thus.

https://www.google.com/maps/embed/v1/place?key=yourapikey
 &q=51.57577,-0.08674

Note the method above used the PLACE mode.

 

 

Direction Map Markers
By using the Directions mode you can display a directions path between two points or effectively display start and end markers for two sets of coordinates thus.

https://www.google.com/maps/embed/v1/directions?key=yourapikey
  &origin=51.57577,-0.06674
  &destination=51.57577,-0.08674

Ok it is only possible to display one marker and it is not technically a hack but it is a method of displaying location markers that is not described in the embed guide documentation.

But it is perfect for my application.

 

NOTE*
In order to use the embed mode you need to obtain an access key from Google and enable Google Maps Embed API service.

I think it is also possible to add multiple markers using the Java Script method but for this example I just wanted to keep things simple and not be limited by API call limits.

 
 
 

Readers comments >

Sorry there are no comments, be the first to leave a comment.
 
 
 

Leave a comment or ask me a question >

You don’t need to register to leave a comment because I feel people should not be forced to register to have their say.
All comments are checked prior to publishing to prevent spam.
Don’t worry this wont take long.
If you supply your email address below you will automatically be notified when I approve your comment.

Full name > *
eMail address > (not published)
Website > (http://...)
Location > (town or city)
Comment or question > *
Human *
  * feilds required  
 
 
 
 
Hacking Google Maps API
© 2008 - 2021 - Brian Moreau

Valid XHTML 1.0 Transitional Valid CSS!