Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapzen Place Picker not starting and throwing exception #449

Closed
SumeetMoray opened this issue Sep 12, 2017 · 10 comments
Closed

Mapzen Place Picker not starting and throwing exception #449

SumeetMoray opened this issue Sep 12, 2017 · 10 comments

Comments

@SumeetMoray
Copy link

SumeetMoray commented Sep 12, 2017

Description

Hi, my android app currently uses Google Maps Place Picker which i want to replace with Mapzen Place Picker.I have followed the instructions given at this link : https://mapzen.com/documentation/android/places/#placepicker-ui

This tutorial tells that you can easily replace the google's place picker with mapzen picker.
but in my case the code is failing with an exception.

Be aware that The original code with Google Place Picker is working fine and not Crashing !

Stack Trace of the Exception


``09-12 20:36:48.246 18832-18832/org.taxireferral.enduserapp E/AndroidRuntime: FATAL EXCEPTION: main
                                                                             Process: org.taxireferral.enduserapp, PID: 18832
                                                                             java.lang.RuntimeException: Unable to start activity ComponentInfo{org.taxireferral.enduserapp/com.mapzen.places.api.internal.PlacePickerActivity}: android.view.InflateException: Binary XML file line #6: Binary XML file line #1: Error inflating class com.mapzen.android.graphics.MapView
                                                                                 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2659)
                                                                                 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2724)
                                                                                 at android.app.ActivityThread.-wrap12(ActivityThread.java)
                                                                                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1473)
                                                                                 at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                 at android.os.Looper.loop(Looper.java:154)
                                                                                 at android.app.ActivityThread.main(ActivityThread.java:6123)
                                                                                 at java.lang.reflect.Method.invoke(Native Method)
                                                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
                                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)
                                                                              Caused by: android.view.InflateException: Binary XML file line #6: Binary XML file line #1: Error inflating class com.mapzen.android.graphics.MapView
                                                                              Caused by: android.view.InflateException: Binary XML file line #1: Error inflating class com.mapzen.android.graphics.MapView
                                                                              Caused by: java.lang.reflect.InvocationTargetException
                                                                                 at java.lang.reflect.Constructor.newInstance0(Native Method)
                                                                                 at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
                                                                                 at android.view.LayoutInflater.createView(LayoutInflater.java:645)
                                                                                 at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:787)
                                                                                 at android.view.LayoutInflater.parseInclude(LayoutInflater.java:964)
                                                                                 at android.view.LayoutInflater.rInflate(LayoutInflater.java:854)
                                                                                 at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
                                                                                 at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
                                                                                 at android.view.LayoutInflater.inflate(LayoutInflater.java:426)
                                                                                 at android.view.LayoutInflater.inflate(LayoutInflater.java:377)
                                                                                 at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:414)
                                                                                 at android.app.Activity.setContentView(Activity.java:2418)
                                                                                 at com.mapzen.places.api.internal.PlacePickerActivity.onCreate(PlacePickerActivity.java:44)
                                                                                 at android.app.Activity.performCreate(Activity.java:6672)
                                                                                 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1140)
                                                                                 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2612)
                                                                                 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2724)
                                                                                 at android.app.ActivityThread.-wrap12(ActivityThread.java)
                                                                                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1473)
                                                                                 at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                 at android.os.Looper.loop(Looper.java:154)
                                                                                 at android.app.ActivityThread.main(ActivityThread.java:6123)
                                                                                 at java.lang.reflect.Method.invoke(Native Method)
                                                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
                                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)
                                                                              Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Ldagger/internal/ScopedProvider;
                                                                                 at com.mapzen.android.core.DaggerCoreDependencyInjector_CoreLibraryComponent.initialize(DaggerCoreDependencyInjector_CoreLibraryComponent.java:43)
                                                                                 at com.mapzen.android.core.DaggerCoreDependencyInjector_CoreLibraryComponent.<init>(DaggerCoreDependencyInjector_CoreLibraryComponent.java:35)
                                                                                 at com.mapzen.android.core.DaggerCoreDependencyInjector_CoreLibraryComponent.<init>(DaggerCoreDependencyInjector_CoreLibraryComponent.java:24)
                                                                                 at com.mapzen.android.core.DaggerCoreDependencyInjector_CoreLibraryComponent$Builder.build(DaggerCoreDependencyInjector_CoreLibraryComponent.java:82)
                                                                                 at com.mapzen.android.core.CoreDependencyInjector.<init>(CoreDependencyInjector.java:51)
                                                                                 at com.mapzen.android.core.CoreDependencyInjector.createInstance(CoreDependencyInjector.java:37)
                                                                                 at com.mapzen.android.core.CoreDI.init(CoreDI.java:13)
09-12 20:36:48.246 18832-18832/org.taxireferral.enduserapp E/AndroidRuntime:     at com.mapzen.android.graphics.MapView.initDI(MapView.java:68)
                                                                                 at com.mapzen.android.graphics.MapView.<init>(MapView.java:63)
                                                                                 	... 25 more
                                                                              Caused by: java.lang.ClassNotFoundException: Didn't find class "dagger.internal.ScopedProvider" on path: DexPathList[[zip file "/data/app/org.taxireferral.enduserapp-1/base.apk"],nativeLibraryDirectories=[/data/app/org.taxireferral.enduserapp-1/lib/arm, /data/app/org.taxireferral.enduserapp-1/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
                                                                                 at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
                                                                                 at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
                                                                                 at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
                                                                                 	... 34 more

``

Steps to Reproduce

I have used the following code to launch mapzen place picker. The picker doesnt open and crash before showing anything.

LatLng southwest = new LatLng(42.80749, -73.14697);
       LatLng northeast = new LatLng(44.98423, -71.58691);
       LatLngBounds bounds = new LatLngBounds(southwest, northeast);

       Intent intent = new PlacePicker.IntentBuilder()
               .setLatLngBounds(bounds)
               .build(getActivity());

       startActivityForResult(intent, PLACE_PICKER_REQUEST);

Mapzen SDK & Android Version

I am using android api 26 as a compile version and following mapzen api as gradle dependency

compile 'com.mapzen:mapzen-places-api:1.3.1'

@sarahsnow1
Copy link
Member

Thank you for the detailed bug report. I'm unable to reproduce this using the places version and android API version given, could you provide a little more information?

What does your dependency tree look like when you run ./gradlew :dependencies for your app module (ie. ./gradlew :app:dependencies)?

@SumeetMoray
Copy link
Author

Following is an output of executing ./gradlew :app:dependencies . The output was huge but i have only pasted here text from debugCompile section. Let me know you need the entire output.

Executing ./gradlew :dependencies did not produce any output

I am also pasting below my build.gradle from app module. Let me know if i am missing any dependencies. Or if it needs a different version of a library.

Anyway, its not a such a big issue. If the place picker does not work. I am thinking of building my own place picker and directly using Mapzen Autocomplete API. I would be happy to share the code under open source if you want.

PS : I have learned that if i use Google Places API in my android app i might require a commertial license which costs around 10000 $ annually. This is a huge amount considering the fact we require only geocoding api. Therefore we decided to look for alternatives and stumbled upon Mapzen geocoder.

Mapzen geocoder appears to be a very good option because it is giving a good results. I have also tested photon geocoder at http://photon.komoot.de. but photon geocoder lacks ability to sort results by focus point. Even nominatim lacks this. But Mapzens Pelias geocoder works just fine with focus points.


_debugCompile - ## Internal use, do not manually configure ##
+--- com.android.support:multidex:1.0.1
+--- com.mapzen:mapzen-places-api:1.3.1
|    +--- com.mapzen:mapzen-core:1.3.1 -> 1.3.2
|    |    +--- com.android.support:appcompat-v7:25.1.0 -> 25.3.1
|    |    |    +--- com.android.support:support-annotations:25.3.1
|    |    |    +--- com.android.support:support-v4:25.3.1
|    |    |    |    +--- com.android.support:support-compat:25.3.1
|    |    |    |    |    \--- com.android.support:support-annotations:25.3.1
|    |    |    |    +--- com.android.support:support-media-compat:25.3.1
|    |    |    |    |    +--- com.android.support:support-annotations:25.3.1
|    |    |    |    |    \--- com.android.support:support-compat:25.3.1 (*)
|    |    |    |    +--- com.android.support:support-core-utils:25.3.1
|    |    |    |    |    +--- com.android.support:support-annotations:25.3.1
|    |    |    |    |    \--- com.android.support:support-compat:25.3.1 (*)
|    |    |    |    +--- com.android.support:support-core-ui:25.3.1
|    |    |    |    |    +--- com.android.support:support-annotations:25.3.1
|    |    |    |    |    \--- com.android.support:support-compat:25.3.1 (*)
|    |    |    |    \--- com.android.support:support-fragment:25.3.1
|    |    |    |         +--- com.android.support:support-compat:25.3.1 (*)
|    |    |    |         +--- com.android.support:support-media-compat:25.3.1 (*)
|    |    |    |         +--- com.android.support:support-core-ui:25.3.1 (*)
|    |    |    |         \--- com.android.support:support-core-utils:25.3.1 (*)
|    |    |    +--- com.android.support:support-vector-drawable:25.3.1
|    |    |    |    +--- com.android.support:support-annotations:25.3.1
|    |    |    |    \--- com.android.support:support-compat:25.3.1 (*)
|    |    |    \--- com.android.support:animated-vector-drawable:25.3.1
|    |    |         \--- com.android.support:support-vector-drawable:25.3.1 (*)
|    |    +--- com.mapzen.tangram:tangram:0.5.0
|    |    |    +--- com.squareup.okhttp3:okhttp:3.5.0 -> 3.6.0
|    |    |    |    \--- com.squareup.okio:okio:1.11.0
|    |    |    +--- xmlpull:xmlpull:1.1.3.1
|    |    |    \--- com.android.support:support-annotations:25.0.0 -> 25.3.1
|    |    +--- com.mapzen.android:pelias-android-sdk:1.1.0
|    |    |    +--- com.android.support:appcompat-v7:25.1.0 -> 25.3.1 (*)
|    |    |    +--- com.android.support:support-v4:25.1.0 -> 25.3.1 (*)
|    |    |    +--- com.squareup.okhttp3:okhttp:3.5.0 -> 3.6.0 (*)
|    |    |    +--- com.squareup.okhttp3:logging-interceptor:3.5.0
|    |    |    |    \--- com.squareup.okhttp3:okhttp:3.5.0 -> 3.6.0 (*)
|    |    |    +--- com.squareup.retrofit2:retrofit:2.1.0 -> 2.2.0
|    |    |    |    \--- com.squareup.okhttp3:okhttp:3.6.0 (*)
|    |    |    +--- com.squareup.retrofit2:converter-gson:2.1.0 -> 2.2.0
|    |    |    |    +--- com.squareup.retrofit2:retrofit:2.2.0 (*)
|    |    |    |    \--- com.google.code.gson:gson:2.7 -> 2.8.0
|    |    |    +--- javax.annotation:javax.annotation-api:1.2
|    |    |    \--- com.github.frankiesardo:auto-parcel:0.3.1
|    |    +--- com.mapzen.android:lost:2.2.0
|    |    |    +--- com.android.support:support-annotations:24.2.1 -> 25.3.1
|    |    |    \--- com.android.support:appcompat-v7:24.2.1 -> 25.3.1 (*)
|    |    +--- com.google.dagger:dagger:2.0 -> 2.10
|    |    |    \--- javax.inject:javax.inject:1
|    |    \--- javax.annotation:javax.annotation-api:1.2
|    \--- com.android.support:appcompat-v7:25.1.0 -> 25.3.1 (*)
+--- com.mapzen:mapzen-android-sdk:1.3.2
|    +--- com.mapzen:mapzen-core:1.3.2 (*)
|    \--- com.mapzen:on-the-road:1.2.0
|         +--- com.android.support:support-v4:22.1.0 -> 25.3.1 (*)
|         +--- org.jetbrains.kotlin:kotlin-stdlib:1.0.6
|         |    \--- org.jetbrains.kotlin:kotlin-runtime:1.0.6
|         +--- com.squareup.okhttp3:okhttp:3.5.0 -> 3.6.0 (*)
|         +--- com.squareup.okhttp3:logging-interceptor:3.5.0 (*)
|         +--- org.apache.commons:commons-io:1.3.2
|         |    \--- commons-io:commons-io:1.3.2
|         +--- com.squareup.retrofit2:retrofit:2.1.0 -> 2.2.0 (*)
|         +--- com.squareup.retrofit2:converter-scalars:2.1.0
|         |    \--- com.squareup.retrofit2:retrofit:2.1.0 -> 2.2.0 (*)
|         \--- com.f2prateek.ln:ln:1.1.1
+--- com.google.firebase:firebase-messaging:11.0.4
|    +--- com.google.firebase:firebase-iid:[11.0.4] -> 11.0.4
|    |    +--- com.google.android.gms:play-services-basement:[11.0.4] -> 11.0.4
|    |    |    \--- com.android.support:support-v4:25.2.0 -> 25.3.1 (*)
|    |    \--- com.google.firebase:firebase-common:[11.0.4] -> 11.0.4
|    |         +--- com.google.android.gms:play-services-basement:[11.0.4] -> 11.0.4 (*)
|    |         \--- com.google.android.gms:play-services-tasks:[11.0.4] -> 11.0.4
|    |              \--- com.google.android.gms:play-services-basement:[11.0.4] -> 11.0.4 (*)
|    +--- com.google.android.gms:play-services-basement:[11.0.4] -> 11.0.4 (*)
|    \--- com.google.firebase:firebase-common:[11.0.4] -> 11.0.4 (*)
+--- com.airbnb.android:lottie:2.0.0
|    \--- com.android.support:appcompat-v7:25.3.1 (*)
+--- com.android.support:palette-v7:25.3.1
|    +--- com.android.support:support-compat:25.3.1 (*)
|    \--- com.android.support:support-core-utils:25.3.1 (*)
+--- com.android.support:cardview-v7:25.3.1
|    \--- com.android.support:support-annotations:25.3.1
+--- com.android.support:appcompat-v7:25.3.1 (*)
+--- com.android.support.constraint:constraint-layout:1.0.2
|    \--- com.android.support.constraint:constraint-layout-solver:1.0.2
+--- com.android.support:design:25.3.1
|    +--- com.android.support:support-v4:25.3.1 (*)
|    +--- com.android.support:appcompat-v7:25.3.1 (*)
|    +--- com.android.support:recyclerview-v7:25.3.1
|    |    +--- com.android.support:support-annotations:25.3.1
|    |    +--- com.android.support:support-compat:25.3.1 (*)
|    |    \--- com.android.support:support-core-ui:25.3.1 (*)
|    \--- com.android.support:transition:25.3.1
|         +--- com.android.support:support-annotations:25.3.1
|         \--- com.android.support:support-v4:25.3.1 (*)
+--- com.android.support:support-vector-drawable:25.3.1 (*)
+--- com.android.support:support-v4:25.3.1 (*)
+--- com.android.support:recyclerview-v7:25.3.1 (*)
+--- com.google.android.gms:play-services-location:11.0.4
|    +--- com.google.android.gms:play-services-base:[11.0.4] -> 11.0.4
|    |    +--- com.google.android.gms:play-services-basement:[11.0.4] -> 11.0.4 (*)
|    |    \--- com.google.android.gms:play-services-tasks:[11.0.4] -> 11.0.4 (*)
|    +--- com.google.android.gms:play-services-basement:[11.0.4] -> 11.0.4 (*)
|    \--- com.google.android.gms:play-services-tasks:[11.0.4] -> 11.0.4 (*)
+--- com.google.android.gms:play-services-maps:11.0.4
|    +--- com.google.android.gms:play-services-base:[11.0.4] -> 11.0.4 (*)
|    \--- com.google.android.gms:play-services-basement:[11.0.4] -> 11.0.4 (*)
+--- com.google.android.gms:play-services-places:11.0.4
|    +--- com.google.android.gms:play-services-base:[11.0.4] -> 11.0.4 (*)
|    +--- com.google.android.gms:play-services-basement:[11.0.4] -> 11.0.4 (*)
|    +--- com.google.android.gms:play-services-maps:[11.0.4] -> 11.0.4 (*)
|    \--- com.google.android.gms:play-services-tasks:[11.0.4] -> 11.0.4 (*)
+--- com.jakewharton:butterknife:8.5.1
|    +--- com.jakewharton:butterknife-annotations:8.5.1
|    |    \--- com.android.support:support-annotations:25.1.0 -> 25.3.1
|    +--- com.android.support:support-annotations:25.1.0 -> 25.3.1
|    \--- com.android.support:support-compat:25.1.0 -> 25.3.1 (*)
+--- com.google.dagger:dagger:2.10 (*)
+--- com.squareup.retrofit2:retrofit:2.2.0 (*)
+--- com.squareup.retrofit2:converter-gson:2.2.0 (*)
+--- com.squareup.okhttp3:okhttp:3.6.0 (*)
+--- com.google.code.gson:gson:2.8.0
+--- com.squareup.picasso:picasso:2.5.2
+--- com.roughike:bottom-bar:2.3.1
|    +--- com.android.support:appcompat-v7:25.3.0 -> 25.3.1 (*)
|    \--- com.android.support:design:25.3.0 -> 25.3.1 (*)
+--- com.facebook.stetho:stetho:1.5.0
|    +--- commons-cli:commons-cli:1.2
|    \--- com.google.code.findbugs:jsr305:2.0.1
+--- com.google.firebase:firebase-auth:10.0.1
|    +--- com.google.android.gms:play-services-base:10.0.1 -> 11.0.4 (*)
|    +--- com.google.android.gms:play-services-basement:10.0.1 -> 11.0.4 (*)
|    +--- com.google.firebase:firebase-common:10.0.1 -> 11.0.4 (*)
|    \--- com.google.android.gms:play-services-tasks:10.0.1 -> 11.0.4 (*)
+--- com.yalantis:ucrop:2.2.0
|    +--- com.android.support:appcompat-v7:24.2.0 -> 25.3.1 (*)
|    \--- com.squareup.okhttp3:okhttp:3.4.1 -> 3.6.0 (*)
\--- com.google.firebase:firebase-core:11.0.4
     \--- com.google.firebase:firebase-analytics:[11.0.4] -> 11.0.4
          +--- com.google.firebase:firebase-analytics-impl:[11.0.4] -> 11.0.4
          |    +--- com.google.android.gms:play-services-basement:[11.0.4] -> 11.0.4 (*)
          |    +--- com.google.firebase:firebase-iid:[11.0.4] -> 11.0.4 (*)
          |    +--- com.google.firebase:firebase-common:[11.0.4] -> 11.0.4 (*)
          |    \--- com.google.android.gms:play-services-tasks:[11.0.4] -> 11.0.4 (*)
          +--- com.google.android.gms:play-services-basement:[11.0.4] -> 11.0.4 (*)
          \--- com.google.firebase:firebase-common:[11.0.4] -> 11.0.4 (*)

