У нас вы можете посмотреть бесплатно SwiftUI Mapkit: How to reference values from an array for markers? или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Hello everyone! I hope this video has helped solve your questions and issues. This video is shared because a solution has been found for the question/problem. I create videos for questions that have solutions. If you have any other issues, feel free to reach out to me on Instagram: / ky.emrah Below, you can find the text related to the question/problem. In the video, the question will be presented first, followed by the answers. If the video moves too fast, feel free to pause and review the answers. If you need more detailed information, you can find the necessary sources and links at the bottom of this description. I hope this video has been helpful, and even if it doesn't directly solve your problem, it will guide you to the source of the solution. I'd appreciate it if you like the video and subscribe to my channel!SwiftUI Mapkit: How to reference values from an array for markers? I am a beginner, and I have a programming-related question: I have an array mit values for markers, which I want to present an a map. The market is shown, so no problem. But: I don't arrive in using my values for the marker, as for example the tint-color. I know how to get the value "coordinates" (by using n.coordinate), but the name (which is a String) or the tint (which is a Color) does not work, I simply don't know how to reference it (n.name doesn't work). import SwiftUI import MapKit struct MyLocationsArray: Identifiable { // MyLocationArray: Alle Locations sind in diesem Array erfasst let id = UUID() let number: Int // lfd. Nummer der eigenen Locations: 1, 2,3,4, ... let category: Int // Kategorie-Nr.: Historisches, Strände, etc. let name: String // Name der Location: "A-name" let label: String // abgekürzter Name unter dem Marker: "A-Label" let systemimage: String // Systemsymbol im Marker: "bird" let tint: Color // Farbe des Markers: .yellow, .green, .blue let coordinates: CLLocationCoordinate2D // Koordinaten der Location let freeInt: Int // noch nicht belegt (Int) (default: 0) let freeString: String // noch nicht belegt (String) (default: "") } struct ContentView: View { let marker = [ MyLocationsArray(number: 1, category: 1, name: "A-Name", label: "A-Label", systemimage: "bird", tint: .orange, coordinates: CLLocationCoordinate2D(latitude: 42.2926854029081, longitude: -71.0679634411345), freeInt: 0, freeString: ""), MyLocationsArray(number: 1, category: 1, name: "B-Name", label: "B-Label", systemimage: "bird", tint: .red, coordinates: CLLocationCoordinate2D(latitude: 42.2926854029081, longitude: -71.0679634411345), freeInt: 0, freeString: "") ] var body: some View { Text("Hello, World!") Map { ForEach(marker) { n in Marker("", coordinate: n.coordinates) // ""** should be "label"** .tint(.yellow) // **".yellow" should be individual **(see "let marker ...") } // ForEach } } } #Preview { ContentView() }) import SwiftUI import MapKit struct MyLocationsArray: Identifiable { // MyLocationArray: Alle Locations sind in diesem Array erfasst let id = UUID() let number: Int // lfd. Nummer der eigenen Locations: 1, 2,3,4, ... let category: Int // Kategorie-Nr.: Historisches, Strände, etc. let name: String // Name der Location: "A-name" let label: String // abgekürzter Name unter dem Marker: "A-Label" let systemimage: String // Systemsymbol im Marker: "bird" let tint: Color // Farbe des Markers: .yellow, .green, .blue let coordinates: CLLocationCoordinate2D // Koordinaten der Location let freeInt: Int // noch nicht belegt (Int) (default: 0) let freeString: String // noch nicht belegt (String) (default: "") } struct ContentView: View { let marker = [ MyLocationsArray(number: 1, category: 1, name: "A-Name", label: "A-Label"Source of the question: https://stackoverflow.com/questions/7... Question and source license information: https://meta.stackexchange.com/help/l... https://stackoverflow.com/