mkmapview

Zoom MKMapView to CLRegion

前提是你 提交于 2019-12-22 10:29:38
问题 I am getting a CLPlacemark using the CLGeocoder on iOS5. Now I would like to take the region (CLRegion object) of a placemark and have my MKMapView zoom to that region, how on earth is this possible? I want the inverse of this, but there seems to be no -locationFromLocationWithDistance: or equivalent method. I'm hoping nobody says you have to use the Haversine formula in reverse because that looks a tad complicated... 回答1: Or, instead of all that math, just use the methods provided for this

Converting View Points to MKMapView Coordinates

笑着哭i 提交于 2019-12-22 10:20:05
问题 My objective is to convert the top left and bottom right points of my view to lat/lon coordinates. These lat/lon coordinates will be used to query annotation locations that only exist within the view (not all 5000+). I found this Objective-C tip on Stackoverflow. But the issue I have is that it is converting 0,0 from the mapView (a lat/lon of -180,-180. Aka, the Southpole). So instead of: topLeft = mapView.convertPoint(CGPointMake(0, 0), toCoordinateFromView: self.mapView) I figured I could

Move MKMapView point to pixel coordinates

我是研究僧i 提交于 2019-12-22 10:17:36
问题 I have a quick question. I am using a custom view as a callout accessory for my map view. I am having some issues with getting the annotation to move to the right bottom corner of the said view. I am currently trying to get the CGPoint coords of the selected annotation, but beyond that I've drawn a blank Any help would be greatly appreciated. The current code I'm using (I know it is incorrect is:) CGPoint bottomLeftPoint = CGPointMake(xOffset,[self.internalAnnotationCallout view].frame.size

How to add annotations to MKMapView asynchronously?

微笑、不失礼 提交于 2019-12-22 09:57:41
问题 I have a lot of annotations to be added to a mkmapview. When i add the annotations, the app freezes for a short period of time. I have understand that the main thread is the only thread allowed to add UI to view, if this is true, how to i make this operation not freeze the app? // in viewdidLoad for (NSManagedObject *object in requestResults) { CustomAnnotation *customAnnotation = [[CustomAnnotation alloc] init]; customAnnotation.title = object.title; customAnnotation.coordinate =

MkMapview setRegion under ios6 snaps to grid like ios5, no precise setRegion possible

一世执手 提交于 2019-12-22 09:14:11
问题 It is well known that using setRegion with MkMapKit under ios5 snaps to the next available Google zoom level, so a precise programatic setting of the map region was not possible (without special tricks, like using transformation matrix on mapView) But for some strange reasons using setRegion or setMapRect under iOS 6.1.3 iphone4 shows the same behavior as in iOS5, although this works on ipad ios6.1.3. iphone4 and simulator can only use regions double or half size from the prevoius one. So

Change map type (hybrid, satellite) via segmented control

不问归期 提交于 2019-12-22 08:51:45
问题 I am trying to change the map type using a segmented control button, I wish for it to change the type of the map with 3 options: Standard, Satellite and Hybrid. So far I have this code but nothing happens once a different map type is selected: @IBAction func segmentedControlAction(sender: UISegmentedControl!) { if sender.selectedSegmentIndex == 0{ mapView.mapType = MKMapType.Standard } else if sender.selectedSegmentIndex == 1{ mapView.mapType = MKMapType.Satellite } else if sender

Adding a subview like UISlider or UIButtom in Google Maps in iPhone

倾然丶 夕夏残阳落幕 提交于 2019-12-22 06:48:07
问题 I am new to iOS Programming and have very little knowledge about COCOA Touch. I am trying to add a button on the screen at the bottom over Google maps for giving an option to the user to go back to the previous screen. I just know that UIButton is a subclass of UIView and we can make button appear on a view by making it the sub view of that class. Previously iOS used to use Google Maps by default by in MKMapView and I have seen examples in books an on the Internet showing screen shots of apps

How I can solve Terminated due to Memory Error

拜拜、爱过 提交于 2019-12-22 06:24:20
问题 I am using MKMapView in my big project . when I load a lot annotation (over 700) and I draw line between those points on MapKit , I am getting xcode error message "Terminated due to memory error" and app is crashing . you can see on image: . I am adding line like this : if I have less than 700 annotation , it's working very well . I am thinking it's have some memory problem . How can I solve this problem ?any advice . // adding annodation for (int i=0; i<[fetcher.locations count]; i++)/

How I can solve Terminated due to Memory Error

时光怂恿深爱的人放手 提交于 2019-12-22 06:23:05
问题 I am using MKMapView in my big project . when I load a lot annotation (over 700) and I draw line between those points on MapKit , I am getting xcode error message "Terminated due to memory error" and app is crashing . you can see on image: . I am adding line like this : if I have less than 700 annotation , it's working very well . I am thinking it's have some memory problem . How can I solve this problem ?any advice . // adding annodation for (int i=0; i<[fetcher.locations count]; i++)/

Increase maximum zoom level on MKMapView

旧巷老猫 提交于 2019-12-22 05:39:16
问题 I have an image overlay on a mkmapview. I can't seem to zoom in the image once i reach the max zoom in values of the map. I still have a lot of zooming in to the image to do. Any ideas? Like how can i change the max zoom in value of the map? 回答1: you can set the zoom level from latitudeDelta and latitudeDelta. MKCoordinateRegion region; region.center.latitude = appDelegate.latitudeString.floatValue; region.center.longitude = appDelegate.longitudeString.floatValue; region.span.latitudeDelta =