Mobile app version of vmapp.org
Login or Join
Carla537

: Google maps for a mobile site We have a website that uses the Google Maps static maps functionality to embed maps into pages. This works with no problem; we just use something like this: <img

@Carla537

Posted in: #Google #Map

We have a website that uses the Google Maps static maps functionality to embed maps into pages. This works with no problem; we just use something like this:

<img src="http://maps.google.com/maps/api/staticmap?zoom=15&size=512x512&maptype=roadmap&markers=color:red|label:H|42.038322,-87.680260&sensor=false" />


We are now creating a mobile site for the same client. The code itself will still work, but I'm wondering how to make sure I get a map that doesn't take over the entire screen, but is still readable. Is there a standard size that's used for mobile screens? I'm guessing with the static maps there's no way for a user to click to zoom in if we use a small size, but the regular API requires javascript and a lot of mobile browsers still don't support it.

Any ideas?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Carla537

1 Comments

Sorted by latest first Latest Oldest Best

 

@Angie530

One of the ways you can prevent your site & the static map from appearing too out of proportion is to use the viewport meta tag:

<meta name="viewport" content="width=780px"/>

This would tell a mobile browser to try to display the page with a viewport of 780px, or scale it if the device resolution is smaller than that.

There are several other options available in the viewport meta tag that may help you make sure your site doesn't get too squashed when viewed on a mobile browser.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme