diff options
| -rw-r--r-- | android-app/app/src/main/kotlin/org/terst/nav/MainActivity.kt | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/android-app/app/src/main/kotlin/org/terst/nav/MainActivity.kt b/android-app/app/src/main/kotlin/org/terst/nav/MainActivity.kt index ccdf3b4..d99bf85 100644 --- a/android-app/app/src/main/kotlin/org/terst/nav/MainActivity.kt +++ b/android-app/app/src/main/kotlin/org/terst/nav/MainActivity.kt @@ -27,8 +27,11 @@ import org.maplibre.android.maps.Style import org.maplibre.android.style.layers.CircleLayer import org.maplibre.android.style.expressions.Expression import org.maplibre.android.style.layers.PropertyFactory +import org.maplibre.android.style.layers.RasterLayer import org.maplibre.android.style.layers.SymbolLayer import org.maplibre.android.style.sources.GeoJsonSource +import org.maplibre.android.style.sources.RasterSource +import org.maplibre.android.style.sources.TileSet import org.maplibre.geojson.Feature import org.maplibre.geojson.FeatureCollection import org.maplibre.geojson.Point @@ -179,7 +182,14 @@ class MainActivity : AppCompatActivity() { mapView?.onCreate(savedInstanceState) mapView?.getMapAsync { maplibreMap -> this.maplibreMap = maplibreMap // Assign to class member - maplibreMap.setStyle(Style.Builder().fromUri("https://tiles.openseamap.org/seamark/osm-bright/style.json")) { style -> + val style = Style.Builder() + .fromUri("https://tiles.openfreemap.org/styles/liberty") + .withSource(RasterSource("openseamap-source", + TileSet("2.2.0", "https://tiles.openseamap.org/seamark/{z}/{x}/{y}.png").also { + it.setMaxZoom(18f) + }, 256)) + .withLayer(RasterLayer("openseamap-layer", "openseamap-source")) + maplibreMap.setStyle(style) { style -> setupAnchorMapLayers(style) setupTidalCurrentMapLayers(style) observeTidalCurrentState() // Start observing tidal current state |
