Skip to content

Commit

Permalink
allow changing of mapstyle after creation
Browse files Browse the repository at this point in the history
  • Loading branch information
hactar committed Apr 14, 2024
1 parent 6e0cf32 commit 77e65f5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Sources/MapLibreSwiftUI/MapView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ public struct MapView: UIViewRepresentable {

public func updateUIView(_ mapView: MLNMapView, context: Context) {
context.coordinator.parent = self

switch styleSource {
case let .url(styleURL):
if styleURL != mapView.styleURL {
mapView.styleURL = styleURL
}
}

applyModifiers(mapView, runUnsafe: true)

Expand Down

0 comments on commit 77e65f5

Please sign in to comment.