mapkit

remove borders in mapkit

流过昼夜 提交于 2019-12-11 14:11:48
问题 I'm using Mapkit for an ios application, and i want to remove Borders between countries. I found a javascript code that allows to make it using natively the google maps api: [ { featureType: "administrative.country", stylers: [ { visibility: "off" } ] } ] To do it using mapkit, is there any solution please?? Thank you 回答1: Short answer: No, not really (except you set maptype to MKMapTypeSatellite ). Long answer: There is no public API in MapKit to remove country borders. And I guess It is

iPhone MapKit: Custom MKPolygonView with image draws upside down

北战南征 提交于 2019-12-11 13:56:46
问题 does anybody know what to do with this problem: my image in a custom MKPolygonView is flipped upside down? The idea (this is working OK already) is having an class "SnowmapsOverlayView" that extends "MKPolygonView", that displays a image. This image has a default location & size on the map (acts as a GroundOverlay in the Google Maps web API). This is all working fine, but the image is displayed upside down. I've tryed the following options, but with no result: CGContextDrawImage draws image

Swift: “mapView.showUserLocation = true” returns “fatal error: unexpectedly found nil while unwrapping an Optional value (lldb) ”

人走茶凉 提交于 2019-12-11 13:22:17
问题 So I'm trying to search for local businesses in Swift using keywords like "bar", or "pizza". I linked the search to a button action so that the locations will pop up on the map within a defined region. However, I can't even get the application to load with user location because I get a nil error. Here's my AppDelegate: import UIKit import CoreLocation @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? var locationManager: CLLocationManager? func

How to drag annotation pin in a mapview?

南笙酒味 提交于 2019-12-11 13:15:43
问题 I have an initial dropped pin in Map View. What I want to accomplish is to drag that pin anywhere within the map and get the new coordinates from that pin. How to do that? What should I add? I have this method where I do the initial drop pin. - (void) performSearch { MKLocalSearchRequest *request = [[MKLocalSearchRequest alloc] init]; request.naturalLanguageQuery = _searchString; request.region = _mapView.region; _matchingItems = [[NSMutableArray alloc] init]; MKLocalSearch *search = [

Swift - Coordinate is unavailable: APIs deprecated as of iOS 7

僤鯓⒐⒋嵵緔 提交于 2019-12-11 12:48:08
问题 I'm trying to iterate through an array of annotations by getting by self.mapView.annotations . The issue I'm having is that i'm getting an error because Coordinate is unavailable: APIs deprecated as of iOS 7 and earlier are unavailable to Swift . Any ideas how I can fix this? I have a look at the iOS developer library but I couldn't find any way of getting the coordinate for each annotation. var zoomRect:MKMapRect = MKMapRectNull; for (index,annotation) in enumerate(self.mapView.annotations)

Dynamically changing lineWidth using UISlider?

∥☆過路亽.° 提交于 2019-12-11 11:42:59
问题 I have imported the CrumbPath.h & .m and CrumPathView.h & .m into my project from the Sample code provided by Apple. It is working fine, until I want to control the lineWidth of the CrumbPath, In a previous question we solved how to use value from 'Sliderchanged' to populate the 'CGFloat lineWidth =' Linked here: Use value from UISlider to change another variable? Now I have hit the problem that the line is not showing at all in the simulator... CrumbPathView.m #import "CrumbPathView.h"

Why is double tap still being picked up in this IOS code?

此生再无相见时 提交于 2019-12-11 11:37:42
问题 Background - I have a map (MapKit) with a callout (custom view added to an annotation view) - I have managed to ensure that the "long press" gesture made over the callout view does not get picked up (see below, using "shouldReceiveTouch") Issue What I can't do is do the same thing (i.e. ignore) a double-click over the callout view, in that the MapKit map still somehow picks this up and zooms in. I've tried putting the Double Tap gesture in to trap it however it doesn't seem to be working.

How to add an image for each customized annotation on MapView?

。_饼干妹妹 提交于 2019-12-11 11:08:06
问题 I have a class of Picture which contains latitude and longitude and image of each location. I want to add them as annotation to the MapView and show its image instead of pin for those locations. I have a customized annotation which is: @interface Annotation : MKAnnotationView <MKAnnotation> @property (nonatomic,assign) CLLocationCoordinate2D coordinate; @property (nonatomic,copy) NSString *title; @property (nonatomic,copy) NSString *subtitle; @property (nonatomic,retain) UIImage *image; @end

write text in drawRect MKPolygonRenderer

[亡魂溺海] 提交于 2019-12-11 10:18:17
问题 Ok I'm at my wits end. I'm new to MapKit and writing a health stats app that plots data on a MKMapView relative to where patients live. I can drop annotations, and draw polygons of postcode areas with no problem. However I'd like to write text on the map polygon (and not an annotation). Here's my code, I've subclassed MKPolygonRender to access drawRect. Polygons are perfect but no text. I've tried write to the first point in the polygon (I will find centre eventually) Been stuck for several

Swift + didUpdateUserLocation not getting called

倖福魔咒の 提交于 2019-12-11 09:59:51
问题 I am not able to call MKMapView delegate method didUpdateUserLocation . What I did so far: Add framework MapKit.framwork in project Import framework in view controller by import MapKit line Add key in plist file <key>NSLocationAlwaysUsageDescription</key> <true/> Code in view controller Added delegate didUpdateUserLocation method to check location is updated or not but never called. // MARK: - MapView delegate methods func mapView(mapView: MKMapView!, regionDidChangeAnimated animated: Bool) {