mapkit

How to fit a certain bounds consisting of NE and SW coordinates into the visible map view?

久未见 提交于 2019-12-03 08:03:18
I need to fit a certain bounds within a map. I get the bounds from calling the google geocoder and reading the viewport property which looks like: { northeast = { lat = "30.4212235"; lng = "-97.486942"; }; southwest = { lat = "30.1128403"; lng = "-97.99917959999999"; }; } I then convert these into CLLocationCoordinate2D NSDictionary *viewport = [[[results objectAtIndex:0] objectForKey:@"geometry"] objectForKey:@"viewport"]; NSDictionary *NEDictionary = [viewport objectForKey:@"northeast"]; NSDictionary *SWDictionary = [viewport objectForKey:@"southwest"]; CLLocationCoordinate2D SWCoordinate =

MKReverseGeocoder server returned error: 503

痞子三分冷 提交于 2019-12-03 07:45:03
Currently i am developing an iPhone application where i have to show user's current city and location for which i am using Mapkit Framework.When i build the application it works fine and show me the exact city details .But right now when i try to build the application again application shows following error message in my log /SourceCache/ProtocolBuffer_Sim/ProtocolBuffer-26/Runtime/PBRequester.m:523 server returned error: 503 reverseGeocoder: didFailWithError:Error Domain=PBRequesterErrorDomain Code=6001 "Operation could not be completed. (PBRequesterErrorDomain error 6001.)" Is any body

How to follow user location with MapKit

旧城冷巷雨未停 提交于 2019-12-03 07:36:10
问题 I'm using MapKit to display the user's location relative to pins around them. I'd like to be able to mimic the functionality that Maps provides via the crosshair button in the lower left-hand corner of the screen. I'm already aware that MapKit provides a CLLocation object with the user's location via MKUserLocation, I just wanted to seek advice on how I should keep focus on that location. My initial inclination was to use an NSTimer to center the map on that coordinate every 500ms or so. Is

Trying to get the span size in meters for an iOS MKCoordinateSpan

大兔子大兔子 提交于 2019-12-03 07:32:32
问题 When I need to make an MKCoordinateRegion , I do the following: var region = MKCoordinateRegion .FromDistance(coordinate, RegionSizeInMeters, RegionSizeInMeters); very simple - works perfectly. Now I wish to store the value of the current region span . When i look at the region.Span value, it’s an MKCoordinateSpan which has two properties: public double LatitudeDelta; public double LongitudeDelta; How can I convert the LatitudeDelta value into a latitudinalMeters please? (So then I can

How to create a path using MKOverlayPathView?

戏子无情 提交于 2019-12-03 07:19:02
问题 I've been looking at Apple's iOS Class Reference documentation, and am unfortunately none the wiser. I have downloaded their sample code KMLViewer but they've overcomplicated it... All I really want to know is how to generate a path and add it to the MKMapView . The documentation talks of using a CGPathRef , but doesn't really explain how. 回答1: Here's how to generate a path and add it as an overlay to an MKMapView . I'm going to use an MKPolylineView , which is a subclass of MKOverlayPathView

Use MKLocalSearch to search for locations on a map

こ雲淡風輕ζ 提交于 2019-12-03 06:18:49
问题 I want to use MKLocalSearch for searching in a Map. This functionality is available in iOS 6.1+. Does anybody know how to use this or can anybody give an example of how to use an MKLocalSearch ? MKLocalSearchResponse documentation 回答1: The API for MKLocalSearch is fairly easy to understand. At its most basic, you alloc-init an MKLocalSearchRequest Set its naturalLanguageQuery to some search term Use the search request to initialize an MKLocalSearch object Tell the local search to start,

Display MKMapViewAnnotations within a map view's visible rect

佐手、 提交于 2019-12-03 06:16:38
问题 I'm displaying an MKMapView inside a Path-style parallax table view header. To create the effect, the mapView bounds is larger than the area visible to the user. I need to set the map view region such that all the map's annotations are contained within the visible rect of MKMapView. What's the best way to do this? Edit for clarity: Here's a use-case. The mapView size is 320 x 380. The visible area, however, is defined by the rect (0.0, 20.0, 320.0, 100.0). I need to set the region such that

iOS7 Map Kit remove default location icons

允我心安 提交于 2019-12-03 05:52:40
I am wondering if it's possible to remove all the default icons from the map kit . I did a lot of researches and tried a couple of different ways. Couldn't find any way to do this. Don't know if anybody can help us out. It won't get rid of all those icons (I think the road markings will stay) but you can use the iOS 7 MKMapView property showsPointsOfInterest , setting it to NO to remove shops and other icons. [myMapView setShowsPointsOfInterest:NO] From the docs: When this property is set to YES, the map displays icons and labels for restaurants, schools, and other relevant points of interest.

Disable compass on MKMapView

自古美人都是妖i 提交于 2019-12-03 05:30:19
I am using a MapView in my app to show some annotations. In iOS 7 a compass appears randomly on the map. I can't reproduce the error because it appears randomly but I want to disable it. Any ideas how to disable it? Update: I found out is not appears randomly but on a specific gesture. When you use 2 fingers and slide one right and the other left. Mark Amery You can disable the compass easily on OSX 10.9 / iOS 9 and later with the showsCompass property: yourMapView.showsCompass = NO; On iOS 8 or earlier, your choices are: Suck it up and live with it. Use a hack, like: position the map to hide

Showing nearby restaurants in MKMap View

此生再无相见时 提交于 2019-12-03 05:19:35
问题 In my iphone app,I have to show near by restaurants in Map View,Currently I am using Google map url in a web view. But how can I show nearby restaurants with in 5000 meters of current location with native MKMap view(I found out my current location-lat&long) I would like to learn how to implement as in the below screen shot(by clicking the annotations going to its detail too) Any helps ?? thanks in advance 回答1: In iOS 6.1, you can use MKLocalSearch, part of the standard iOS MapKit.framework: