diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 979b304..34b9528 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,14 +6,23 @@ on: - '[0-9]+.[0-9]+.[0-9]+*' jobs: - publish: + build: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + - name: Install Flutter + uses: subosito/flutter-action@v2 + with: + flutter-version: '3.24.3' + - name: Install dependencies + run: flutter pub get + - name: Analyze + run: flutter analyze + - name: Check Publish Warnings + run: dart pub publish --dry-run - name: Publish - uses: sakebook/actions-flutter-pub-publisher@v1.4.1 + uses: k-paxian/dart-package-publisher@v1.5.1 with: - credential: ${{ secrets.PUB_CREDENTIALS }} - skip_test: true - dry_run: true \ No newline at end of file + credentialJson: ${{ secrets.PUB_CREDENTIALS }} + flutter: true + skipTests: true \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 443bef7..fc5a0bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,25 @@ # Changelog +## 4.0.0 +See the [main](https://pub.dev/packages/mapsindoors_googlemaps/changelog) package for the changelog. + +## 3.1.3 +See the [main](https://pub.dev/packages/mapsindoors_googlemaps/changelog) package for the changelog. + +## 3.1.2 +See the [main](https://pub.dev/packages/mapsindoors_googlemaps/changelog) package for the changelog. + +## 3.1.1 +See the [main](https://pub.dev/packages/mapsindoors_googlemaps/changelog) package for the changelog. + +## 3.1.0 +See the [main](https://pub.dev/packages/mapsindoors_googlemaps/changelog) package for the changelog. + +## 3.0.2 +See the [main](https://pub.dev/packages/mapsindoors_googlemaps/changelog) package for the changelog. + +## 3.0.1 +See the [main](https://pub.dev/packages/mapsindoors_googlemaps/changelog) package for the changelog. + +## 3.0.0 See the [main](https://pub.dev/packages/mapsindoors_googlemaps/changelog) package for the changelog. diff --git a/android/build.gradle b/android/build.gradle index 70f49c4..0a0bf14 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -49,7 +49,7 @@ android { dependencies { implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1' - implementation "com.mapspeople.mapsindoors:googlemaps:4.8.12" + implementation "com.mapspeople.mapsindoors:googlemaps:4.9.0" implementation "com.google.android.gms:play-services-maps:18.1.0" implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.3.0" implementation 'com.github.bumptech.glide:glide:4.16.0' diff --git a/android/src/main/kotlin/com/mapspeople/mapsindoors/PlatformMapView.kt b/android/src/main/kotlin/com/mapspeople/mapsindoors/PlatformMapView.kt index 16bc1e7..c96f024 100644 --- a/android/src/main/kotlin/com/mapspeople/mapsindoors/PlatformMapView.kt +++ b/android/src/main/kotlin/com/mapspeople/mapsindoors/PlatformMapView.kt @@ -7,12 +7,14 @@ import com.mapsindoors.core.MPFloorSelectorInterface import com.mapsindoors.googlemaps.MPMapConfig import com.google.android.gms.maps.GoogleMap import com.google.android.gms.maps.OnMapReadyCallback +import com.google.android.gms.maps.CameraUpdateFactory import com.google.android.gms.maps.CameraUpdate as GMCameraUpdate import com.google.android.gms.maps.GoogleMap.CancelableCallback import com.google.android.gms.maps.MapView +import com.google.gson.Gson import android.view.View -abstract class PlatformMapView(private val context: Context) : PlatformMapViewInterface, OnMapReadyCallback { +abstract class PlatformMapView(private val context: Context, private val args: HashMap<*,*>?) : PlatformMapViewInterface, OnMapReadyCallback { private val mMap: MapView = MapView(context) private var mGoogleMap: GoogleMap? = null @@ -58,6 +60,10 @@ abstract class PlatformMapView(private val context: Context) : PlatformMapViewIn override fun onMapReady(p0: GoogleMap) { mGoogleMap = p0 mMap.onStart() + val position = Gson().fromJson(args?.get("initialCameraPosition") as? String, CameraPosition::class.java)?.toGMCameraPosition() + if (position != null) { + p0.moveCamera(CameraUpdateFactory.newCameraPosition(position)) + } whenMapReady() } } \ No newline at end of file diff --git a/android/src/main/kotlin/com/mapspeople/mapsindoors/core/MapView.kt b/android/src/main/kotlin/com/mapspeople/mapsindoors/core/MapView.kt index 1b4a699..95854f4 100644 --- a/android/src/main/kotlin/com/mapspeople/mapsindoors/core/MapView.kt +++ b/android/src/main/kotlin/com/mapspeople/mapsindoors/core/MapView.kt @@ -24,7 +24,7 @@ import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch -class MapView(context: Context, binaryMessenger: BinaryMessenger, val args: HashMap<*,*>?, private val lifecycleProvider: MapsindoorsPlugin.LifecycleProvider) : PlatformMapView(context), PlatformView, MethodCallHandler, DefaultLifecycleObserver { +class MapView(context: Context, binaryMessenger: BinaryMessenger, val args: HashMap<*,*>?, private val lifecycleProvider: MapsindoorsPlugin.LifecycleProvider) : PlatformMapView(context, args), PlatformView, MethodCallHandler, DefaultLifecycleObserver { private val channel : MethodChannel = MethodChannel(binaryMessenger, "MapControlMethodChannel") private val listenerChannel : MethodChannel = MethodChannel(binaryMessenger, "MapControlListenerMethodChannel") private val floorSelectorChannel : MethodChannel = MethodChannel(binaryMessenger, "MapControlFloorSelectorChannel") diff --git a/pubspec.yaml b/pubspec.yaml index 16dee3e..339d637 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: mapsindoors_googlemaps_android description: Android implementation of the mapsindoors plugin using the Google Maps platform -version: 3.1.3 +version: 4.0.0 repository: https://github.com/MapsPeople/mapsindoors_flutter_googlemaps_android homepage: https://www.mapsindoors.com/ @@ -20,7 +20,7 @@ dependencies: flutter: sdk: flutter flutter_plugin_android_lifecycle: ^2.0.15 - mapsindoors_platform_interface: ^3.1.3 + mapsindoors_platform_interface: ^4.0.0 dev_dependencies: flutter_test: