From 7445797d46c17a24ecaf3ee75ef4badb55ce5c21 Mon Sep 17 00:00:00 2001 From: Jackson Rosenthal Date: Sat, 5 Feb 2022 12:32:31 -0500 Subject: [PATCH] Added TODO in code to point out areas that need work --- .../com/geeksville/mesh/ui/MapFragment.kt | 39 ++++--------------- 1 file changed, 7 insertions(+), 32 deletions(-) diff --git a/app/src/main/java/com/geeksville/mesh/ui/MapFragment.kt b/app/src/main/java/com/geeksville/mesh/ui/MapFragment.kt index 3d7850dc..2489500f 100644 --- a/app/src/main/java/com/geeksville/mesh/ui/MapFragment.kt +++ b/app/src/main/java/com/geeksville/mesh/ui/MapFragment.kt @@ -45,10 +45,11 @@ class MapFragment : ScreenFragment("Map"), Logging { private val nodeLayer = SymbolLayer(nodeLayerId, nodeSourceId) .iconImage(markerImageId) .iconAnchor(IconAnchor.BOTTOM) + .iconAllowOverlap(true) private val labelLayer = SymbolLayer(labelLayerId, nodeSourceId) .textField(Expression.get("name")) - .textSize() + .textSize() // TODO Set text size .textColor(Color.RED) .textVariableAnchor(arrayListOf(TextAnchor.TOP.toString())) .textJustify(TextJustify.AUTO) @@ -84,9 +85,11 @@ class MapFragment : ScreenFragment("Map"), Logging { } + //TODO Update node positions // nodePositions.setGeoJson(getCurrentNodes()) // Update node positions } + //TODO Update camera movements fun zoomToNodes(map: MapboxMap) { val nodesWithPosition = model.nodeDB.nodes.value?.values?.filter { it.validPosition != null } @@ -161,13 +164,16 @@ class MapFragment : ScreenFragment("Map"), Logging { )!! map.loadStyleUri(Style.OUTDOORS) + //TODO add layers to current view of map // style.addSource(nodePositions) // style.addImage(markerImageId, markerIcon) // style.addLayer(nodeLayer) // style.addLayer(labelLayer) + //TODO setup gesture controls // map.uiSettings.isRotateGesturesEnabled = false + // Provide initial positions model.nodeDB.nodes.value?.let { nodes -> onNodesChanged(map, nodes.values) @@ -184,37 +190,6 @@ class MapFragment : ScreenFragment("Map"), Logging { } } } - - override fun onStart() { - super.onStart() - mapView?.onStart() - } - - override fun onStop() { - mapView?.onStop() - super.onStop() - } - - override fun onDestroyView() { - super.onDestroyView() - mapView?.onDestroy() - } - - override fun onSaveInstanceState(outState: Bundle) { - mapView?.let { - super.onSaveInstanceState(outState) - } - } - - override fun onLowMemory() { - super.onLowMemory() - mapView?.onLowMemory() - } - - override fun onDestroy() { - super.onDestroy() - mapView?.onDestroy() - } }