Maps and Location

Build maps and location awareness capabilities into your apps.

Posts under Maps and Location tag

135 results found
Post marked as unsolved
76 Views

GPS accuracy

I use navionics boating GD for navigation on Loch Lomond. The last time I was on the boat I forgot to bring my android tablet which is very accurate. So I used the backup apple iphone sx. The heading arrow kept switching heading by about 90 degrees and the location kept moving by about 100m. The night was pitch black and the failure of the GPS made things very difficult. I am wondering if the so called “assisted gps” means the phone tried to use masts first and then defaults to satellite if the mast signals are poor. My android tablet only has satellite and is accurate to a few metres. anyone else having this issue.
Asked
Last updated .
Post marked as unsolved
91 Views

choropleth map is possible in ios

Hello Everyone choropleth map is possible in swift ios app.where we can fill multiple colour and title and handle click event of map for swift app.
Asked
by Juned.
Last updated .
Post marked as solved
152 Views

How to show multiple users location ?

I'm looking for how can I display multiple users in my application, the is question what frameworks can I use or what is the main idea how it works, I started by displaying my location but now I want to display the location of the second users. thanks
Asked
Last updated .
Post marked as unsolved
87 Views

Hello

I have acquired high quality point cloud data / mapping data for a large area (entire mountain), can I use this data to avail of the location anchor feature to build an AR app? i.e. I know Apple have only released this feature for certain US cities, and I am seeing if the feature can be used elsewhere by such a workaround method, i.e. I source the map data from elsewhere.
Asked
Last updated .
Post marked as unsolved
3.2k Views

IconRenderer Warning in Xcode 11.5 / 12.0 beta

Hey. I created an app just with Map Kit View, that fills up the whole screen with constraints 0,0,0,0. When i move the map i can see the IconRenderer warnings. "[Renderer] IconRenderer: HorizontalStretchPadding (18.000000, 18.000000) is larger than the image size (34.000000, 54.000000). Image will now use the center column of pixels to stretch." Any idea how to get rid of them? I do not have any icons in the app.
Asked
by Metaxa.
Last updated .
Post marked as unsolved
1.4k Views

Geocode failed with error: Error Domain=kCLErrorDomain Code=8 "(null)"

hello I want to ask questions about the apple maps, I am using apple map SDK development, according to the coordinates for geographic information (- (void) reverseGeocodeLocation: (CLLocation *) location completionHandler: CLGeocodeCompletionHandler completionHandler;)Introduced into China, and I can get the coordinates of the relevant information, and using the coordinates of the abroad (for example: Russia's coordinates) is to get less than the relevant geographic information.What is this why?
Asked
by xixi007.
Last updated .
Post marked as unsolved
188 Views

How to create a map with MapKit that can show the satellite view

I want to Use the new Method of integrating maps as of summer 2020, but all I can find online is ways of doing it the old way (with UIViewRepresentable). I can't seem to figure out how to make it work without relying on UIViewRepresentable, which comes from the previous version of Swift. I've looked through the documentation but I cannot see anything built in that would allow me to change the type of the map to satellite. Any info on it would be appreciated. Here is what I have now: Swift import SwiftUI import MapKit struct ContentView: View {   @State private var coordinateRegion = MKCoordinateRegion(center: CLLocationCoordinate2D(latitude: 40.7, longitude: -73.9), span: MKCoordinateSpan(latitudeDelta: 100.0, longitudeDelta: 100.0))           @ViewBuilder var body: some View {     Map(coordinateRegion: $coordinateRegion)        } }
Asked
by jorrinct.
Last updated .
Post marked as unsolved
125 Views

MKClusterAnnotation remove animations

hello, is it possible to remove or customize the AnnotationView animation when they "enter" or "leave" a cluster? when I approach a cluster I just want the new AnnotationView to appear without animating the move Any Suggestion ? Thank you.
Asked
by jokeruzzo.
Last updated .
Post marked as unsolved
374 Views

ios 14 Simulator 12.0: missing Location Options (City Run, Freeway Drive, etc.)

Hi, I just upgraded xcode and now simulator does not show location options like city run and freeway drive. Now the only options available are "none" and "custom location". Is there any other way to simulate a "city run" like we used to do before? Simulator: Version 12.0 (940.16) SimulatorKit 597.13 CoreSimulator 732.17 Thanks.
Asked
Last updated .
Post marked as unsolved
131 Views

Working with raster spatial data

Are there any libraries or frameworks for working with raster spatial data? MapKit supports vector data (points, lines, polygons, etc.), but I can't find anything for working on raster spatial data such as remote sensing data or aerial photography.
Asked
Last updated .
Post marked as solved
203 Views

Beginner's question: Transferring MKPointAnnotation title to a new VC

Hello, I am a new to programming (not just to iOS, to all programming). I finished an Udemy course and am now playing around with making a simple mapkit app. I'm hanging on pretty well, but got stuck on transferring an MKPointAnnotation title property to a new VC through a segue. Essentially, I have created a struct for my locations: struct Location { let id = UUID() let name: String let latitude: Double let longitude: Double var isFavorite: Bool var coordinate: CLLocationCoordinate2D { CLLocationCoordinate2D(latitude: latitude, longitude: longitude) } let website: String      } Then I've created an array and filled it with Locations: let places = [ Location(name: "Mordor", latitude: -41.29, longitude: 175, isFavorite: false, website: "http://www.mordor.com"), Location(name: "Lorien", latitude: -41.31, longitude: 174, isFavorite: false, website: "http://www.lorien.com"), ] Then I've populated my map from the array: fileprivate func addLocationToMap() { for place in places { let annotation = MKPointAnnotation() annotation.coordinate = CLLocationCoordinate2D(latitude: place.latitude, longitude: place.longitude) annotation.title = place.name mapView.addAnnotation(annotation) } } Everything works fine -- and more importantly, I understand everything I've done so far. Here's where I am stuck: When I click on an annotation, a new ViewController shows up through a segue. No problem there. What I want to do is to take the title of the annotation, and make it show up as a label (which I have already created, called detailsTitleLabel, taking its title from detailsTitle: String) in the new VC to which I am segueing. Or, to put it another way, what to I put in place of FOO below in order to transfer annotation.title of the clicked annotation (which is the same String as the "name" string from my places array) to the new VC? The code works otherwise -- if I replace FOO with a random string, it gets transferred to the new VC fine, I just don't know how to replace FOO with annotation.title. func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) { self.performSegue(withIdentifier: "toDetailsVC", sender:self) } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "toDetailsVC" { let destinationVC = segue.destination as? DetailsVC destinationVC?.detailsTitle = FOO } } Eventually, the destination VC will go into a navigation controller while everything else is in a tab bar controller, but that's for another time... thankful for any guidance!
Asked
by frostbite.
Last updated .
Post marked as unsolved
224 Views

Custom Annotations are not clustered properly.

For the first time, Mapview renders annotations properly with correct annotation and cluster annotations. After first time, when user Zoom Out or Pans out then will fetch additions hotspots based on the region changes. In this scenario, mapview shows like 5 individual annotations overlapping each other and when I tap on the annotation it merge back and form a cluster annotation. Registering Annotation View Swift      mapView.register(WifiAnnotationView.self, forAnnotationViewWithReuseIdentifier: WifiAnnotationView.reuseID)     mapView.register(ClusterWifiAnnotationView.self, forAnnotationViewWithReuseIdentifier: ClusterWifiAnnotationView.reuseID) SingleAnnotationView Swift class SingleAnnotationView: MKAnnotationView {   static let reuseID = "SingleAnnotationView"   lazy var subTitleLabel: UILabel = {     let subTitle = UILabel()     subTitle.numberOfLines = 0     return subTitle   }()   override init(annotation: MKAnnotation?, reuseIdentifier: String?) {      super.init(annotation: annotation, reuseIdentifier: reuseIdentifier)   }   required init?(coder aDecoder: NSCoder) {     fatalError("init(coder:) has not been implemented")   }   override func prepareForDisplay() {     super.prepareForDisplay()     displayPriority = .defaultLow     canShowCallout = true     subTitleLabel.text = "address goes here"         detailCalloutAccessoryView = subTitleLabel image = UIImage(named: "icon")   } } ClusterAnnotationView Swift class ClusterAnnotationView: MKAnnotationView {   static let reuseID = "ClusterAnnotation"   lazy var subTitleLabel: UILabel = {     let subTitle = UILabel()     subTitle.numberOfLines = 0     return subTitle   }()   override init(annotation: MKAnnotation?, reuseIdentifier: String?) {     super.init(annotation: annotation, reuseIdentifier: reuseIdentifier)     collisionMode = .circle     centerOffset = CGPoint(x: 0, y: -10)   }   required init?(coder aDecoder: NSCoder) {     fatalError("init(coder:) has not been implemented")   }   override func prepareForDisplay() {     super.prepareForDisplay()     if let cluster = annotation as? MKClusterAnnotation {       let totalWifi = cluster.memberAnnotations.count       if totalWifi 0 {         image = UIImage(named: "cluster-icon")         displayPriority = .defaultHigh       }     } }    } View for Annotation: MKMapview Delegate Swift    public func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) - MKAnnotationView? {     switch annotation {     case is HotspotPoint:       let view = mapView.dequeueReusableAnnotationView(withIdentifier: WifiAnnotationView.reuseID, for: annotation)       view.clusteringIdentifier = "WifiAnnotationView"       return view     case is MKClusterAnnotation:       return mapView.dequeueReusableAnnotationView(withIdentifier: ClusterWifiAnnotationView.reuseID, for: annotation)     default:       return nil     }   } Every time we make backend call to fetch additional annotations or new annotations then we remove entire annotations and add the new set of annotations to MapView. Please find the code below for add/remove api Swift mapView.removeAnnotations(mapview.annotations) mapView.addAnnotations([newAnnotations]) Please let what's is going wrong for cluster logic not working properly.
Asked
Last updated .
Post marked as unsolved
127 Views

GPX coordinate injection from iPhone

I am looking for a way to inject coordinate values into a blank GPX file from my iPhone. I have created a basic interface for this but I am unsure how to submit the coordinates into the GPX file. Is there a way to do this? I also want the file to automatically simulate the location as soon as the values are submitted.
Asked
Last updated .
Post marked as unsolved
151 Views

CLGeocoder -> reverseGeocodeLocation giving wrong data

I am using CLGeocoder, CLLocation for reverseGeocodeLocation which is giving me wrong country and country code. I am using Jersey coordinates but it is giving me Country = "United Kingdom" CountryCode = GB My code is - CLGeocoder *geocoder = [CLGeocoder new];   CLLocation *newLocation = [[CLLocation alloc]initWithLatitude:49.184668                             longitude:-2.104771];       [geocoder reverseGeocodeLocation:newLocation           completionHandler:^(NSArray *placemarks, NSError *error) {             if (error) {               NSLog(@"Geocode failed with error: %@", error);               return; // Request failed, log error             }             // Check if any placemarks were found             if (placemarks && placemarks.count 0)             {               CLPlacemark *placemark = placemarks[0];               // Dictionary containing address information               NSDictionary *addressDictionary =               placemark.addressDictionary;               // Extract address information               NSLog(@"%@ ", addressDictionary);             }           }];     And I am getting response - {   City = "St Helier";   Country = "United Kingdom";   CountryCode = GB;   FormattedAddressLines =   (     "25\U201353 Halkett Pl",     "St Helier",     Jersey   );   Name = "25\U201353 Halkett Pl";   State = Jersey;   Street = "25\U201353 Halkett Pl";   SubAdministrativeArea = "St Helier";   SubThoroughfare = "25\U201353";   Thoroughfare = "Halkett Pl";   ZIP = JE2; } Do we have some updates on how can we get Country = "Jersey" & CountryCode = JE Appreciate if any workaround is there.
Asked
Last updated .