mapkit

Speed up addAnnotations from Google Geocoding?

一个人想着一个人 提交于 2019-12-23 04:43:38
问题 I have the following code in my app which adds a number of Annotations to a mapview via Google geocoding: for (PlaceObject *info in mapLocations) { NSString * addressOne = info.addressOne; NSString * name = info.name; NSString * address = [addressOne stringByAppendingString:@",London"]; NSError * error; NSString *urlString = [NSString stringWithFormat:@"http://maps.google.com/maps/geo?q=%@&output=csv", [address stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; NSString

Use GOOGLE maps in iOS supporting iOS 6 and also iOS 5

泪湿孤枕 提交于 2019-12-23 03:44:08
问题 I am in a need of having maps support for an app, but the concern is prior to ios 6 the iOS mapKit uses the google maps which is rich in content, but in iOS 6 its using its own maps which is not that rich in content. I have search for the Google API for ios 6, which is great but I need to support prior to ios 6 also. Please help. 回答1: The new Google Maps SDK for iOS supports back to iOS 5.1, see here: https://developers.google.com/maps/documentation/ios/intro#supported_platforms 来源: https:/

Drawing a circle on mapkit

空扰寡人 提交于 2019-12-23 03:21:29
问题 I got to draw a circle on my map, it has to be about 1,8 miles centered on a point.. How can I do it? 回答1: Basically you need to do 2 steps: Create MKCircle object using circleWithCenterCoordinate:radius: method and add it to your mapView (using addOverlay: method) In mapView delegate implement mapView:viewForOverlay: method, create and setup MKCircleView instance there and return it If you have different overlay types you may need to perform some type-checks in delegate method to create

How to handle touch gestures in SwiftUI in Swift UIKit Map component?

匆匆过客 提交于 2019-12-23 02:28:39
问题 I tried to handle Map UIKit component gestures in SwiftUI application. Xcode shows this warning: "String literal is not a valid Objective-C selector" // Binding to UIKit component import SwiftUI import MapKit struct MapView: UIViewRepresentable { class Coordinator: NSObject, MKMapViewDelegate { @Binding var selectedPin: MapPin? init(selectedPin: Binding<MapPin?>) { self._selectedPin = selectedPin } func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) { guard let pin = view

Routing, polylines in iPhone Google Maps

落爺英雄遲暮 提交于 2019-12-23 01:42:14
问题 In our iPhone app we need to draw a route on Google Maps (GMaps is the only option, we can't consider other maps). We draw the route while the user walks around - GPS tracking basically. Then we display all saved routes on the map. The problem is that Google Maps is almost unusable. It is impossible to scroll the map, zoom it (everything is extremely slow). Now we draw the route on a transparent layer [UIColor clearColor] in the method - (void)drawRect:(CGRect)rect which is called using [

Equivalent Objective-C code for Google Maps GMap2.getBoundsZoomLevel(bounds)?

时间秒杀一切 提交于 2019-12-23 01:18:12
问题 I'm familiar with the Google Maps API and I'm trying to learned the iOS MapKit library now. I have an iPhone application which takes an input string and geocodes it using Google Maps geocoder service. I also want to set an appropriate zoom level for the new map but I'm not quite sure how to do it. After reading, Determining zoom level from single LatLong in Google Maps API My plan was to parse the JSON response from the Google Maps API and extract the ExtendedData field. "ExtendedData":{

Draw polyline between given points on the map

为君一笑 提交于 2019-12-22 18:22:05
问题 I am implementing an iOS application, and I want to draw a polyline between several given coordinates on the map. I wrote the code and got the polylines being drawn from my point reaching an infinite point. In other words the beginning point of the line starts from the my given lat and long point, but the end of the line is infinite and not the other point. This is my code... I filled the coordinates in a NSMutableArray called routeLatitudes . The array cells are being filled one for latitude

iOS : Why can't I get mapkit to display a custom annotation pin image?

一曲冷凌霜 提交于 2019-12-22 13:56:31
问题 figured that using my own custom pin image for annotations would be super easy. But I have never been able to get it to work, and I have no idea why! I am simply using: - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation { if([annotation isKindOfClass:[MKUserLocation class]]) return nil; NSString *annotationIdentifier = @"CustomViewAnnotation"; CustomAnnotationView * customAnnotationView = (CustomAnnotationView *) [self.mapview

MapKit Display Annotation Clusters and Along With Non-Clustered Annotations

折月煮酒 提交于 2019-12-22 13:02:32
问题 I am new to iOS development and currently using the FBAnnotationClusteringSwift to cluster makers. My app needs to have two annotations which will not be clustered, as they indicate the source and destination addresses. The remaining annotations must be clustered as they represent stations . What I want to achieve is something like the image bellow, where "A" is my source address, and the clusters represent stations: However what is happening is, as the clusters are created , the Annotation

MapKit Display Annotation Clusters and Along With Non-Clustered Annotations

半腔热情 提交于 2019-12-22 13:02:15
问题 I am new to iOS development and currently using the FBAnnotationClusteringSwift to cluster makers. My app needs to have two annotations which will not be clustered, as they indicate the source and destination addresses. The remaining annotations must be clustered as they represent stations . What I want to achieve is something like the image bellow, where "A" is my source address, and the clusters represent stations: However what is happening is, as the clusters are created , the Annotation