From a6e079ce382e7860bc9105a05534f967a2f9ef65 Mon Sep 17 00:00:00 2001 From: "Ali A. Hilal" <2677255+engali94@users.noreply.github.com> Date: Tue, 22 Oct 2024 03:59:18 +0300 Subject: [PATCH] Fix the location manager being nil after Swiftui view update. (#57) * Update MapView.swift * Fixed the location manager being nil after Swiftui view update. --- CHANGELOG.md | 6 ++++++ Sources/MapLibreSwiftUI/MapView.swift | 1 + 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a17a71c..91190ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Version 0.3.1 - 2024-10-17 + +### Fixed + +- Fixed the location manager being nil after SwiftUI view update. + ## Version 0.3.0 - 2024-10-14 ### Changed diff --git a/Sources/MapLibreSwiftUI/MapView.swift b/Sources/MapLibreSwiftUI/MapView.swift index 3cc4081..1c53611 100644 --- a/Sources/MapLibreSwiftUI/MapView.swift +++ b/Sources/MapLibreSwiftUI/MapView.swift @@ -106,6 +106,7 @@ public struct MapView: UIViewControllerRepresentab camera: camera, animated: isStyleLoaded) } + uiViewController.mapView.locationManager = locationManager } @MainActor private func applyModifiers(_ mapViewController: T, runUnsafe: Bool) {