Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
SupasinTatiyanupanwong committed Apr 17, 2021
2 parents fd3f916 + e9f2c85 commit 5ba2c51
Show file tree
Hide file tree
Showing 195 changed files with 3,234 additions and 3,628 deletions.
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
#
# Copyright 2020 Supasin Tatiyanupanwong
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# Mac OS
.DS_Store

Expand Down
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Expand Down
76 changes: 41 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,52 @@
# Map Kit

Abstraction wrapper that encapsulates Maps APIs of supported platforms for Android, allowing access to multiple Maps APIs while maintaining your application single codebase.
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.supasintatiyanupanwong.libraries.android.kits.maps/maps-core/badge.svg)](https://search.maven.org/search?q=g:dev.supasintatiyanupanwong.libraries.android.kits.maps)
[![javadoc](https://javadoc.io/badge2/dev.supasintatiyanupanwong.libraries.android.kits.maps/maps-core/javadoc.svg)](https://javadoc.io/doc/dev.supasintatiyanupanwong.libraries.android.kits.maps/maps-core)
[![license](https://img.shields.io/github/license/SupasinTatiyanupanwong/map-kit-android.svg)](https://www.apache.org/licenses/LICENSE-2.0)

Map Kit is currently providing support for Google Maps and Huawei Maps.
Map Kit is an abstraction wrapper that encapsulates Android's Maps APIs of Google Maps SDK for Android and HUAWEI Map Kit.

## Usage
## Architecture

The library consists of 3 artifacts; `maps-core`, `maps-google`, and `maps-huawei`.

This project contains 3 artifacts; `maps-core`, `maps-google`, and `maps-huawei`.
`maps-core` artifact provides an abstraction interface to interact with Maps APIs.

`maps-core` artifact provides abstraction interface to interact with Maps APIs.
`maps-google` artifact provides the Google Maps SDK for Android integration to Map Kit.

`maps-google` artifact provides Google Maps integration.
`maps-huawei` artifact provides the HUAWEI Map Kit integration to Map Kit.

`maps-huawei` artifact provides Huawei Maps integration.
## Usage

### Migration from existing Maps APIs
### Migrating from the existing APIs

| Google Name | Huawei Name | Map Kit Name |
| Google Maps SDK for Android | HUAWEI Map Kit | Map Kit |
|:--------------------------------- |:------------------------- |:------------------------------------------------------------ |
| ``com.google.android.gms.maps.*`` | ``com.huawei.hms.maps.*`` | ``me.tatiyanupanwong.supasin.android.libraries.kits.maps.*`` |
| ``com.google.android.gms.maps.*`` | ``com.huawei.hms.maps.*`` | ``dev.supasintatiyanupanwong.libraries.android.kits.maps.*`` |
| ``GoogleMap`` | ``HuaweiMap`` | ``MapClient`` |
| ``new LatLng()`` | ``new LatLng()`` | ``MapKit.newLatLng()`` |
| ``new *Options()`` | ``new *Options()`` | ``MapKit.new*Options()`` |
| ``*.builder()`` | ``*.builder()`` | ``MapKit.new*Builder()`` |
| ``*Factory.*()`` | ``*Factory.*()`` | ``MapKit.get*Factory().*()`` |
| ``Tile.NO_TILE`` | ``Tile.NO_TILE`` | ``MapKit.noTile()`` |

### Limitations

1. Models are currently not `Parcelable`.
2. `*MapOptions` is currently not supported.
3. Google's `StreetView` is currently not supported.
### Limitation

### Additional documentation
* Models are not `Parcelable`.
* `MapOptions` is currently not supported.
* `StreetView` is currently not supported.

* [Maps SDK for Android - Google Developer](https://developers.google.com/maps/documentation/android-sdk/intro)
* [Map Kit - HMS Core - HUAWEI Developer](https://developer.huawei.com/consumer/en/hms/huawei-MapKit)
## Declaring dependencies

## Download

Add the following to your Gradle build file:
Add the dependencies for the artifacts you need in the `build.gradle` file for your app or module:

```groovy
dependencies {
implementation 'me.tatiyanupanwong.supasin.android.libraries.kits.maps:maps-google:1.2.2'
implementation 'me.tatiyanupanwong.supasin.android.libraries.kits.maps:maps-huawei:1.2.2'
// To use the Google Maps SDK for Android via Map Kit
implementation 'dev.supasintatiyanupanwong.libraries.android.kits.maps:maps-google:2.0.0'
// To use the HUAWEI Map Kit via Map Kit
implementation 'dev.supasintatiyanupanwong.libraries.android.kits.maps:maps-huawei:2.0.0'
}
```

Expand All @@ -54,7 +56,7 @@ However, it is recommended to separate builds between them as next:

```groovy
android {
...
// ...
flavorDimensions 'vendor'
productFlavors {
google
Expand All @@ -74,31 +76,35 @@ configurations {
}
dependencies {
google 'me.tatiyanupanwong.supasin.android.libraries.kits.maps:maps-google:1.2.2'
huawei 'me.tatiyanupanwong.supasin.android.libraries.kits.maps:maps-huawei:1.2.2'
google 'dev.supasintatiyanupanwong.libraries.android.kits.maps:maps-google:2.0.0'
huawei 'dev.supasintatiyanupanwong.libraries.android.kits.maps:maps-huawei:2.0.0'
}
```

`maps-core` may be used to provides Maps APIs interaction if needed, e.g. to pass `LatLng` object to different module.
But, make sure to have one of the integration artifacts included in your final build, otherwise an exception will be thrown at runtime.

```groovy
dependencies {
implementation 'me.tatiyanupanwong.supasin.android.libraries.kits.maps:maps-core:1.2.1'
}
```
For more information about dependencies, see [Add build dependencies](https://developer.android.com/studio/build/dependencies).

## Additional documentation

* [Maps SDK for Android - Google Developer](https://developers.google.com/maps/documentation/android-sdk/intro)
* [Map Kit - HMS Core - HUAWEI Developer](https://developer.huawei.com/consumer/en/hms/huawei-MapKit)

## Feedback

However, make sure to have one of integration artifacts included in your final build, otherwise an exception will be thrown.
Your feedback helps make Map Kit better. Let us know if you discover new issues or have ideas for improving this library.
Please take a look at the [existing issues](https://github.com/SupasinTatiyanupanwong/map-kit-android/issues) in this library before you create a new one.

## License

```
Copyright (C) 2020 Supasin Tatiyanupanwong
Copyright 2020 Supasin Tatiyanupanwong
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
40 changes: 19 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
/*
* Copyright 2020 Supasin Tatiyanupanwong
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

buildscript {
repositories {
google()
jcenter()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
classpath 'com.android.tools.build:gradle:4.1.3'

classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.13.0'
}
}

Expand All @@ -19,24 +35,6 @@ allprojects {
}
}

ext {
BINTRAY_REPOSITORY = 'android.libraries.kits.maps'
BINTRAY_LICENSES = ["Apache-2.0"]

POM_GROUP_ID = 'me.tatiyanupanwong.supasin.android.libraries.kits.maps'

POM_URL = 'https://github.com/SupasinTatiyanupanwong/map-kit-android'
POM_SCM_URL = 'https://github.com/SupasinTatiyanupanwong/map-kit-android'
POM_SCM_CONNECTION = 'https://github.com/SupasinTatiyanupanwong/map-kit-android.git'

POM_DEVELOPER_ID = 'supasintatiyanupanwong'
POM_DEVELOPER_NAME = 'Supasin Tatiyanupanwong'
POM_DEVELOPER_EMAIL = 'supasin@tatiyanupanwong.me'

POM_LICENCE_NAME = 'Apache License 2.0'
POM_LICENCE_URL = 'http://www.apache.org/licenses/LICENSE-2.0'
}

task clean(type: Delete) {
delete rootProject.buildDir
}
35 changes: 35 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,39 @@
#
# Copyright 2020 Supasin Tatiyanupanwong
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

org.gradle.jvmargs=-Xmx1536m

# Declare we support AndroidX
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

GROUP=dev.supasintatiyanupanwong.libraries.android.kits.maps

POM_INCEPTION_YEAR=2020

POM_URL=https://github.com/SupasinTatiyanupanwong/map-kit-android/
POM_SCM_URL=https://github.com/SupasinTatiyanupanwong/map-kit-android/
POM_SCM_CONNECTION=scm:git:git://github.com/SupasinTatiyanupanwong/map-kit-android.git
POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/SupasinTatiyanupanwong/map-kit-android.git

POM_LICENCE_NAME=The Apache Software License, Version 2.0
POM_LICENCE_URL=https://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST=repo

POM_DEVELOPER_ID=supasintatiyanupanwong
POM_DEVELOPER_NAME=Supasin Tatiyanupanwong
POM_DEVELOPER_URL=https://github.com/SupasinTatiyanupanwong/
50 changes: 0 additions & 50 deletions gradle/bintray.gradle

This file was deleted.

38 changes: 0 additions & 38 deletions gradle/install.gradle

This file was deleted.

16 changes: 16 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
#
# Copyright 2020 Supasin Tatiyanupanwong
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

#Wed Jun 10 20:05:43 ICT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
Expand Down
Loading

0 comments on commit 5ba2c51

Please sign in to comment.