mkmapview

How to center my current location in MKMapView?

橙三吉。 提交于 2019-12-31 08:52:15
问题 I am showing the current location in MKMapView by using showUserLocation enables. I also want to center the mapview to the user current location and also the zoomed map of location. Please help me regarding this as I don't get any help from other similar questions on stackoverflow. My code is below: - (void)viewDidLoad { [super viewDidLoad]; [mapView setMapType:MKMapTypeStandard]; [mapView setZoomEnabled:YES]; [mapView setScrollEnabled:YES]; [mapView setCenterCoordinate:mapView.userLocation

Adding a pin annotation to a map view on a long press in swift

和自甴很熟 提交于 2019-12-31 08:13:35
问题 I'm trying to make an iPhone app which requires users to be able to long press on a place on a map view to drop a pin there. Does anybody know how this is done? The behaviour is observable in apple maps when you long press on the screen. It will drop a pin and present an annotation saying "dropped pin" 回答1: 1) Instantiate a UILongPressGestureRecognizer and add it to the MKMapView . 2) When the selector gets called after the user has a long press, call the addAnnotation method in MKMapView

MKMapView Off Screen Annotation Image Incorrect

让人想犯罪 __ 提交于 2019-12-31 04:14:05
问题 I have a map to which I add several annotations, like so: for (Users *user in mapUsers){ double userlat = [user.llat doubleValue]; double userLong = [user.llong doubleValue]; CLLocationCoordinate2D userCoord = {.latitude = userlat, .longitude = userLong}; MapAnnotationViewController *addAnnotation = [[MapAnnotationViewController alloc] initWithCoordinate:userCoord]; NSString *userName = user.username; NSString *relationship = user.relationship; [addAnnotation setTitle:userName];

Hiding and disabling user interaction on a MapKit pin?

蹲街弑〆低调 提交于 2019-12-31 03:16:06
问题 I'm trying to hide a pin on a MapKit view, and while setting the hidden property to YES works, I can still tap on it and get didSelectAnnotationView messages!. Naturally, I tried setting userInteractionEnabled to NO , but I'm still receiving the messages. This is what I've tried. a is my annotation view. a.hidden = YES; a.layer.hidden = YES; a.userInteractionEnabled = NO; There's something that I'm missing here, and I've Googled everywhere and can't find anything that works. Any clues? 回答1:

How to display my own map in MKMapView?

扶醉桌前 提交于 2019-12-31 03:08:07
问题 i have a small map of a town, i want to place it into the google map, any idea how to do it ? i am doing so because i need google map to point out user current location. 回答1: Checkout the TileMap example code from Apple 回答2: To display a custom map in MKMapView your custom map needs to be in Keyhole Markup Language (KML). KML is a file format used to display geographic data in an Earth browser such as Google Earth, Google Maps, and Google Maps for mobile. The file can include custom images

KMLViewer Apple's example not working

旧巷老猫 提交于 2019-12-31 02:14:10
问题 I've been searching for quite sometime an answer to my problem with no success. So here it goes... KMLViewer, Apple's example is not working in some cases. After executing the README steps, i've tried to build up a route between Lisboa, Portugal and Porto, Portugal. And here the strangest thing happens. The annotations are built correctly, although the overlay (MKPolyline) does not, it only draws part of the route and it starts drawing in the middle of an "annotation". What am i missing ? You

Moving annotations in MKMapView according to server data (latitude and longitude)

被刻印的时光 ゝ 提交于 2019-12-31 00:48:28
问题 In my app I am showing location of some other person by getting their location (latitude and longitude) from server at particular interval. After getting I have to remove all annotations and drop new annotations based on the server data. But it looks very inefficient as when we have the annotation for the same user previously exists even then I'm removing and adding the same user annotation. So I want to know can we move the MKAnnotation from one coordinate to other? I have tried

Can the memory used by MKMapView be released some how?

家住魔仙堡 提交于 2019-12-30 18:32:12
问题 I am using an MKMapView in my iPhone application. When I load this view, the activity monitor instrument shows that the real memory of my App is increasing significantly. It keeps going up as you move the map around or zoom in and out. Once the View controller that loads this view is removed, the memory that was allocated due to the usage of the mapView does not get freed up. Is there something that can be done to get all this memory back? 回答1: Is this on the simulator, or the actual device?

Why is my map view callout translucent/transparent and how do I change it's color?

 ̄綄美尐妖づ 提交于 2019-12-30 08:13:47
问题 I'm on iOS 7 and I have the following problem. I can't find a clue after some research curiously... I have a map view annotation with left and right accessories but transparent in the middle (default iOS 7 behavior I think). How to change the default translucent/transparent background to any other color I want? 回答1: Is your MKMapView inside a UITableViewCell ? I had a similar issue, where the UITableViewCellSelectionStyle of the cell caused this visual glitch. Setting it to

Pass data to detailView when annotation tapped on mapview

余生长醉 提交于 2019-12-30 07:22:29
问题 I have a map view and there are 10 store locations which data comes via webservice. I just want to push to my detail view to show address, telephone and other informations of the clicked store. I need to pass data to my detailview when user tapped or touch up inside to a annotation on mapkit. There are 10 annotations in my mapview and first I want to know, how can I understand or how can I get the annotationID of which annotation is clicked? this is the method I return pins -