mkmapview

MKMapView: Getting the relative zoom ratio?

余生长醉 提交于 2020-03-15 03:30:42
问题 I need to get some kind of scaling factor which tells me by how much the map has zoomed (whenever the region changes). My first idea was to use the span's delta latitude or longitude values. I would keep a track of the 'old' value and then update the value when the map region changes and compare the ratio with the old value. I'm using the following delegate method: - (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated { // Get the new value CLLocationDegrees newdlat =

MKMapView: Getting the relative zoom ratio?

天大地大妈咪最大 提交于 2020-03-15 03:27:28
问题 I need to get some kind of scaling factor which tells me by how much the map has zoomed (whenever the region changes). My first idea was to use the span's delta latitude or longitude values. I would keep a track of the 'old' value and then update the value when the map region changes and compare the ratio with the old value. I'm using the following delegate method: - (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated { // Get the new value CLLocationDegrees newdlat =

iPhone MKMapView : the map can’t load completely

老子叫甜甜 提交于 2020-02-07 05:29:10
问题 I don't know what's make wrong, my map can load, but the image on the map is not completely load. plx help. thz a lot. Here is the simulate map from the iPhone: (Added more example image.) http://img689.imageshack.us/img689/8476/screenshot20100309at841.jpg alt text http://e.imagehost.org/0508/Screen_shot_2010-03-09_at_8_58_12_PM.jpg Here is the code: MKCoordinateRegion theRegion; MKCoordinateSpan theSpan; theSpan.latitudeDelta = 0.005; theSpan.longitudeDelta = 0.005; theRegion.center =

How I can center the map on user's location in swift?

烈酒焚心 提交于 2020-02-03 04:49:09
问题 I'm writing an app and I have an embedded mapview to show user's his location. This is my code so far: class YourCurrentLocation: UIViewController, CLLocationManagerDelegate { @IBOutlet weak var mapView: MKMapView! var locationManager = CLLocationManager() let regionRadius: CLLocationDistance = 1000 func checkLocationAuthorizationStatus() { if CLLocationManager.authorizationStatus() == .AuthorizedWhenInUse { mapView.showsUserLocation = true centerMapOnLocation(locationManager.location!, map:

Smooth resizing of MKCircle

风格不统一 提交于 2020-01-30 04:27:45
问题 How can I achieve a smooth resizing of a MKCircleView on a UIMapView when adjusting an NSSlider? Apple has managed to do it in the Find my friends app when creating geofences (http://reviewznow.com/wp-content/uploads/2013/03/find-my-friends-location-alerts-01.jpg), so I guess it's possible in some way. So far I've tried the following solutions, but with a very "flickery" result: First attempt I added a new MKCircleView with an updated radius and immediately after removing the one that was (as

MKMapView showing blank screen in iOS 8

本小妞迷上赌 提交于 2020-01-29 07:24:04
问题 I am having an issue with displaying a MKMapView in iOS 8. It worked fine in iOS 7 and it is working fine now but only on simulator. On device it shows only annotations but no map behind. It looks like this: http://imgur.com/rBVWTeD The error that I am getting: 2014-09-24 22:07:15.349 xxx[1509:265380] Stylesheet does not include style matching tree, or includes an old version. Perhaps it was compiled by an old version of the style compiler. 2014-09-24 22:07:15.351 xxx[1509:265380] Please

Touch events on MKMapView's overlays

ε祈祈猫儿з 提交于 2020-01-29 03:56:44
问题 In the app I'm currently designing I have a MKMapView with overlays on it (customized MKPolylines btw) and I would like to be able to detect touch events on these overlays and assign a specific action to each overlay. Could any one help me on this one ? Thanks ! Benja 回答1: This can be solved combining How to intercept touches events on a MKMapView or UIWebView objects? and How to determine if an annotation is inside of MKPolygonView (iOS). Add this in viewWillAppear: WildcardGestureRecognizer

MKMapView makes the navigation bar gets transparent

狂风中的少年 提交于 2020-01-29 02:54:25
问题 I am porting my existing iOS 6 application to the new iOS 7. But whenever a MKMapView instance appears into the screen, my navigation bar loses its tint color. Steps to reproduce: Open Xcode; Create a new Master-Detail Application; Add the next line as the first one of the AppDelegate.m didFinishLaunchingWithOptions method: [[UINavigationBar appearance] setBarTintColor:[UIColor redColor]] Add the next line to the MasterViewController.m file: #import <MapKit/MapKit.h> Finally, add the next

iOS6 MKMapView using a ton of memory, to the point of crashing the app, anyone else notice this?

十年热恋 提交于 2020-01-26 09:38:45
问题 Has anyone else, who's using maps in their iOS 6 apps, noticing extremely high memory use to the point of receiving memory warnings over and over to the point of crashing the app? I've ran the app through instruments and I'm not seeing any leaks and until the map view is created the app consistently runs at around ~3mb Live Bytes. Once the map is created and the tiles are downloaded the Live Bytes jumps up to ~13mb Live Bytes. Then as I move the map around and zoom in and out the Live Bytes

Adding UIButton to MKAnnotationView

倖福魔咒の 提交于 2020-01-24 19:43:05
问题 I've a custom class of MKAnnotationView in which I'm trying to add 8 button to the annotation in a circular fashion.I've added the buttons.Their postion in the view is perfectly fine but the action of the buttons doesn't get called.Why the action is not getting called and what is the solution. -(void)setSelected:(BOOL)selected animated:(BOOL)animated` { [super setSelected:selected animated:animated]; if(selected) { UIView *circularView = [[UIView alloc]initWithFrame:CGRectMake(-55, -55, 110,