I have a WebView application that I created in an application that calls Google Maps Directions to determine the route between the current location and the POI.
The entire google map with directions loads as soon as the WebView loads. Now I need to update the map with my current location. Like in, I want a flag / icon representing my current location to move with the user while traveling. But the only way I can do this so far is to reload the entire map, causing a new location.
It is very expensive to use time and data. Is there a better way that I am missing?
Here is my code:
CLLocationCoordinate2D destination = { 37.773768,-122.408638 }; NSString *googleMapsURLString = [NSString stringWithFormat:@"http://maps.google.com/?saddr=%1.6f,%1.6f&daddr=%1.6f,%1.6f&output=embed", myLocation.coordinate.latitude, myLocation.coordinate.longitude, destination.latitude, destination.longitude]; NSURL *url=[NSURL URLWithString:googleMapsURLString]; NSURLRequest *requestObj=[NSURLRequest requestWithURL:url]; [webView loadRequest:requestObj];
Someone please help !!!
source share