Home HTML How to add a Google Map to your mobile website?
 
 
 

How to add a Google Map to your mobile website?

PDF Print E-mail

Question: How to add a Google Map to your Mobile website or .mobi site?

 

Answer:

  • First of all we can only use a static map, since Google Maps uses Javascript to zoom etc and most phones on the market do not support Javascript, so the only solution is to use static maps.
  • Before we can use the Google Maps API we need to apply for an Application Key by visiting this URL http://code.google.com/apis/maps/signup.html
  • Now use the following code within an HTML img tag

    <img src="http://maps.google.com/maps/api/staticmap?center=ADDRESS&zoom=14&size=150x150&sensor=false&markers=color:blue|ADDRESS&maptype=roadmap&mobile=true&key=APPLICATION_KEY" alt="Google Map" />


    Replace ADDRESS with you address
    Replace APPLICATION_KEY with your application key, obtained from  http://code.google.com/apis/maps/signup.html

    Remember to URL encode the address entered
  • For the complete Static Google Maps API visit  http://code.google.com/apis/maps/documentation/staticmaps/
+/-
+/- Write comment
Your Contact Details:
Comment:
[b] [i] [u] [url] [quote] [code] [img]   
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
Security Please input the anti-spam code that you can read in the image.
 
 
Banner