_debugJackPlugin - ## Internal use, do not manually configure ##
No dependencies

following is the dump of build.gradle file in the app module

apply plugin: 'com.android.application'

android {

    compileSdkVersion 25
    buildToolsVersion "25.0.3"
    defaultConfig {
        applicationId "org.taxireferral.enduserapp"
        minSdkVersion 19
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
        signingConfig signingConfigs.config
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            signingConfig signingConfigs.config
        }
    }
    productFlavors {
    }
}

//configurations {
//    all*.exclude group: 'javax.inject', module: 'javax.inject'
//}

repositories {
    mavenCentral()
}


dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })


    compile 'com.mapzen:mapzen-places-api:1.3.1'
    compile 'com.mapzen:mapzen-android-sdk:1.3.2'


    compile 'com.google.firebase:firebase-messaging:11.0.4'
    compile 'com.airbnb.android:lottie:2.0.0'
    compile 'com.android.support:palette-v7:25.3.1'
    compile 'com.android.support:cardview-v7:25.3.1'
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:design:25.3.1'
    compile 'com.android.support:support-vector-drawable:25.3.1'
    compile 'com.android.support:support-v4:25.3.1'
    compile 'com.android.support:recyclerview-v7:25.3.1'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.google.android.gms:play-services-location:11.0.4'
    compile 'com.google.android.gms:play-services-maps:11.0.4'
    compile 'com.google.android.gms:play-services-places:11.0.4'
    compile 'com.jakewharton:butterknife:8.5.1'
    compile 'com.google.dagger:dagger:2.10'
    compile 'com.squareup.retrofit2:retrofit:2.2.0'
    compile 'com.squareup.retrofit2:converter-gson:2.2.0'
    compile 'com.squareup.okhttp3:okhttp:3.6.0'
    compile 'com.google.code.gson:gson:2.8.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.roughike:bottom-bar:2.3.1'
    compile 'com.facebook.stetho:stetho:1.5.0'
    compile 'com.google.firebase:firebase-auth:10.0.1'
    compile 'com.yalantis:ucrop:2.2.0'
    testCompile 'junit:junit:4.12'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
    annotationProcessor 'com.google.dagger:dagger-compiler:2.10'
}

