mapkit

Custom annotations with same image

醉酒当歌 提交于 2019-12-24 11:44:38
问题 As you can see in the image below that all annotations have same image and discount which is not correct, they should have different image and discount . How can I fix this? I am using a custom annotation class with discountStr and 'imgPathStr' property and the following code. -(void) connectionDidFinishLoading: (NSURLConnection *) connection { [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; _adResultDict = [NSJSONSerialization JSONObjectWithData:_adResultData options

Setting map along with user current location for osx

自古美人都是妖i 提交于 2019-12-24 09:15:11
问题 Greeting pros, As I know we can make a map by using google map api for IOS like the code below here. import UIKit import GoogleMaps /* For cocoa: Import Cocoa Import MapKit */ class ViewController: NSViewController, CLLocationManagerDelegate { @IBOutlet var mapView: MKMapView! var locationManager = CLLocationManager() var didFindMyLocation = false var strForCurLatitude = ""; var strForCurLongitude = ""; var currentLocation = locManager.location! override func viewDidLoad() { super.viewDidLoad

Calculate bearing in MKMapView gives wrong value while crossing 180 meridian

徘徊边缘 提交于 2019-12-24 08:42:05
问题 I need to draw lines to demonstrate transportation of goods on apple maps. To clarify start- and end-point, I draw a little arrowhead on the destination side.The arrowhead is drawn separately but it is reversed in one case. >-->-->-->- instead of <--<--<--<- I am using MKMapView and MKPolyline to draw lines. I am using MKOverlay to add direction arrows. The steps I follow are, calculate bearing of Source : CLLocationCoordinate2D(latitude: -33.8392932, longitude: 151.21519799999999)

Calculate bearing in MKMapView gives wrong value while crossing 180 meridian

别等时光非礼了梦想. 提交于 2019-12-24 08:40:06
问题 I need to draw lines to demonstrate transportation of goods on apple maps. To clarify start- and end-point, I draw a little arrowhead on the destination side.The arrowhead is drawn separately but it is reversed in one case. >-->-->-->- instead of <--<--<--<- I am using MKMapView and MKPolyline to draw lines. I am using MKOverlay to add direction arrows. The steps I follow are, calculate bearing of Source : CLLocationCoordinate2D(latitude: -33.8392932, longitude: 151.21519799999999)

Remove MKAnnotationView Default Callout From View

北战南征 提交于 2019-12-24 06:47:35
问题 I am trying to prevent MKMapKit from presenting the default annotation callout when tapping on a marker displayed on a MKMapView without blocking the delegate call / interaction of the annotation (seen below). - (void)mapView:(MKMapView *)mapView didSelectAnnotation:(MKAnnotationView *)view { // Custom callout initialized & presented here . . . } I understand you may disable the callout from showing entirely someAnnotationView.canShowCallout = NO; or (more of a hackish approach) not setting

iphone - Hide the annotation view in map view

左心房为你撑大大i 提交于 2019-12-24 05:03:40
问题 In my view, i've nav bar at the top and remaining view is filled with map view. My Map view has pins and on click of pin, it will show annotations also. In the top right nav bar i've a button and on click of it, i want to remove the annotation view that popped up. (what ever annotation view is there, i want to remove from the view). Can some one tell me how to do it. The simple task we can do is to send some touch event to the map view which will hide it..... am i right. how to do it? 回答1: To

unrecognized selector isPitched called

北城以北 提交于 2019-12-24 05:01:14
问题 In my app, I am displaying a map with annotations, and the user can browse the list of annotations in a table view (in a modal view controller). I am experiencing a weird bug that I can reproduce both on device and in the simulator (iOS 7 & 8). When in pitched mode, if I try to select an item in my POI table view, it does one of these : changes the map center to a random point on the map, not the selected annotation. crashes with the message that I put under (NSZombies enabled). -[_

ReverseGeoCoder Fail Error in Mapkit

你说的曾经没有我的故事 提交于 2019-12-24 02:59:10
问题 I am making the ReverseGeoCoder request with the following latitude and longitude Latitude = 37.296740 Longitude = -122.001878 I am getting an error as "/SourceCache/ProtocolBuffer/ProtocolBuffer-19/Runtime/PBRequester.m:446 server returned error: 503" With the ReverseGeoCoder fail message as "Error Domain=PBRequesterErrorDomain Code=6001 "Operation could not be completed. (PBRequesterErrorDomain error 6001.)" This is my piece of code : // Implement viewDidLoad to do additional setup after

Batch Geocode MKLocalSearchResponse

孤人 提交于 2019-12-24 01:33:06
问题 I have a search setup that displays the response of a MKLocalSearchRequest in UITableVIew I want to clean up all the responses from the response of each search. Here is my shot at accomplishing this so far, inspired by this post Multiple Locations on Map (using MKMapItem and CLGeocoder) Here is my code. @interface ViewController () <UISearchBarDelegate,UISearchDisplayDelegate,UITextFieldDelegate> @property (nonatomic, strong) UISearchDisplayController *searchController; @property (nonatomic,

Difficulties understanding MapKit Coordinate System

梦想的初衷 提交于 2019-12-24 00:55:37
问题 I read the apple docs "A map point is an x and y value on the Mercator map projection" A point is a graphical unit associated with the coordinate system of a UIView What is the difference logically between a Point and a MKPoint? I obviously need CGPoint to display something on the screen. So why does MapKit need MKMapPoint? 回答1: The fact that both the CGPoint and MKMapPoint structs happen to store two floating-point values named x and y is irrelevant. They are given different names because