mapkit

Showing Specific Region Using MapKit

风格不统一 提交于 2019-11-26 20:45:56
问题 I want to know is it possible to show only specific region on map not the full world map using Map Kit. Like if i want to show Asia map in my application then map kit hides remaining part of the map. 回答1: To handle the "map kit hides remaining part of the map" requirement, one thing you can do is create a black polygon overlay that covers the whole world with a cutout over Asia (or wherever you like). For example, where you initialize the map (eg. in viewDidLoad): CLLocationCoordinate2D

Finding Path/Route Between two points on MapKit in iPhone

前提是你 提交于 2019-11-26 20:25:17
I am trying to find the path between two locations on Mapkit. All I have is two locations. Now I have to find the exact path between these points and draw a line between these points using MapKit. I have gone through several examples in which they are using .csv files. In that .csv file they have stored the latitude and longitude values of the full path and drawing line based on those values. But here I am trying to draw a line without knowing the path. So is there any way to find the path dynamically and draw a line? Below is the code to finds path & draws line between two locations. To

Learn about the NSXMLParser in iOS

眉间皱痕 提交于 2019-11-26 20:21:14
问题 I learn about current NSXMLParser. I read many tutorials but none could tell me exactly how it works. there is a tutorial on StackOverflow? My problem is this KML read structur in my app and display with MKMapView My Parser class looks like: #import <Foundation/Foundation.h> @interface Parser : NSXMLParser @property (nonatomic, strong) NSString *rowElementName; // this is the element name that identifies a new row of data in the XML @property (nonatomic, strong) NSArray *attributeNames; //

Customize MKAnnotation Callout View?

北城以北 提交于 2019-11-26 19:40:13
I have a MKPointAnnotation : let ann = MKPointAnnotation() self.ann.coordinate = annLoc self.ann.title = "Customize me" self.ann.subtitle = "???" self.mapView.addAnnotation(ann) It looks like this: How can I customize this callout view to create my own view instead of the predefined one? It should first be noted that the simplest changes to the callout are enabled by simply adjusting the properties of the system provided callout, but customizing the right and left accessories (via rightCalloutAccessoryView and leftCalloutAccessoryView ). You can do that configuration in viewForAnnotation . In

Custom MKAnnotation callout bubble with button

泪湿孤枕 提交于 2019-11-26 19:39:11
I'm developing app, where user is localized by gps and then he is asked, whether he is located in specific place. To confirm this, callout bubble is presented to him straight away, asking him, if he is at specific place. As there is alot of similar questions, I was able to do custom callout bubble: My problem: button is not "clickable" My guess: because this custom callout is higher than standard callout bubble, I had to place it in negative "frame", therefore button cannot be clicked. Here is my didSelectAnnotationView method - (void)mapView:(MKMapView *)mapView didSelectAnnotationView:

How to display an image on a MKOverlayView?

≡放荡痞女 提交于 2019-11-26 19:38:04
问题 UPDATE: Images who are projected on the MKMapView using a MKOverlayView use the Mercator projection, while the image that I use as input data uses a WGS84 projection. Is there a way to convert the input image, to the right projection WGS84 -> Mercator, without tiling the image up and can it done on the fly? Normally you could convert a image to right projection using the program gdal2tiles. The input data however changes every fifteen minutes, so the image has to be converted every fifteen

iOS 8 Map Kit Obj-C Cannot Get Users Location

瘦欲@ 提交于 2019-11-26 19:36:06
I am working with Map Kit in iOS 8 using Obj-C NOT SWIFT. I cannot get the device location it is set a 0.00, 0.00 and I am getting the error: Trying to start MapKit location updates without prompting for location authorization. Must call -[CLLocationManager requestWhenInUseAuthorization] or -[CLLocationManager requestAlwaysAuthorization] first. I have implemented: ( I have tried only one at a time and no luck ) if(IS_OS_8_OR_LATER) { [self.locationManager requestWhenInUseAuthorization]; [self.locationManager requestAlwaysAuthorization]; } [self.locationManager startUpdatingLocation]; And in

Detecting touches on MKOverlay in iOS7 (MKOverlayRenderer)

六月ゝ 毕业季﹏ 提交于 2019-11-26 19:29:54
问题 I have an MKMapView with possibly hundreds of polygons drawn. Using MKPolygon and MKPolygonRenderer as one is suppose to on iOS7. What I need is a way of acting upon the user touching one of the polygons. They represent an area on the map with a certain population density for example. On iOS6 the MKOverlays were drawn as MKOverlayViews so touch detection was more straightforward. Now using renderers I don't really see how this is suppose to be done. I'm not sure this will help or is even

Calculating tiles to display in a MapRect when “over-zoomed” beyond the overlay tile set

微笑、不失礼 提交于 2019-11-26 19:21:21
问题 I am working on an app that uses MKOverlay views to layer my own custom maps on top of the Google base map. I have been using Apple's excellent TileMap sample code (from WWDC 2010) as a guide. My problem - when "overzoomed" to a level of detail deeper than my generated tile set, the code displays nothing because there are no tiles available at the calculated Z level. The behavior I want - when "overzoomed" the app should just keep magnifying the deepest level of tiles. It is a good user

Zoom in a MKMapView programmatically

不想你离开。 提交于 2019-11-26 19:10:05
问题 I'm using a MKMapView inside an iPhone app. When I click a button the zoom level must increase. This is my first approach: MKCoordinateRegion zoomIn = mapView.region; zoomIn.span.latitudeDelta *= 0.5; [mapView setRegion:zoomIn animated:YES]; However, this code had no effect, since I didn't update the longitudeDelta value. So I added this line: zoomIn.span.longitudeDelta *= 0.5; Now it works, but only sometimes. The latitudeDelta and longitudeDelta don't change in the same way, I mean, their