apply plugin: 'com.google.gms.google-services'

@sarahsnow1
Copy link
Member

Great, thank you for all of this, it's very helpful! And now I know definitively what the issue is :)

The crash is happening because of the way dependency conflicts are resolved in gradle. Your app depends on a newer version of dagger (compile 'com.google.dagger:dagger:2.10') than our SDK does (+--- com.google.dagger:dagger:2.0 -> 2.10). You can see in the dependency tree output that gradle by default resolves the dependencies by taking the newest version which is not backwardly compatible with the one we depend on.

I've created an issue in our repo to upgrade to the latest version (#451) but in the meantime you will have to change the version you depend on to something compatible with 2.0 or handle the version conflict in some other way.

@SumeetMoray
Copy link
Author

SumeetMoray commented Sep 14, 2017

Thanks for your help ... You were right !
I changed dagger to 2.0 and it has worked just fine ...
Changing version to 2.0 has not caused any conflict in my project. so my app is working just fine.

The place picker looks good and loads faster than googles place picker. But you can improve it by allowing user to choose current location and pick a location by clicking on map. This app has a very good place picker you can checkout at this link Koomoot app playstore (Disclaimer : I have no association with this app)

@sarahsnow1
Copy link
Member

Great, I'm glad changing to 2.0 hasn't caused any conflicts in your app.

Regarding:

But you can improve it by allowing user to choose current location and pick a location by clicking on map.

This is possible with our place picker. You will need to set the bounds when starting the Activity and the map will be centered (https://github.com/mapzen/android/blob/master/docs/place-picker-ui.md). I'm going to close this issue but feel free to open a new one if there is still something missing or buggy in the PlacePickerUI. Thank you!

@SumeetMoray
Copy link
Author

Ya ... i forgot to see ... picking a location by clicking on map is actually possible (i was unable to notice it previously i didnt saw it ) ... but its allowed only for well known places like hospitals and shopping malls. What if a user wants to pick a place (from the map) which is not a well known place ?

Except for this everything else is just fine ... and good to go !

@sarahsnow1
Copy link
Member

The data you see on the map comes from our vector tile service which relies on a few large and well respected sources, most notably OpenStreetmap. Within that set are lots of places which aren't "well known". Take a look at our documentation for more details on the types of "points of interest" we include. And if you have specific places which you know exist but that you don't see on the map, the best way to include them is to add them to OpenStreetmap (our tile service will pull in these regular updates so they can be displayed on the map).

@SumeetMoray
Copy link
Author

I agree ... what i was trying to say is a different issue ... i mean to say user should be able to pick any location on the map. Currently this is not the case. You can pick only those places (including not so well known places) which are marked by a special marker ... For example : i cannot choose my home from the map even if i click on it because it is not marked by a special marker ... other place pickers do allow users to pick just any location ... try clicking on the map ... you will get what i mean to say ...

@sarahsnow1
Copy link
Member

Thanks for the clarification. This is behavior we intend to add in the future but just haven't had time to do so yet. I created a ticket to track the work. At the moment, I can't say we will implement it but feel free to create a PR if you're up for it/need it soon (we love external contributions)! Otherwise, you can track progress in that issue. Thanks for your thorough investigation of the Places API!

@SumeetMoray
Copy link
Author

You are welcome ! Sure i would love to contribute ... if i happen to implement the feature ... personally i always prefer open source code over propritiery code / libraries ... and i really appreciate that you guys at mapzen have made lot of awesome projects completely open source ... so thanks for that ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants