Questions tagged [swiftui-map]

10 questions
1
vote
1 answer

Publishing changes from within MAP() view updates is not allowed, this will cause undefined behavior

I've seen similar questions on this but none that are up to date or work successfully, I've followed Apples Developer docs, various videos, and guides on how to do this but it still throws these warnings 2023-01-11 11:33:16.044044-0500…
1
vote
1 answer

Did not get the Map Scroll End event in SwiftUI

We are using the Map functionality with annotations. Functionality:- We have 2000 records in the array but we need to filter 150 records according to the region changed in the Map in SwiftUI. But there is no scroll end event of the Map in…
0
votes
1 answer

Get coordinates in the onLongPressGesture on the Map

My question is very similar to this one: Capture touchDown location of onLongPressGesture in swiftUI? However, there's one significant peculiarity: I want to get the coordinates of the .onLongPressGesture on the Map. The solution in the original…
Dmytro Titov
  • 2,802
  • 6
  • 38
  • 60
0
votes
0 answers

Opacity of the button affects its "clickability"

I've run into a very strange issue. I have a SwiftUI app (iOS) where I have a full-screen ZStack: inside, as a "bottom layer", I have a full-screen Map, and on top I have a button (it is LocationButton - but it doesn't really matter, the behaviour…
Dmytro Titov
  • 2,802
  • 6
  • 38
  • 60
0
votes
0 answers

Is constant annotation rendering slowing my map?

When too many annotations are placed on the map it starts to lag. It seems to be due to zooming which makes be think the annotations are rendering over and over. Does anyone have a work around to have this work more efficiently? The CPU also jumps…
Steve
  • 1,121
  • 1
  • 12
  • 32
0
votes
0 answers

SwiftUI custom map annotations are not shown continuously during pan and zoom

Setup: My app has a SwiftUI Map that can show annotations and the user location. It is possible to pan or zoom the map. Here is the relevant part of my code: struct MapViewSWUI: View { @Binding var show_map_modal: Bool @ObservedObject var…
Reinhard Männer
  • 14,022
  • 5
  • 54
  • 116
0
votes
0 answers

GeometryReader sometimes gives wrong .global frame origin for Map annotations

Test setup: I have a View that displays modally a Map with annotations: struct Annotation: Identifiable { let id = UUID() let name: String let coordinate: CLLocationCoordinate2D } struct MapViewSWUI: View { @Binding var…
Reinhard Männer
  • 14,022
  • 5
  • 54
  • 116
0
votes
1 answer

SwiftUI get what Object's annotation was clicked on map. Core Data

i have been trying to make so that when you press an annotation on the map that has been created by Core Data's object to show the LocationPreviewView(fish: fish). So how can i get the selected item and pass it to the LocationPreviewView() ? I…
John
  • 55
  • 4
0
votes
0 answers

Unidentified publishing object in SwiftUI Map annotation

Setup: My app uses a SwiftUI Map with annotations. The annotations should be instances of a Place class defined as: final class Place: NSManagedObject, UpdateTimestampable, Identifiable { @NSManaged var horizontalAccuracy: Double @NSManaged…
0
votes
1 answer

Why is SwiftUI Map modifying the state of its calling struct, if no frame is assigned?

Setup: My app uses a SwiftUI Map, essentially as struct MapViewSWUI: View { @Binding private var show_map_modal: Bool @State private var region: MKCoordinateRegion //… init(show_map_modal: Binding) { self._show_map_modal =…
Reinhard Männer
  • 14,022
  • 5
  • 54
  • 116