Google Maps with iPhone Web Apps

working-with-iphone-web-apps

Working on a personal project I have come up against the task of creating an iphone web application that performs location tracking and shows data via google maps. With the V3 API Google have put in a lot of effort to allow the mapping software to display properly across a range of mobile devices.

My problem arose when I was creating a visual representation of location anonymisation by plotting a circle onto the map using the API. The circle would draw perfectly fine when running the application in Chrome or Safari though when it was running on the iPhone the circle would not display, though the Google Map believed it was drawing fine. After a little bit of search I found the following snippet that, although it isn’t as smooth or responsive as I had hoped, refreshes the map and plots the circle.

google.maps.event.trigger( map, 'resize' );

This is also a worthwhile snippet if you are using the jQTouch framework as it allows the map to display properly after navigating through pages.

If anyone has any better solutions please leave a comment below

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>