Skip to content
This repository was archived by the owner on Jun 25, 2019. It is now read-only.
Open
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
6 changes: 5 additions & 1 deletion AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
# to the project. Names should be added to the list like so:
#
# Name/Organization <email address>
Cirrus It <[email protected]>
Ernesto Campohermoso
@ernestomar

AppTree Software, Inc <[email protected]>
Luis Andrés Jara Castillo
@nunorpg
@grepLines
@grepLines
@ernestomar
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
## [0.0.19] - 01-07-2018

## [1.0.0] - 15-07-2019
* Migrating project to AndroidX

## [0.0.20] - 02-19-2019
* Modifying gradle.properties for avoid use of AndroidX

## [0.0.19] - 11-07-2018

* Updating map library to 'com.google.android.gms:play-services-maps:16.0.0'

## [0.0.18] - 11-07-2018
* Fixing support for !use_imports and Swift (improve interoperability with other plugins)

## [0.0.15] - 11-07-2018

* Fixing Android compile issue Only safe (?.) or non-null asserted (!!.)

## [0.0.14] - 7-18-2018

* Fixing Android compile issue
Expand Down
12 changes: 1 addition & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
# IMPORTANT: This plugin is no longer under development
### Why?

We initially built this plugin to fill an early gap in flutter. Since then, Google has made progress on their [Google Map plugin](https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter).

Meanwhile, at AppTree, we've moved on to building a pure Dart implementation for mapping based off of [leaflet](https://leafletjs.com/), which you can find [here](https://pub.dartlang.org/packages/flutter_map). This plugin has the following important features:

- Allows inline maps within your Widget hierarchy (rather than full screen)
- Pins are just widgets. Very easy to customize
- 0 dependencies on native libraries. No more Google Play or Cocoapod dependencies!
- You can use any OpenStreetMap tiles as well as paid tile providers like MapBox and ESRI. Unfortunately, Google Map tiles are not available. You can find more about available tile providers [here](https://github.com/Leaflet/Leaflet/blob/master/FAQ.md#what-map-tiles-can-i-use-with-leaflet-is-it-limited-to-openstreetmap).
# IMPORTANT: This plugin has been forked in order to fix minor bugs and upgrade dependencies

# map_view

Expand Down
14 changes: 7 additions & 7 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.2.51'
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.android.tools.build:gradle:3.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -25,8 +25,8 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
compileSdkVersion 28
buildToolsVersion '28.0.2'

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -36,15 +36,15 @@ android {
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 'androidx.appcompat:appcompat:1.1.0-rc01'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.50'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
}
2 changes: 2 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
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
2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rootProject.name = 'map_view'
rootProject.name = 'cirrus_map_view'
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,20 +205,27 @@ class MapViewPlugin(val activity: Activity) : MethodCallHandler {
return
}
val mapOptions = call.argument<Map<String, Any>>("mapOptions")
val cameraDict = mapOptions["cameraPosition"] as Map<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

if (mapOptions["mapViewType"] != null) {
val mappedMapType: Int? = mapTypeMapping.get(mapOptions["mapViewType"]);
if (mappedMapType != null) mapViewType = mappedMapType;
if (mapOptions != null) {
val cameraDict = mapOptions["cameraPosition"] as Map<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
if (mapOptions["mapViewType"] != null) {
val mappedMapType: Int? = mapTypeMapping.get(mapOptions["mapViewType"]);
if (mappedMapType != null) mapViewType = mappedMapType;
}
} else {
initialCameraPosition = getCameraPosition(emptyMap<String, Any>())
showUserLocation = false
showMyLocationButton = false
showCompassButton = false
hideToolbar = false
mapTitle = ""
}

val intent = Intent(activity, MapActivity::class.java)
activity.startActivity(intent)
result.success(true)
Expand Down
1 change: 1 addition & 0 deletions example/.flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"_info":"// This is a generated file; do not edit or check into version control.","dependencyGraph":[{"name":"cirrus_map_view","dependencies":[]}]}
6 changes: 3 additions & 3 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 '28.0.2'

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand Down Expand Up @@ -51,5 +51,5 @@ flutter {
}

dependencies {
compile 'org.jetbrains.kotlin:kotlin-stdlib-jre7:1.2.41'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.50'
}
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.2.51'
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.android.tools.build:gradle:3.2.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.6-all.zip
2 changes: 1 addition & 1 deletion example/ios/Flutter/flutter_assets/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -8618,7 +8618,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
map_view
cirrus_map_view

The MIT License

Expand Down
10 changes: 10 additions & 0 deletions example/ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/ecampohermoso/opt/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/ecampohermoso/git/cirrus/flutter_google_map_view/example"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
export "FLUTTER_FRAMEWORK_DIR=/Users/ecampohermoso/opt/flutter/bin/cache/artifacts/engine/ios"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildSystemType</key>
<string>Original</string>
</dict>
</plist>
10 changes: 5 additions & 5 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import 'dart:async';

import 'package:flutter/material.dart';
import 'package:map_view/figure_joint_type.dart';
import 'package:map_view/map_view.dart';
import 'package:map_view/polygon.dart';
import 'package:map_view/polyline.dart';
import 'package:cirrus_map_view/figure_joint_type.dart';
import 'package:cirrus_map_view/map_view.dart';
import 'package:cirrus_map_view/polygon.dart';
import 'package:cirrus_map_view/polyline.dart';

///This API Key will be used for both the interactive maps as well as the static maps.
///Make sure that you have enabled the following APIs in the Google API Console (https://console.developers.google.com/apis)
/// - Static Maps API
/// - Android Maps API
/// - iOS Maps API
const API_KEY = "<your-api-key>";
const API_KEY = "GOOGLE_MAP_TOKEN_HERE";

void main() {
MapView.setApiKey(API_KEY);
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dev_dependencies:
flutter_test:
sdk: flutter

map_view:
cirrus_map_view:
path: ../

# For information on the generic Dart part of this file, see the
Expand Down
4 changes: 2 additions & 2 deletions ios/Classes/MapViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

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

@class MapViewPlugin;
@class MapAnnotation;
Expand Down
23 changes: 23 additions & 0 deletions ios/cirrus_map_view.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'cirrus_map_view'
s.version = '0.0.12'
s.summary = 'A new flutter plugin project.'
s.description = <<-DESC
A new flutter plugin project.
DESC
s.homepage = 'http://example.com'
s.license = { :file => '../LICENSE' }
s.author = { 'Your Company' => '[email protected]' }
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
s.dependency 'Flutter'
s.dependency 'GoogleMaps'
s.compiler_flags = '-fno-modules'
s.ios.deployment_target = '8.0'
s.static_framework = true
end

5 changes: 3 additions & 2 deletions ios/map_view.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'map_view'
s.version = '0.0.12'
s.name = 'cirrus_map_view'
s.version = '0.0.18'
s.summary = 'A new flutter plugin project.'
s.description = <<-DESC
A new flutter plugin project.
Expand All @@ -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

2 changes: 1 addition & 1 deletion lib/camera_position.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:map_view/location.dart';
import 'package:cirrus_map_view/location.dart';

class CameraPosition {
final Location center;
Expand Down
2 changes: 1 addition & 1 deletion lib/cluster.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:ui';

import 'package:map_view/marker.dart';
import 'package:cirrus_map_view/marker.dart';

class Cluster extends Marker {
final int clusterCount;
Expand Down
6 changes: 3 additions & 3 deletions lib/map_options.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:map_view/camera_position.dart';
import 'package:map_view/location.dart';
import 'package:map_view/map_view_type.dart';
import 'package:cirrus_map_view/camera_position.dart';
import 'package:cirrus_map_view/location.dart';
import 'package:cirrus_map_view/map_view_type.dart';

class MapOptions {
/// Allows the app to receive location updates.
Expand Down
16 changes: 8 additions & 8 deletions lib/map_view.dart
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:map_view/camera_position.dart';
import 'package:map_view/indoor_building.dart';
import 'package:map_view/location.dart';
import 'package:map_view/map_options.dart';
import 'package:map_view/marker.dart';
import 'package:map_view/polygon.dart';
import 'package:map_view/polyline.dart';
import 'package:map_view/toolbar_action.dart';
import 'package:cirrus_map_view/camera_position.dart';
import 'package:cirrus_map_view/indoor_building.dart';
import 'package:cirrus_map_view/location.dart';
import 'package:cirrus_map_view/map_options.dart';
import 'package:cirrus_map_view/marker.dart';
import 'package:cirrus_map_view/polygon.dart';
import 'package:cirrus_map_view/polyline.dart';
import 'package:cirrus_map_view/toolbar_action.dart';

export 'camera_position.dart';
export 'camera_position.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/polygon.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:ui';

import 'package:map_view/figure_joint_type.dart';
import 'package:map_view/location.dart';
import 'package:cirrus_map_view/figure_joint_type.dart';
import 'package:cirrus_map_view/location.dart';

class Polygon {
final String id;
Expand Down
4 changes: 2 additions & 2 deletions lib/polyline.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:ui';

import 'package:map_view/figure_joint_type.dart';
import 'package:map_view/location.dart';
import 'package:cirrus_map_view/figure_joint_type.dart';
import 'package:cirrus_map_view/location.dart';

class Polyline {
final String id;
Expand Down
Loading