diff --git a/android/build.gradle b/android/build.gradle index 30a4b58..41cf45e 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -2,14 +2,14 @@ group 'com.apptreesoftware.mapview' version '1.0-SNAPSHOT' buildscript { - ext.kotlin_version = '1.2.50' + ext.kotlin_version = '1.3.21' repositories { google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.1.2' + classpath 'com.android.tools.build:gradle:3.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -25,18 +25,15 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - compileSdkVersion 27 - buildToolsVersion '27.0.3' + compileSdkVersion 28 + //buildToolsVersion '28.0.3' sourceSets { main.java.srcDirs += 'src/main/kotlin' } defaultConfig { minSdkVersion 16 - targetSdkVersion 27 - versionCode 1 - versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } lintOptions { disable 'InvalidPackage' @@ -44,7 +41,7 @@ android { } dependencies { - implementation 'com.android.support:appcompat-v7:27.1.1' - implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.50' - implementation 'com.google.android.gms:play-services-maps:15.0.1' + implementation 'androidx.appcompat:appcompat:1.0.2' + implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.21' + implementation 'com.google.android.gms:play-services-maps:16.1.0' } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 9372d0f..bae5290 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip diff --git a/android/src/main/kotlin/com/apptreesoftware/mapview/MapActivity.kt b/android/src/main/kotlin/com/apptreesoftware/mapview/MapActivity.kt index 2ab5694..ecc7698 100644 --- a/android/src/main/kotlin/com/apptreesoftware/mapview/MapActivity.kt +++ b/android/src/main/kotlin/com/apptreesoftware/mapview/MapActivity.kt @@ -7,9 +7,9 @@ import android.content.res.AssetFileDescriptor import android.graphics.Bitmap import android.graphics.BitmapFactory import android.os.Bundle -import android.support.v4.app.ActivityCompat -import android.support.v4.content.ContextCompat -import android.support.v7.app.AppCompatActivity +import androidx.core.app.ActivityCompat +import androidx.core.content.ContextCompat +import androidx.appcompat.app.AppCompatActivity import android.view.Menu import android.view.MenuItem import com.google.android.gms.maps.CameraUpdateFactory diff --git a/android/src/main/kotlin/com/apptreesoftware/mapview/MapViewPlugin.kt b/android/src/main/kotlin/com/apptreesoftware/mapview/MapViewPlugin.kt index 699ca65..afa4485 100644 --- a/android/src/main/kotlin/com/apptreesoftware/mapview/MapViewPlugin.kt +++ b/android/src/main/kotlin/com/apptreesoftware/mapview/MapViewPlugin.kt @@ -205,16 +205,16 @@ class MapViewPlugin(val activity: Activity) : MethodCallHandler { return } val mapOptions = call.argument>("mapOptions") - val cameraDict = mapOptions["cameraPosition"] as Map + val cameraDict = if (mapOptions != null) mapOptions["cameraPosition"] as Map else emptyMap() initialCameraPosition = getCameraPosition(cameraDict) toolbarActions = getToolbarActions(call.argument>>("actions")) - showUserLocation = mapOptions["showUserLocation"] as Boolean - showMyLocationButton = mapOptions["showMyLocationButton"] as Boolean - showCompassButton = mapOptions["showCompassButton"] as Boolean - hideToolbar = mapOptions["hideToolbar"] as Boolean - mapTitle = mapOptions["title"] as String + showUserLocation = if (mapOptions != null) mapOptions["showUserLocation"] as Boolean else false + showMyLocationButton = if (mapOptions != null) mapOptions["showMyLocationButton"] as Boolean else false + showCompassButton = if (mapOptions != null) mapOptions["showCompassButton"] as Boolean else false + hideToolbar = if (mapOptions != null) mapOptions["hideToolbar"] as Boolean else false + mapTitle = if (mapOptions != null) mapOptions["title"] as String else "" - if (mapOptions["mapViewType"] != null) { + if (mapOptions != null && mapOptions["mapViewType"] != null) { val mappedMapType: Int? = mapTypeMapping.get(mapOptions["mapViewType"]); if (mappedMapType != null) mapViewType = mappedMapType; } diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index fd05005..ab3feca 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -16,8 +16,8 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 27 - buildToolsVersion '25.0.3' + compileSdkVersion 28 + //buildToolsVersion '25.0.3' sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -31,10 +31,10 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.apptreesoftware.mapviewexample" minSdkVersion 16 - targetSdkVersion 27 + targetSdkVersion 28 versionCode 1 versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { @@ -51,5 +51,5 @@ flutter { } dependencies { - compile 'org.jetbrains.kotlin:kotlin-stdlib-jre7:1.2.41' + compile 'org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version' } diff --git a/example/android/build.gradle b/example/android/build.gradle index 5344222..5b6676f 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.2.41' + ext.kotlin_version = '1.3.21' repositories { google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.1.2' + classpath 'com.android.tools.build:gradle:3.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index 9372d0f..2819f02 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip diff --git a/ios/Classes/MapViewController.h b/ios/Classes/MapViewController.h index 830beba..265cec5 100644 --- a/ios/Classes/MapViewController.h +++ b/ios/Classes/MapViewController.h @@ -7,8 +7,9 @@ #import #import -#import -#import +//#import +//#import +#import @class MapViewPlugin; @class MapAnnotation; diff --git a/ios/map_view.podspec b/ios/map_view.podspec index 4b9d9e7..e60386d 100644 --- a/ios/map_view.podspec +++ b/ios/map_view.podspec @@ -18,5 +18,6 @@ A new flutter plugin project. s.dependency 'GoogleMaps' s.compiler_flags = '-fno-modules' s.ios.deployment_target = '8.0' + s.static_framework = true end diff --git a/lib/static_map_provider.dart b/lib/static_map_provider.dart index 477e7a1..11ec197 100644 --- a/lib/static_map_provider.dart +++ b/lib/static_map_provider.dart @@ -108,6 +108,7 @@ class StaticMapProvider { finalUri.queryParameters = { 'markers': markersString, 'size': '${width ?? defaultWidth}x${height ?? defaultHeight}', + 'zoom': zoomLevel.toString(), 'maptype': _getMapTypeQueryParam(mapType), 'key': googleMapsApiKey, }; diff --git a/pubspec.yaml b/pubspec.yaml index 8cbc39b..07159c1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,11 +1,12 @@ name: map_view description: A flutter plugin for displaying native Google Maps. -version: 0.0.14 +version: 0.0.15 author: AppTree Software homepage: https://github.com/apptreesoftware/flutter_google_map_view dependencies: - uri: "^0.11.1" + uri: + git: git://github.com/Eimji/uri.dart flutter: sdk: flutter