Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iammert/easymap
Ready to use Address Selection Library using Google Maps and Places API.
https://github.com/iammert/easymap
address-selection android googlemaps googlemaps-api kotlin maps places places-api
Last synced: 2 months ago
JSON representation
Ready to use Address Selection Library using Google Maps and Places API.
- Host: GitHub
- URL: https://github.com/iammert/easymap
- Owner: iammert
- Created: 2019-08-20T20:22:39.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-01-16T14:56:14.000Z (almost 5 years ago)
- Last Synced: 2024-03-02T23:35:42.120Z (10 months ago)
- Topics: address-selection, android, googlemaps, googlemaps-api, kotlin, maps, places, places-api
- Language: Kotlin
- Homepage:
- Size: 4.05 MB
- Stars: 83
- Watchers: 3
- Forks: 25
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# EasyMap
Ready to use address selection activity using Google Maps.# Features
- Select location from maps
- Search address (Places api works behind)
- Ready to use address form (Address title, floor, door, description etc.)
- Automatically access and show current location.# Demo
# Implementation
## Enable Google Maps and Places APIs
* Go to google maps api page from google cloud console from [here](https://console.cloud.google.com/google/maps-apis/apis/maps-android-backend.googleapis.com/metrics?). Enable it from the top of the page.
* Go to google places api page from google cloud console from [here](https://console.cloud.google.com/google/maps-apis/apis/places-backend.googleapis.com/metrics?). Enable it from the top of the page.## Get the API Key from Console
* Follow [this](https://developers.google.com/maps/documentation/android-sdk/get-api-key) link and get API key from Google Cloud Console.
* In AndroidManifest.xml, add the following element as a child of the element, by inserting it just before the closing tag:
```xml```
## You are ready
```kotlin
startActivityForResult(EasyMapsActivity.newIntent(context = this), REQUEST_CODE)
// If you want to edit selected address
startActivityForResult(EasyMapsActivity.newIntent(context = this, selectedAddressInfo = selectedAddressInfo), REQUEST_CODE)
``````kotlin
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
if (requestCode == REQUEST_CODE && resultCode == Activity.RESULT_OK) {
selectedAddressInfo = data?.extras?.getParcelable(EasyMapsActivity.KEY_SELECTED_ADDRESS)
}
}
```# Dependency
```groovy
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}dependencies {
implementation 'com.github.iammert:EasyMap:0.1'
}
```License
--------Copyright 2019 Mert Şimşek
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 athttp://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.