Maps and Location

RSS for tag

Build maps and location awareness capabilities into your apps.

Posts under Maps and Location tag

83 Posts
Sort by:
Post not yet marked as solved
0 Replies
203 Views
Is there a way to display the temperature only at a users location in SwiftUI please?? I have been browsing for a solution but can't locate anything that seems to suit this purpose. I have an API with Openweathermap.org.
Posted
by Ghard123.
Last updated
.
Post not yet marked as solved
12 Replies
4.5k Views
When Submitting new App version for Review, the status changed to Invalid Binary and I got an email saying the following: We identified one or more issues with a recent submission for App Store review for your app, ****************. Please correct the following issues, then upload again. ITMS-90118: Invalid routing app setting: To upload a routing app coverage file on App Store Connect, you must define the app binary as a routing app.
Posted
by thanhtu.
Last updated
.
Post not yet marked as solved
0 Replies
368 Views
I am able to load KML on Google map with below code. But now I want to show .KMZ file on Google map. I did unarchived it & added Folder containing doc.kml & Files folder which comntains 1 image, & tried to show doc.kml file on Google map.But didn't succeeded. func showKMLFile(kmlfileurl:URL) { print("fileURL in show is \(kmlfileurl)") var renderer: GMUGeometryRenderer! var kmlParser: GMUKMLParser! if self.mapView != nil { kmlParser = GMUKMLParser(url:kmlfileurl) kmlParser.parse() renderer = GMUGeometryRenderer(map: self.mapView, geometries: kmlParser.placemarks, styles: kmlParser.styles) renderer.render() } } & I am calling this function like let fileManager = FileManager.default do { let docsArray = try fileManager.contentsOfDirectory(atPath: docsPath) print("docarray is \(docsArray)") for obj in docsArray{ if obj == "doc.kml" { self.showKMLFile(kmlfileurl: URL(fileURLWithPath: docsPath + "/" + "FAIRMEAD LF" + "/" + obj)) } } } catch { print(error) }
Posted
by PAGaikwad.
Last updated
.
Post marked as solved
1 Replies
272 Views
My team is working on a social networking application that will suggest connections to users based on their locations. The users will be able to adjust their search radius in miles. Is there a minimum distance radius allowed by Apple Developer for applications? Example 15 miles or 30 miles
Posted
by johnd3.
Last updated
.
Post not yet marked as solved
0 Replies
202 Views
Hello All! We are building an app and want to have the user's navigation status and route be shared with our app. Is there currently a way to do this on iOS? For Example, if a user starts navigation within Apple Maps, we want to observe the location, route, and end destination from our app. Very similar to share ETA, but sharing with another app instead of another person. For context, we want our app to know where a user is going and if they are currently using Apple Maps to navigate. Our app will (hopefully) be able to alert users of potential carpool riders they could pick up, once they have started navigation with Apple Maps. On Android there are system APIs that share navigation event details with other apps, but I can't find anything on iOS. Other than building some type of service that a user could share their ETA with, which would be clunky as it would need to be an SMS send to a contact in their phone, is there a system API, or iOS Maps App API I'm missing?
Posted Last updated
.
Post not yet marked as solved
1 Replies
375 Views
In SwiftUI, when creating an annotation on a Map, there's no way to move an existing Annotation after it's been placed on a Map. Example: import SwiftUI import MapKit struct AnnotationItem: Identifiable { var id: UUID var coordinate: CLLocationCoordinate2D } struct MapTest: View { @Binding var annonations: [AnnotationItem] var body: some View { Map( coordinateRegion: $region, annotationItems: annotations ) { annotation in MapAnnotation( coordinate: annotation.coordinate ) { Circle() .foregroundColor(.blue) .frame(width: 12, height: 12) } } } .frame(width: 500, height: 500) } } extension MapTest { class ViewModel: ObservableObject { @Published var annotations: [AnnotationItem] = [ AnnotationItem( id: UUID(), coordinate: .init(latitude: 0, longitude: 0) ) ] // Doesn't move the annotation func moveTest1() { annotations.first?.coordinate = .init(latitude: 1, longitude: 1) } // Moves the annotation with a flicker func moveTest2() { annotations = [ AnnotationItem( id: UUID(), coordinate: .init(latitude: 0, longitude: 0) ) ] } } } In this example, the function move1() doesn't have any affect on the annotation, even though I think it should. The function move2() moves the annotation, but has a flicker effect because it's creating a new AnnotationItem with a new UUID and replacing the old one. Is this a bug? Or is there no way to smoothly animate an annotation from one location to another?
Posted
by huajason.
Last updated
.
Post not yet marked as solved
0 Replies
307 Views
I initialize the mapView following the line: MKMapView *mapView = [[MKMapView alloc] init]; and never crash when debugging, but it has occured some times for my users. Here is the stack frame FATAL_SIGNAL SIGSEGV fault_address:0x0000000000000000 Thread 0 name: com.apple.main-thread 0 VectorKit std::__1::__hash_table<std::__1::__hash_value_type<std::__1::shared_ptr<md::LabelImageKey>,std::__1::__list_iterator<md::LabelImageLoader::CachedItem, void*> >,std::__1::__unordered_map_hasher<std::__1::shared_ptr<md::LabelImageKey>,std::__1::__hash_value_type<std::__1::shared_ptr<md::LabelImageKey>,std::__1::__list_iterator<md::LabelImageLoader::CachedItem, void*> >,md::LabelImageLoader::LabelImageCacheHash, true>, std::__1::__unordered_map_equal<std::__1::shared_ptr<md::LabelImageKey>,std::__1::__hash_value_type<std::__1::shared_ptr<md::LabelImageKey>, std::__1::__list_iterator<md::LabelImageLoader::CachedItem, void*> >, md::LabelImageLoader::LabelImageCacheEq, true>,geo::StdAllocator<std::__1::__hash_value_type<std::__1::shared_ptr<md::LabelImageKey>,std::__1::__list_iterator<md::LabelImageLoader::CachedItem, void*> >,mdm::Allocator> >::__rehash(unsigned long) (in VectorKit) 1 VectorKit md::LabelImageLoader::LabelImageLoader(md::LabelManager&) (in VectorKit) 2 VectorKit md::LabelManager::LabelManager(md::WorldType, VKMapPurpose, VKSharedResources*, std::__1::shared_ptr<md::TaskContext>, ggl::RenderTargetFormat const&, float) (in VectorKit) 3 VectorKit std::__1::__shared_ptr_emplace<md::LabelManager, std::__1::allocator<md::LabelManager>>::__shared_ptr_emplace<md::WorldType, VKMapPurpose&,VKSharedResources*&,std::__1::shared_ptr<md::TaskContext>&, ggl::RenderTargetFormatconst&,float&>(md::WorldType&&, VKMapPurpose&, VKSharedResources*&,std::__1::shared_ptr<md::TaskContext>&, ggl::RenderTargetFormat const&, float&) (in VectorKit) 4 VectorKit md::LabelsLogic::LabelsLogic(float,VKMapPurpose, VKSharedResources*, objc_objectobjcproto14MDRenderTarget*,std::__1::shared_ptr<md::TaskContext>) (in VectorKit) 5 VectorKit md::MapEngine::MapEngine(float, float, float, bool, std::__1::shared_ptr<md::TaskContext> const&,VKMapPurpose,std::__1::unique_ptr<md::AnimationManager, std::__1::default_delete<md::AnimationManager> >,geo::linear_map<md::MapEngineSetting, long long,std::__1::equal_to<md::MapEngineSetting>,std::__1::allocator<std::__1::pair<md::MapEngineSetting, long long> >,std::__1::vector<std::__1::pair<md::MapEngineSetting, long long>,std::__1::allocator<std::__1::pair<md::MapEngineSetting, long long> > > > const&, unsigned long long,GEOApplicationAuditToken*) (in VectorKit) 6 VectorKit md::MapEngine::interactiveMapEngine(float, bool, geo::linear_map<md::MapEngineSetting, long long,std::__1::equal_to<md::MapEngineSetting>,std::__1::allocator<std::__1::pair<md::MapEngineSetting, long long> >,std::__1::vector<std::__1::pair<md::MapEngineSetting, long long>,std::__1::allocator<std::__1::pair<md::MapEngineSetting, long long> > > > const&, unsigned long long,GEOApplicationAuditToken*) (in VectorKit) 7 VectorKit -[VKMapView initShouldRasterize:inBackground:contentScale:auditToken:] (in VectorKit) 8 MapKit -[MKBasicMapView initWithFrame:andGlobe:shouldRasterize:] (in MapKit) 9 MapKit -[MKMapView _commonInitFromIB:gestureRecognizerHostView:locationManager:showsAttribution:showsAppleLogo:] (in MapKit) 10 MapKit -[MKMapView initWithFrame:] (in MapKit) Thanks for answer.
Posted
by KiBen.
Last updated
.
Post not yet marked as solved
1 Replies
430 Views
Greetings, I am implementing an app and it has a label that shows user current speed when driving in a car. I did everything to setup location manager and I have made it sure user has provided all the necessary permissions. Apart from that I have set desiredAccuracy as kCLLocationAccuracyBestForNavigation. Now the problem is when am travelling in a car with a much higher speed for example 50 km/hr it shows me the speed is 14 km/hr I have used below code in didUpdateLocations Multiline         var speed: CLLocationSpeed = CLLocationSpeed()         speed = locationManager.location?.speed ?? 0 * 3.6                   if speed > 0{             let speedTxt = String(format: "%.0f km/h", speed)             print(speedTxt)             kmBtn.setTitle("(speedTxt)", for: .normal)         }else{             kmBtn.setTitle("0 Km/h", for: .normal)         } BlockQuote NOTE : Here I have multiplied the speed with 3.6 to convert the value from meterPerSecond to KilometerPerHour Why its not returning the accurate speed and how to get that ?
Posted
by GulamAli.
Last updated
.
Post not yet marked as solved
1 Replies
279 Views
https://developer.apple.com/ibeacon/ indicates "Once you accept the iBeacon license agreement, you’ll receive: Works with Apple iBeacon Badges Works with Apple iBeacon Guidelines Proximity Beacon Specification" But the download link "Download Artwork and Specifications" includes no "Proximity Beacon Specification". Where can we download the "Proximity Beacon Specification"? Thank you.
Posted
by Gurumin.
Last updated
.
Post not yet marked as solved
0 Replies
273 Views
I need an expert to chime in with a solution. I currently find myself with a doubt regarding the Google Map iOS SDK, it's an iOS Front-End Problem. Problem: We need to fetches places around map region. There can be 1000s of places and each place needs to be plotted on map using ground overlay (GMSOverlay). Each place has icon with particular border and marker needs to render both icon and border. Apart from this, each marker is animatable. They can pulsate when they meet certain criteria. Issue we are having: Plotting multiple overlays on map is making app slow. Z-index of the overlay is not working on tap. Even though their visibility is based on z-index, tap action is not performing as expected. I posted the code snippet on the Google Maps iOS Github, check link: https://github.com/googlemaps/maps-sdk-for-ios-samples/issues/118 Here is a video where I describe the slow/stuttering issue in more detail: https://www.youtube.com/watch?v=qJhFrL1QbNg&feature=youtu.be
Posted Last updated
.
Post not yet marked as solved
1 Replies
356 Views
Hi, What would be the recommended UI flow when the user denies a permission that the app requires to function properly? Suppose, the app requires "Location" access and the User presses "Don't Allow" or if the User manually removes the Location Permissions from the Privacy Settings, is there a recommended way to deal with this? I'm aware of the programmatic way to check for a given permission using the App Tracking Transparency framework.
Posted Last updated
.
Post not yet marked as solved
1 Replies
312 Views
Purpose: How to automatically shift from Not Running state to BackGround state and keep BackGround state even without user's operation after the application is forced to close due to lack of memory or user's operation. Current Situation: Even if the app is killed due to lack of memory or user interaction, and the app is in Not Running state, the API of enableBackgroundDelivery (https://developer.apple.com/documentation/healthkit/hkhealthstore/1614175-enablebackgrounddelivery) to detect healthcare data updates. Even if the app is in Not Running status, it will temporarily transition from Not Running to BackGround status by detecting health care data updates using the enableBackgroundDelivery API (). I would like to maintain the BackGround state by starting the location monitoring process when it temporarily becomes BackGround. However, it is not possible to start the location monitoring process in the first place. Is it possible to start the location monitoring process after detecting the update of healthcare data and maintain the BackGround status? Specifically, in the following code, the self.locationManager.start() process cannot be started. let locationManager: LocationManager = LocationManager() func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { let bodyMass = HKSampleType.quantityType(forIdentifier: .bodyMass)! HKHealthStore().requestAuthorization(toShare: nil, read: Set([bodyMass, stepCount]), completion: { success, error in }) let query = HKObserverQuery(sampleType: bodyMass, predicate: nil, updateHandler: { query, completionHandler, error in if error != nil { return } // I'd like to get start CLLocationManager self.locationManager.start() completionHandler() }) HKHealthStore().execute(query) HKHealthStore().enableBackgroundDelivery(for: bodyMass, frequency: .immediate, withCompletion: { success, error in }) return true }
Posted
by jnk123321.
Last updated
.
Post not yet marked as solved
0 Replies
321 Views
0 I am trying to implement input textfield for user to enter 'longitude' and 'latitude' to make annotation on the map. The scenario I want to achieve: When user click 'save' button after filling in both longitude and latitude. The annotation will appear based on the latitude and longitude inputs. I got 2 strings, "savedLong" and "savedLat". Please advice me if Im on the right track to solving my issue. Thank you! I get errors when I replace the Longitude and Latitude values with 'savedLong' and 'savedLat', example below is a portion of my current progress, MyAnnotationItem( coordinate: CLLocationCoordinate2D( latitude: savedLat, //instead of numbers that is able to work longitude: savedLong), //instead of numbers that is able to work color: .green)] Code below will save user input for both Latitude and Longitude, VStack{ TextField("Latitude", text: $textFieldLat) .textFieldStyle(RoundedBorderTextFieldStyle()) .padding() .background(Color.gray.opacity(0.3).cornerRadius(10)) .foregroundColor(.red) .font(.headline) TextField("Longitude", text: $textFieldLong) .textFieldStyle(RoundedBorderTextFieldStyle()) .padding() .background(Color.gray.opacity(0.3).cornerRadius(10)) .foregroundColor(.red) .font(.headline) Button(action: { savedLat = textFieldLat ////<-- saved as latitude to plot savedLong = textFieldLong////<--- saved as longitude to plot }, label: { Text("Save".uppercased()) .padding() .background(Color.gray.opacity(0.3).cornerRadius(10)) .foregroundColor(.red) .font(.headline) }) Text("Lat: "+savedLat+" Long: "+savedLong) Code below is my current progress and is able to run. import MapKit import SwiftUI struct ContentView: View { @StateObject private var viewModel = ContentViewModel() struct AnnotatedItem: Identifiable { let id = UUID() var name: String var coordinate: CLLocationCoordinate2D } private var pointsOfInterest = [ //annotate on map AnnotatedItem(name: "Location A", coordinate: .init(latitude: 5.76123, longitude: 156.52318)) ] var body: some View { Map(coordinateRegion: $viewModel.region, showsUserLocation: true, annotationItems: pointsOfInterest){ item in MapMarker(coordinate: item.coordinate) } .ignoresSafeArea() //full screen .accentColor(Color(.systemPink)) //color of icon .onAppear { viewModel.checkIfLocationServicesIsEnabled() } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } enum MapDetails { static let startingLocation = CLLocationCoordinate2D(latitude: 5.76123, longitude: 156.52318) static let defaultSpan = MKCoordinateSpan(latitudeDelta: 0.1, longitudeDelta: 0.1) } final class ContentViewModel: NSObject, ObservableObject, CLLocationManagerDelegate { @Published var region = MKCoordinateRegion(center: MapDetails.startingLocation, span: MapDetails.defaultSpan) var locationManager: CLLocationManager? func checkIfLocationServicesIsEnabled(){ if CLLocationManager.locationServicesEnabled(){ locationManager = CLLocationManager() locationManager!.delegate = self }else{ print("Show map is off") } } private func checkLocationAuthorization(){ guard let locationManager = locationManager else {return} switch locationManager.authorizationStatus{ case .notDetermined: locationManager.requestWhenInUseAuthorization() case .restricted: print("Location restricted") case .denied: print("Location denied") case .authorizedAlways, .authorizedWhenInUse: region = MKCoordinateRegion(center: locationManager.location!.coordinate, span: MapDetails.defaultSpan) break @unknown default: break } } func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) { checkLocationAuthorization() } } }
Posted Last updated
.
Post not yet marked as solved
0 Replies
328 Views
Hello, I am currently working to develop an automated attendance tracking system for a senior project at a university. The project uses React Native, and BLE iBeacons. They are asking that I check every 5 minutes to see what beacons are near me so that I could say yes I’m here in class or no I wasn’t in class. From what documentation I have seen, it is pretty much impossible to send requests any sooner than 15 minutes apart. However, most of it is a couple years old or not relating to background refreshing. Is that 15 minute minimum to several hour maximum based on user’s use of the app still accurate, or has anything changed? The app is aiming to send requests to a server every 5 minutes, while running in the background such that the student wouldn’t have to be on their phone/ have the app open the whole class. If there’s not a way to send requests every 5 minutes in the background, is there a possibility that a push notification library could somehow be used instead? Thank you, Aaron
Posted Last updated
.
Post not yet marked as solved
1 Replies
436 Views
I can draw more than around 8000 default red markers without setting icon property for marker. But I want to draw markers with different colors depending upon marker's value. In XCOde I get below warning:- "((null)) was false: Reached the max number of texture atlases, can not allocate more.  ((null)) was false: Failed to get the icon for the given CGImageRef. ((null)) was false: Failed to allocate texture space for marker"  from Google Map SDK & after that around 1300 markers it gets crashed. Is there any other way to set different colors to markers without crashing for more than 1300 markers. I am setting marker's colour like below:- marker.icon = GMSMarker.markerImage(with: self.getColorsFromString(strColor: strColor)) func getColorsFromString(strColor:String) -> UIColor { var color = UIColor() switch strColor { case "GREEN": color = UIColor.green case "YELLOW": color = UIColor.yellow case "RED": color = UIColor.red case "ORANGE": color = UIColor.orange case "BLUE": color = UIColor.blue case "CYAN": color = UIColor.cyan case "MAGENTA": color = UIColor.magenta default: color = UIColor.red print("default color") } return color }
Posted
by PAGaikwad.
Last updated
.
Post not yet marked as solved
0 Replies
364 Views
Hello, Our app requires When in Use Authorisation to work. Is it a good head to use CLLocationButton to ask for this Authorisation for iOS 15 users? We tried using this button but it only shows only two options OK and Not Now as shown in this pic. Is it possible to show When in Use Authorisation here?
Posted Last updated
.
Post not yet marked as solved
0 Replies
278 Views
I am working on an App that tracks location coordinates from a starting point to an end point and calculates the mileage of the route. The location manager is set with a distance filter of 10, desired accuracy is kCLocationAccuracyBestForNavigation, pausesLocationUpdatesAutomatically is false. In the locationUpdated function of the location listener, I filter out coordinates with horizontalAccuracy greater than 100. The problem is that, in iOS 15, if the route is indoors (wifi based location tracking), locationUpdated function gets called with inaccurate location values with good horizontalAccuracy value. For example, even when the device is stationary, it gets a stream of locations with distances varying from 60m to 100m from the previous location in the stream. As a result, the calculated mileage becomes inaccurately inflated. I tested with larger distance filter (e.g. 50m, 80m, 100m), but the issue persists. The same code works perfectly, both indoors and outdoors, in iOS 14.8. The locationUpdated function gets called with accurate location value after the device has moved the distance set in the distance filter. Why I am getting bad location values in iOS 15 and is there a known solution to it?
Posted
by SaikatDey.
Last updated
.
Post marked as solved
3 Replies
899 Views
Available today, you can now use custom images for annotations on Maps Web Snapshots. The full list of available annotation styles for Maps Web Snapshots is now: dot (a small circle) balloon (default balloon-style annotation) large (a selected balloon) *NEW* img (your own custom image) To use: Specify the images that you want to use in the imgs array. Each item in imgs should be an Image - https://developer.apple.com/documentation/snapshots/image JSON object, which lets you specify parameters like url, height, and width. Set markerstyle=img on your Annotation - https://developer.apple.com/documentation/snapshots/annotation object. Use imgIdx to choose an image within imgs for this annotation. To get the full story on creating static map images to use on websites, in email, and more, check out the Maps Web Snapshots - https://developer.apple.com/documentation/snapshots documentation.
Posted
by Frameworks Engineer.
Last updated
.
Post marked as solved
2 Replies
368 Views
I am looking to share official GIS data with Apple Maps for our county. Does anyone know where or how to do this? I am the 911 director for the county. Thanks.
Posted Last updated
.