mkmapview

How to extend MKPointAnnotation and add a property to it

冷暖自知 提交于 2019-12-25 06:05:15
问题 I'm trying to extend MKPointAnnotation and add a property to for an NSString called dealLink. I thought I set it up correctly, but I'm getting this error at the moment: Property 'dealLink' not found on object of type 'MKPointAnnotation *' Here's my code in a view controller called MapOffersViewController.m: #pragma mark - Populate Map - (void)populateMap:(MKMapView*)map withDeals:(NSArray*) deals { NSLog(@"Deals " ); for (NSDictionary *currentDeal in deals) { CLLocationCoordinate2D ctrpoint;

NSSet containsObject Not Working?

99封情书 提交于 2019-12-25 05:08:09
问题 I am trying to check if the annotation exists before adding it to array. I can't figure out why [visibleAnnotations containsObject:annotation] always returns False. MKMapRect mRect = self.locationView.visibleMapRect; NSSet *visibleAnnotations =[self.locationView annotationsInMapRect:mRect]; NSLog(@"Annotation in Rect %@",visibleAnnotations); for(NSArray * obj in JSON){ coordinates.latitude=[[obj valueForKey:@"Latitude"] doubleValue]; coordinates.longitude=[[obj valueForKey:@"Longitude"]

UIMapView iPad - Address look up

烂漫一生 提交于 2019-12-25 03:45:36
问题 Our app has addresses like "123 Main St, Perth, Wa, 6554, Australia" We need to display a map with that address. Is there a way to get the UIMap view to lookup the address and display? Normally we'd have the Lat/Long and would just put that in with a pin annotation. 回答1: You can use Google's Geocoding Api to first get Lat/Long for the address, and then load that in UIMapView. 来源: https://stackoverflow.com/questions/6421493/uimapview-ipad-address-look-up

Seeing MKAnnotation Coordinates During Drag

女生的网名这么多〃 提交于 2019-12-25 03:14:11
问题 I want to be able to track the coordinates of my MKAnnotation as I drag it. Currently, I am only getting the coordinates as the drag begins. I have tried implementing a custom MKAnnotationView subclass with touchesMoved , however this appears not to work. (As suggested here: Obtaining MKAnnotation's coordinate while dragging.) By receiving the new coordinates as I drag my annotation, I will in turn be able to update my polygon shape. 回答1: You can track the coordinates from MKAnnotationView .

Search on Google Map Sdk

∥☆過路亽.° 提交于 2019-12-25 02:59:16
问题 I need to implement the map view in my app to locate the required place. I had tried with the SVGeocoder concept. [SVGeocoder geocode:searchfield.text completion:^(NSArray *placemarks, NSHTTPURLResponse *urlResponse, NSError *error) { } But suppose I am trying to search any restaurent then the result is nil. I was looking on Google map sdk but don't know how to do search functionality on GMSCameraPosition class. GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:latitude

How to capture Tap gesture on MKMapView

筅森魡賤 提交于 2019-12-25 02:15:54
问题 I am trying to capture tap event on my MKMapView , this way I can drop a MKPinAnnotation on the point where user tapped. Basically I have a map overlayed with MKOverlayViews (an overlay showing a building) and I would like to give user more information about that Overlay when they tap on it by dropping a MKPinAnnotaion and showing more information in the callout. Thank you. 回答1: You can use a UIGestureRecognizer to detect touches on the map view. Instead of a single tap, however, I would

MKMapview don't show map in iOS-7.0 in simulator

筅森魡賤 提交于 2019-12-25 02:13:47
问题 I am using MKMapView in my application. i need to show current location on Map. When i am showing it on iOS 6.0 or 6.1, it is working fine. On iOS 7.0, Map is not appearing properly. have a look of map in iOS 7.0 - Can anyone suggest why map's background is not appearing here, is there any extra approach form iOS 6.0, we will have to perform to show map in simulator in iOS-7.0 ? 回答1: Simulator will not show user current location no matter whether it is iOS 6, 6.1 or iOS 7. To simulate

Prevent replacing of WMS Overlay while adding Polygon or Polyline to MKMapView

风格不统一 提交于 2019-12-25 00:32:33
问题 I have implemented Web Map Service in the MKMapView by subclassing the MKTileOverlay & rendering it using MKTileOverlayRenderer . It works fine and displays the custom map properly. When I call method like mapView.addOverlay(polyLine) to add Polyline or Polygon. The WMS overlay gets replaced with the Apple Maps overly. // Set up the overlay and adds it to MKMapView. func setupTileRenderer() { let wmsURL = formTemplate?.wmsURL let overlay = WMSTileOverlay(urlTemplate: wmsURL) overlay

Annotation Clustering in iPhone MKMapView

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 22:26:31
问题 I want to use clustering in MKMap but not by using 3rd party framework. So for that I download the code from https://developer.apple.com/library/ios/samplecode/PhotoMap/Introduction/Intro.html but I found that when I am rotating and zooming the map randomly it got stuck. if you have any other demo then please help me. 回答1: I just encountered the problem in that example code too. The existing code doesn't work with maps that can be rotated. There are two situations that lead to very long or

How to recenter map in iPhone app on zoom in/out using MKMapView

北战南征 提交于 2019-12-24 22:19:39
问题 I am developing an iPhone application in which I need to show an image at a specific Latitude & Longitude on a Map. The requirement is - Even if the user zooms in or out on this map screen, the map control should automatically center itself after the zoom, to the same Lat & Long. I am using MKMapView. I have tried to go through all available documentation. However, I could not come across any callback or other method that will allow me to achieve the objective. One alternative is to handle