Commit 256a5573 authored by shigemi miura's avatar shigemi miura

自船を中央に表示

parent becc590d
...@@ -54,7 +54,7 @@ enum HttpRequestType : String { ...@@ -54,7 +54,7 @@ enum HttpRequestType : String {
case storage = "https://tacmiquaritycheckstorage.z31.web.core.windows.net/" case storage = "https://tacmiquaritycheckstorage.z31.web.core.windows.net/"
case GetManualUrl = "https://ssv-qc-web.azurewebsites.net/api/constantdata/manual?filter=SailAssist" case GetManualUrl = "https://ssv-qc-web.azurewebsites.net/api/constantdata/manual?filter=SailAssist"
case Information = "https://ssv-qc-web.azurewebsites.net/information/4" case Information = "https://ssv-qc-web.azurewebsites.net/information/4"
case InfVersion = "https://ssv-qc-web.azurewebsites.net/information/4" // case InfVersion = "https://ssv-qc-web.azurewebsites.net/information/4"
case ContactPage = "https://www.jmarinecloud.com/eng/contact.php?type=ssv_mobile" case ContactPage = "https://www.jmarinecloud.com/eng/contact.php?type=ssv_mobile"
case ApachLicens = "https://raw.githubusercontent.com/Azure/azure-notificationhubs-ios/main/LICENSE" case ApachLicens = "https://raw.githubusercontent.com/Azure/azure-notificationhubs-ios/main/LICENSE"
case AppStore = "https://apps.apple.com/jp/app/sail-assist/id6473762428" case AppStore = "https://apps.apple.com/jp/app/sail-assist/id6473762428"
...@@ -81,7 +81,7 @@ enum HttpRequestType : String { ...@@ -81,7 +81,7 @@ enum HttpRequestType : String {
case storage = "https://tacmistorage.z31.web.core.windows.net/" case storage = "https://tacmistorage.z31.web.core.windows.net/"
case GetManualUrl = "https://ssv.jmarinecloud.com/api/constantdata/manual?filter=SailAssist" case GetManualUrl = "https://ssv.jmarinecloud.com/api/constantdata/manual?filter=SailAssist"
case Information = "https://ssv.jmarinecloud.com/information/4" case Information = "https://ssv.jmarinecloud.com/information/4"
case InfVersion = "https://ssv.jmarinecloud.com/information/4" // case InfVersion = "https://ssv.jmarinecloud.com/information/4"
case ContactPage = "https://www.jmarinecloud.com/eng/contact.php?type=ssv_mobile" case ContactPage = "https://www.jmarinecloud.com/eng/contact.php?type=ssv_mobile"
case ApachLicens = "https://raw.githubusercontent.com/Azure/azure-notificationhubs-ios/main/LICENSE" case ApachLicens = "https://raw.githubusercontent.com/Azure/azure-notificationhubs-ios/main/LICENSE"
case AppStore = "https://apps.apple.com/jp/app/sail-assist/id6473762428" case AppStore = "https://apps.apple.com/jp/app/sail-assist/id6473762428"
......
...@@ -187,6 +187,7 @@ struct LoginView: View { ...@@ -187,6 +187,7 @@ struct LoginView: View {
let resjson = serverSession.fromJSON(resultData: resultData, resltType: ResLogin.self) let resjson = serverSession.fromJSON(resultData: resultData, resltType: ResLogin.self)
if let res = resjson { if let res = resjson {
SharingData.my.id = res.id SharingData.my.id = res.id
SharingData.my.shipId = res.shipId
SharingData.my.shipName = res.shipName SharingData.my.shipName = res.shipName
SharingData.my.imo = res.imo SharingData.my.imo = res.imo
SharingData.my.mmsi = res.mmsi SharingData.my.mmsi = res.mmsi
...@@ -247,6 +248,7 @@ struct LoginView: View { ...@@ -247,6 +248,7 @@ struct LoginView: View {
let resjson = serverSession.fromJSON(resultData: resultData, resltType: ResLogin.self) let resjson = serverSession.fromJSON(resultData: resultData, resltType: ResLogin.self)
if let res = resjson { if let res = resjson {
SharingData.my.id = res.id SharingData.my.id = res.id
SharingData.my.shipId = res.shipId
SharingData.my.shipName = res.shipName SharingData.my.shipName = res.shipName
SharingData.my.imo = res.imo SharingData.my.imo = res.imo
SharingData.my.mmsi = res.mmsi SharingData.my.mmsi = res.mmsi
......
...@@ -46,6 +46,11 @@ struct MapRepresentable: UIViewControllerRepresentable{ ...@@ -46,6 +46,11 @@ struct MapRepresentable: UIViewControllerRepresentable{
} }
} }
//自船を画面中央に表示
if location.focusOwnShip {
mapVC.updateCamera(location: location.location, zoomlevel: nil)
}
if let mylocation = location.location { if let mylocation = location.location {
mapVC.updateOwnShip(location: mylocation, bearing: location.heading) mapVC.updateOwnShip(location: mylocation, bearing: location.heading)
...@@ -284,6 +289,9 @@ class MapViewController : UIViewController{ ...@@ -284,6 +289,9 @@ class MapViewController : UIViewController{
if SharingData.pushHistory.focusPushHistory != nil { if SharingData.pushHistory.focusPushHistory != nil {
SharingData.pushHistory.focusPushHistory = nil SharingData.pushHistory.focusPushHistory = nil
} }
if SharingData.location.focusOwnShip {
SharingData.location.focusOwnShip = false
}
} }
///Ecaの線3本 ///Ecaの線3本
......
...@@ -12,6 +12,7 @@ class SharingData{ ...@@ -12,6 +12,7 @@ class SharingData{
static var my = My() static var my = My()
class My: ObservableObject { class My: ObservableObject {
@Published var id: Int = 0 @Published var id: Int = 0
@Published var shipId: Int = 0
@Published var shipName: String = "" @Published var shipName: String = ""
@Published var imo: Int = 0 @Published var imo: Int = 0
@Published var mmsi: Int = 0 @Published var mmsi: Int = 0
...@@ -36,6 +37,8 @@ class SharingData{ ...@@ -36,6 +37,8 @@ class SharingData{
@Published var heading: Double = 0.0 @Published var heading: Double = 0.0
@Published var dataTime: String = "" //2023-11-02T05:25:49.4362123Z @Published var dataTime: String = "" //2023-11-02T05:25:49.4362123Z
@Published var focusOwnShip: Bool = false
func setLocation(){ func setLocation(){
if Preferences.LocationType == 0 { if Preferences.LocationType == 0 {
self.location = self.gps self.location = self.gps
......
...@@ -30,6 +30,7 @@ struct MainTabView: View { ...@@ -30,6 +30,7 @@ struct MainTabView: View {
appearance.backgroundColor = .clear appearance.backgroundColor = .clear
UITabBar.appearance().scrollEdgeAppearance = appearance UITabBar.appearance().scrollEdgeAppearance = appearance
UITabBar.appearance().standardAppearance = appearance UITabBar.appearance().standardAppearance = appearance
SharingData.location.focusOwnShip = true
// EcaCoordinatesTable().setEcaData() // EcaCoordinatesTable().setEcaData()
} }
...@@ -103,6 +104,7 @@ struct CustomTabBar: View { ...@@ -103,6 +104,7 @@ struct CustomTabBar: View {
@State var isLocationAlert = false @State var isLocationAlert = false
@Environment(\.openURL) var openURL @Environment(\.openURL) var openURL
@ObservedObject var my = SharingData.my @ObservedObject var my = SharingData.my
@ObservedObject var location = SharingData.location
var body: some View { var body: some View {
VStack(spacing: 0){ VStack(spacing: 0){
...@@ -114,6 +116,7 @@ struct CustomTabBar: View { ...@@ -114,6 +116,7 @@ struct CustomTabBar: View {
selectedTabModel.activeTab = tab selectedTabModel.activeTab = tab
if tab == .task { if tab == .task {
selectedTabModel.isPoppver.toggle() selectedTabModel.isPoppver.toggle()
location.focusOwnShip = true
} else { } else {
selectedTabModel.isPoppver = false selectedTabModel.isPoppver = false
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment