Node map kinda working

This commit is contained in:
Joshua Pirihi 2021-12-21 20:15:07 +13:00
parent 0919c209ac
commit 951ecec688
4 changed files with 40 additions and 11 deletions

View file

@ -683,7 +683,7 @@
CODE_SIGN_ENTITLEMENTS = MeshtasticClient/MeshtasticClient.entitlements;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "\"MeshtasticClient/Preview Content\"";
DEVELOPMENT_TEAM = GCH7VS5Y9R;
DEVELOPMENT_TEAM = 37C534H572;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = MeshtasticClient/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
@ -710,7 +710,7 @@
CODE_SIGN_ENTITLEMENTS = MeshtasticClient/MeshtasticClient.entitlements;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "\"MeshtasticClient/Preview Content\"";
DEVELOPMENT_TEAM = GCH7VS5Y9R;
DEVELOPMENT_TEAM = 37C534H572;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = MeshtasticClient/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>MeshtasticClient.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>

View file

@ -36,23 +36,38 @@ struct NodeMap: View {
set: { _ in }
)
/*ForEach ( locationNodes ) { node in
let mostRecent = node.positions?.lastObject as! PositionEntity
if mostRecent.coordinate != nil {
annotations.append(MapLocation(name: node.user?.shortName! ?? "???", coordinate: mostRecent.coordinate!))
}
}*/
NavigationView {
ZStack {
Map(coordinateRegion: regionBinding,
interactionModes: [.all],
showsUserLocation: true,
userTrackingMode: .constant(.follow)//,
//ForEach ( locationNodes ) { node in
// let mostRecent = node.positions?.lastObject as! PositionEntity
// if mostRecent.coordinate != nil {
userTrackingMode: .constant(.follow),
annotationItems: self.locationNodes.filter({ nodeinfo in
return nodeinfo.positions != nil && nodeinfo.positions!.count > 0
})
) { locationNode in
// annotations.append(MapLocation(name: node.user?.shortName! ?? "???", coordinate: mostRecent.coordinate!))
// }
// }
)
return MapAnnotation(
coordinate: (locationNode.positions!.lastObject as! PositionEntity).coordinate ?? CLLocationCoordinate2D(latitude: 0, longitude: 0),
content: {
CircleText(text: locationNode.user!.shortName ?? "???", color: .accentColor)
}
)
}
//}
.frame(maxHeight: .infinity)
.ignoresSafeArea(.all, edges: [.leading, .trailing])