Skip to content
This repository was archived by the owner on Jun 25, 2019. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Expand All @@ -25,26 +25,23 @@ 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'
}
}

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'
}
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,16 @@ class MapViewPlugin(val activity: Activity) : MethodCallHandler {
return
}
val mapOptions = call.argument<Map<String, Any>>("mapOptions")
val cameraDict = mapOptions["cameraPosition"] as Map<String, Any>
val cameraDict = if (mapOptions != null) mapOptions["cameraPosition"] as Map<String, Any> else emptyMap<String, Any>()
initialCameraPosition = getCameraPosition(cameraDict)
toolbarActions = getToolbarActions(call.argument<List<Map<String, Any>>>("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;
}
Expand Down
10 changes: 5 additions & 5 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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 {
Expand All @@ -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'
}
4 changes: 2 additions & 2 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -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"
}
}
Expand Down
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 3 additions & 2 deletions ios/Classes/MapViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@

#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>
#import <GoogleMaps/GoogleMaps/GMSMapView.h>
#import <GoogleMaps/GoogleMaps/GMSIndoorDisplay.h>
//#import <GoogleMaps/GoogleMaps/GMSMapView.h>
//#import <GoogleMaps/GoogleMaps/GMSIndoorDisplay.h>
#import <GoogleMaps/GoogleMaps.h>

@class MapViewPlugin;
@class MapAnnotation;
Expand Down
1 change: 1 addition & 0 deletions ios/map_view.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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

1 change: 1 addition & 0 deletions lib/static_map_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class StaticMapProvider {
finalUri.queryParameters = {
'markers': markersString,
'size': '${width ?? defaultWidth}x${height ?? defaultHeight}',
'zoom': zoomLevel.toString(),
'maptype': _getMapTypeQueryParam(mapType),
'key': googleMapsApiKey,
};
Expand Down
5 changes: 3 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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<flutter@apptreesoftware.com>
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

Expand Down