google-maps-sdk-ios

iOS: Google Maps API - markerInfoWindow vs markerInfoContents

孤者浪人 提交于 2019-12-03 00:33:53
I looked through the Google Maps docs and the description does not seem to help much. I'm following an old tutorial that made use of markerInfoContents however, when I used the delegate it didn't return what I expected. With markerInfoContents : My custom view seems to override the default view When I used markerInfoWindow , the results were what I expected: I am simply pulling in a custom UIView from a xib file like so: func mapView(_ mapView: GMSMapView, markerInfoWindow marker: GMSMarker) -> UIView? { let placeMarker = marker as! PlaceMarker print(placeMarker.name) if let infoView = UIView

How to draw routes between two locations in google maps iOS swift

戏子无情 提交于 2019-12-03 00:19:59
I'm using google maps in my iOS swift project. I want to draw a path between two locations on the map (Not straight line). Any idea how to do that ? Ashish Shah To draw polyline between two locations on Google Map in Swift. // Pass your source and destination coordinates in this method. func fetchRoute(from source: CLLocationCoordinate2D, to destination: CLLocationCoordinate2D) { let session = URLSession.shared let url = URL(string: "http://maps.googleapis.com/maps/api/directions/json?origin=\(source.latitude),\(source.longitude)&destination=\(destination.latitude),\(destination.longitude)

GMSPolyline very large memory spike

孤者浪人 提交于 2019-12-02 19:56:09
In a GPS app that allows the user to display a list of complex location points that we call tracks on various different types of map, each track can consist of between 2k to 10k of location points. The tracks are copiously clipped, pruned and path-simplified when they are rendered on non-Google map types. This is to keep memory usage down and performance up. We typically only wind up submitting far less than a thousand (aggregate) transformed location points to the OpenGL pipeline, even in the worst cases. In integrating the Google Maps SDK for iOS, we initially attempted to continue to

How to fit bounds for coordinate array with google maps sdk for iOS?

为君一笑 提交于 2019-12-02 17:31:26
How to fit bounds for coordinate array with google maps sdk for iOS? I need to zoom map for 4 visible markers. Here's my solution for this problem. Building a GMSCoordinateBounds object by multiple coordinates. - (void)focusMapToShowAllMarkers { CLLocationCoordinate2D myLocation = ((GMSMarker *)_markers.firstObject).position; GMSCoordinateBounds *bounds = [[GMSCoordinateBounds alloc] initWithCoordinate:myLocation coordinate:myLocation]; for (GMSMarker *marker in _markers) bounds = [bounds includingCoordinate:marker.position]; [_mapView animateWithCameraUpdate:[GMSCameraUpdate fitBounds:bounds

Google Maps animateToCameraPosition iOS7 issue

心已入冬 提交于 2019-12-02 12:39:55
问题 I am trying to install Google Maps API to an app for iOS7. After following Google's guidelines and videos I ended up with the following error: [GMSMapView animateToCameraPosition:]: unrecognized selector sent to instance 0x10b98e6c0 I am using Storyboard, and trying to make this map appears above a TableView in the same viewController. In this app, I use Parse, which is fetching data to my TableView, and is working fine. I tried to use a couple of suggestions which I found here on

google map on iphone exception

北城以北 提交于 2019-12-02 09:09:30
i am trying to add a google map to my iphone application , i follow what google says here https://developers.google.com/maps/documentation/ios/start#getting_the_google_maps_sdk_for_ios i did all what they said and unformatunately, i have six errors when building my application, those are : Undefined symbols for architecture i386: "_objc_setProperty_nonatomic", referenced from: -[GMSx_PBGeneratedMessage setExtensionRegistry:] in GoogleMaps(ProtocolBuffers.o) "_NSURLIsExcludedFromBackupKey", referenced from: _GMSSetSkipBackupAttribute in GoogleMaps(GMSUtils.o) "_objc_setProperty_nonatomic_copy",

Google Maps iOS SDK: Map not loading

岁酱吖の 提交于 2019-12-02 07:19:09
I am new to iOS development and am trying out a simple app using Google Maps SDK. I am following the steps listed on Google Maps Getting Started guide . I have seen the similar question: Google Maps iOS SDK Integration not loading maps where the problem is with bundle ID. I made sure it is not the case for me. I already spent 3 days trying new app from scratch. I created a new api key, added my bundle ID. I added API key: func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for

Decreasing the size of google maps sdk for ios

房东的猫 提交于 2019-12-02 06:34:28
问题 i dowloaded google maps sdk (1.8.1) for ios,I'm using it in my app.But what i noticed is that size of the framework is about 55MB.Is there any way to decrease the size of framework. A file named "A" in directory structure "GoogleMaps.framework/Versions/A" is about 54MB.Is google maps depended on this file.please suggest some help. 回答1: Keep GoogleMap framework outside of the project and just drag it in your project without copy file. It will reduce the file size. Only bundle file keep inside

Get LAT and LONG from tapped overlay in Google Maps

谁说胖子不能爱 提交于 2019-12-02 05:53:59
When a user taps an overlay, the following code is triggered: func mapView(_ mapView: GMSMapView, didTap overlay: GMSOverlay) { } I wonder if we can extract the exact LAT and LONG coordinates of the overlay that has been tapped? Thanks! To solve this we need the 2 methods together, So I combined them in a way I hope it will help in this issue: func mapView(_ mapView: GMSMapView, didTap overlay: GMSOverlay) { print(overlay) } func mapView(_ mapView: GMSMapView, didTapAt coordinate: CLLocationCoordinate2D) { print(coordinate) for polyline in polylines { if GMSGeometryIsLocationOnPath(coordinate,

Google Maps animateToCameraPosition iOS7 issue

橙三吉。 提交于 2019-12-02 04:53:05
I am trying to install Google Maps API to an app for iOS7. After following Google's guidelines and videos I ended up with the following error: [GMSMapView animateToCameraPosition:]: unrecognized selector sent to instance 0x10b98e6c0 I am using Storyboard, and trying to make this map appears above a TableView in the same viewController. In this app, I use Parse, which is fetching data to my TableView, and is working fine. I tried to use a couple of suggestions which I found here on StackOverflow, but the problem persists: Cannot put a google maps GMSMapView in a subview of main main view? How