mirror of
https://github.com/seemoo-lab/openhaystack.git
synced 2026-03-02 17:20:20 +00:00
Initial commit
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// AccessoryMapView.swift
|
||||
// OpenHaystack
|
||||
//
|
||||
// Created by Alex - SEEMOO on 02.03.21.
|
||||
// Copyright © 2021 SEEMOO - TU Darmstadt. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
import MapKit
|
||||
|
||||
struct AccessoryMapView: NSViewControllerRepresentable {
|
||||
@ObservedObject var accessoryController: AccessoryController
|
||||
@Binding var mapType: MKMapType
|
||||
var focusedAccessory: Accessory?
|
||||
|
||||
func makeNSViewController(context: Context) -> MapViewController {
|
||||
return MapViewController(nibName: NSNib.Name("MapViewController"), bundle: nil)
|
||||
}
|
||||
|
||||
func updateNSViewController(_ nsViewController: MapViewController, context: Context) {
|
||||
let accessories = self.accessoryController.accessories
|
||||
|
||||
nsViewController.zoom(on: focusedAccessory)
|
||||
nsViewController.addLastLocations(from: accessories)
|
||||
|
||||
nsViewController.changeMapType(mapType)
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user