How works and how create the Google Maps

GK User
Thu Sep 29, 2011 3:19 pm
Hi this kind of code is located in one of the two standard demo contacts

Code: Select all
{GKMAP}http://maps.googleapis.com/maps/api/staticmap?center=Brooklyn+Bridge,New+York,NY&zoom=15&size=470x428&maptype=roadmap&markers=color:blue%7Clabel:S%7C40.702147,-74.015794&markers=color:green%7Clabel:G%7C40.711614,-74.012318&markers=color:red%7Ccolor:red%7Clabel:C%7C40.718217,-73.998284&sensor=false{/GKMAP}


How does this works to create for your own adres???

Regards Ronnie
User avatar
Expert Boarder

GK User
Fri Sep 30, 2011 3:22 am
Here is a break down for you.
Example is based around Piccadily Circus in London
Complete link
Code: Select all
{GKMAP}http://maps.googleapis.com/maps/api/staticmap?center=piccadily+circus,london,UK&zoom=17&size=400x400&scale=1&maptype=roadmap&markers=color:blue%7Clabel:R%7C51.509988,-0.13502&sensor=false{/GKMAP}

Lets break it down in smaller parts.
Main Link:
Code: Select all
http://maps.googleapis.com/maps/api/staticmap?center=

Area you are interested in...
Code: Select all
piccadily+circus,london,UK

Zoom Level higher is closer
Code: Select all
&zoom=17

Size of the map
Code: Select all
&size=400x400

Multiplies above size with scale factor
Code: Select all
&scale=1

Map Type, e.g roadmap, satellite etc
Code: Select all
&maptype=roadmap

Enables Marker
Code: Select all
&markers=

Marker colour is blue
Code: Select all
color:blue|

Puts single R inside marker
Code: Select all
label:R|

Location of your marker in long , lat , use google map , browse to the place you want then right click on the location you want then choose whats here and then on google map address search bar you will see the numbers which in my case was
Code: Select all
51.509988,-0.13502

Sensor is for gps so if its not for navigation we use false
Code: Select all
&sensor=false


And also in code "%7C" without qoutes will look like "|" in the url as its just a ascii code.

So for test you can copy below link to browsers address bar and hit go and see how it looks
Code: Select all
http://maps.googleapis.com/maps/api/staticmap?center=piccadily+circus,london,UK&zoom=17&size=400x400&scale=1&maptype=roadmap&markers=color:blue|label:R|51.509988,-0.13502&sensor=false
User avatar
Platinum Boarder


cron