Popularity
2.9
Growing
Activity
1.7
Declining
99
13
31

Description

Vanilla Place Picker provides a UI that displays an interactive map to get the place details and Autocomplete functionality, which displays place predictions based on user search input.

Developers often come across a requirement of adding precise location. So, a place picker which is easy to implement, less time consuming, and simple enough for users to use it is always in demand and here we have a Vanilla Place Picker which developer can add it in quick simple steps.

Programming language: Kotlin
License: MIT License
Tags: Kotlin     UI     Android     Mapview Widget     Maps     Placepicker    

Vanilla Place Picker alternatives and similar packages

Based on the "Kotlin" category.
Alternatively, view Vanilla Place Picker alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of Vanilla Place Picker or a related project?

Add another 'Kotlin' Package

README

Vanilla Place Picker

Vanilla Place Picker provides a UI that displays an interactive map to get the place details and Autocomplete functionality, which displays place predictions based on user search input.

Developers often come across a requirement of adding precise location. So, a place picker which is easy to implement, less time consuming, and simple enough for users to use it is always in demand and here we have a Vanilla Place Picker which developer can add it in quick simple steps.

Preview

image image

Key features

  • Simple implementation for place picker either using Autocomplete, Map or both
  • Set your own custom map styles
  • Customise map pin icon
  • Set default location position
  • Use it without location permission
  • Choose to show only open businesses or all
  • Highly customise attributes
  • Multi languages support.
  • RTL layout support.

Usage

  • Dependencies

    Step 1. Add the JitPack repository to your build file

    Add it in your root build.gradle at the end of repositories:

        allprojects {
            repositories {
                ...
                maven { url 'https://jitpack.io' }
            }
        }
    

    Step 2. Add the dependency

    Add it in your app module build.gradle:

        dependencies {
            ...
            implementation 'com.github.Mindinventory:VanillaPlacePicker:0.1.2'
        }
    
  • Implementation

    Step 1. Add GOOGLE MAP API KEY to your AndroidManifest.xml:

      <application ... >
        ...
    
        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="@string/YOUR_GOOGLE_MAPS_API_KEY" />
    
      </application>
    

    Step 2. Add VanillaPlacePicker Builder in to your activity class:

    
            val intent = VanillaPlacePicker.Builder(this)
                .with(PickerType.MAP_WITH_AUTO_COMPLETE) // Select Picker type to enable autocompelte, map or both
                .withLocation(23.057582, 72.534458)
                .setPickerLanguage(PickerLanguage.HINDI) // Apply language to picker
                .setLocationRestriction(LatLng(23.0558088,72.5325067), LatLng(23.0587592,72.5357321)) // Restrict location bounds in map and autocomplete
                .setCountry("IN") // Only for Autocomplete
                .enableShowMapAfterSearchResult(true) // To show the map after selecting the place from place picker only for PickerType.MAP_WITH_AUTO_COMPLETE
    
                /*
                 * Configuration for Map UI
                 */
                .setMapType(MapType.SATELLITE) // Choose map type (Only applicable for map screen) 
                .setMapStyle(R.raw.style_json) // Containing the JSON style declaration for night-mode styling
                .setMapPinDrawable(android.R.drawable.ic_menu_mylocation) // To give custom pin image for map marker
                ...
    
                .build()
    
            startActivityForResult(intent, REQUEST_PLACE_PICKER)
    
        ...
    
        //----- override onActivityResult function to get Vanilla Place Picker result.
        override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
            super.onActivityResult(requestCode, resultCode, data)
            if (resultCode == Activity.RESULT_OK && data != null) {
                when (requestCode) {
                    REQUEST_PLACE_PICKER -> {
                         val vanillaAddress = VanillaPlacePicker.onActivityResult(data)
                    }
                }
            }
        }
    
    

Requirements

  • minSdkVersion >= 17
  • Androidx

LICENSE!

Vanilla Place Picker is MIT-licensed.

Let us know!

Weโ€™d be really happy if you send us links to your projects where you use our component. Just send an email to [email protected] And do let us know if you have any questions or suggestion regarding our work.


*Note that all licence references and agreements mentioned in the Vanilla Place Picker README section above are relevant to that project's source code only.