Google Maps iOS SDK, Getting Directions between 2 locations

NSString *urlString = [NSString stringWithFormat: @”%@?origin=%f,%f&destination=%f,%f&sensor=true&key=%@”, @”https://maps.googleapis.com/maps/api/directions/json”, mapView.myLocation.coordinate.latitude, mapView.myLocation.coordinate.longitude, destLatitude, destLongitude, @”Your Google Api Key String”]; NSURL *directionsURL = [NSURL URLWithString:urlString]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:directionsURL]; [request startSynchronous]; NSError *error = [request error]; if (!error) { NSString *response = [request responseString]; NSLog(@”%@”,response); NSDictionary *json =[NSJSONSerialization JSONObjectWithData:[request responseData] options:NSJSONReadingMutableContainers error:&error]; GMSPath *path =[GMSPath pathFromEncodedPath:json[@”routes”][0][@”overview_polyline”][@”points”]]; GMSPolyline *singleLine … Read more

GMSPolyline very large memory spike

why don´t you try to use google API for direction, based on basic http requests. https://developers.google.com/maps/documentation/directions/ . (check the conditions on licensing and nº of requests). And then plot the the data with IOS MKPolyline. i´m Sure you will have better performance. And you will only depend on google for the positioning data. to convert … Read more

Custom Info Window for Google Maps

You will want to use the markerInfoWindow delegate method along with setting the infoWindowAnchor. When you create your marker, set the anchor: GMSMarker *marker = [[GMSMarker alloc] init]; marker.position = MARKER_POSITION; marker.infoWindowAnchor = CGPointMake(0.44f, 0.45f); marker.icon = [UIImage imageNamed:@”CustomMarkerImageName”]; then create the delegate method: – (UIView *)mapView:(GMSMapView *)mapView markerInfoWindow:(GMSMarker *)marker { InfoWindow *view = [[[NSBundle … Read more

iOS, How to use GMSCoordinateBounds to show all the markers of the map?

– (void)focusMapToShowAllMarkers { GMSCoordinateBounds *bounds = [[GMSCoordinateBounds alloc] init]; for (GMSMarker *marker in <An array of your markers>) bounds = [bounds includingCoordinate:marker.position]; [<yourMap> animateWithCameraUpdate:[GMSCameraUpdate fitBounds:bounds withPadding:30.0f]]; } UPDATE: are you sure there is nothing wrong in you array of markers and the coordinates? I’ve tried this code and is working perfectly. I’ve put this on … Read more

Google Maps SDK for iOS requires GoogleMaps.bundle to be part of your target under ‘Copy Bundle Resources

The instructions are kinda lacking. Launch Xcode (easy) Drag the GoogleMaps.framework bundle to the Frameworks group of your project. When prompted, select Copy items into destination group’s folder. Right-click GoogleMaps.framework in your project, and select Show In Finder. What it doesn’t say is…Then go into the child folder called Resources Drag the GoogleMaps.bundle from the … Read more

GMSGroundOverlay animating – should I be using a CATiledLayer?

I got this answer from pressinganswer.com, i think it may helps you. As currently I cannot use the “position” keypath for animating, I ended up animating it using the “latitude” and “longitude” keypaths separately. First calculate the points and add them to 2 separate arrays, one for latitude value (y) and one for longitude (x) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)