Using the Mapbox Places Plugin, how to create proximity Point of current user's location?

51
September 03, 2019, at 10:40 AM

I'm trying to customize my autocomplete search results to places that are closer to the user's current location, however I'm stuck on creating a proximity Point to put into proximity(). In other words, I want to create a Point of the user's current location.

I have some conflicts in my understanding of what I found in the documentation. In the Mapbox point geometry GitHub, it provides this signature: Point(x, y), where x is the latitude and y is the longitude.

However, when creating a new Point object using com.mapbox.geojson, the following signature is requested instead: Point(type, bbox, coordinates). I do not know much about these arguments, but I also feel like I don't need them. Also, why is it that the coordinates in this signature are in a single argument as coordinates, as opposed to the other where it had two (x and y)?

I'm not sure how to complete my code below with a valid Point object because of these confusions. What am I supposed to do here?

Thanks!

(The following code is being applied to a PlaceAutocomplete object)

// Customize autocomplete search results
.placeOptions(PlaceOptions.builder()
.backgroundColor(Color.parseColor("#EEEEEE"))
.limit(10)
.proximity(new Point(/*???*/))
.build(PlaceOptions.MODE_CARDS))
READ ALSO
How can I estabilish a secure multiplayer system for a game that works online and offline too? [on hold]

How can I estabilish a secure multiplayer system for a game that works online and offline too? [on hold]

For example like in Hill Climb Racing 2, or Scrap Clicker 2, where you can play completely online, and even when you are not connected to internet, you can play the most features of the game, and can't trick the game with set the clock and doesn't have any way to change...

40
Is there a way to show activity from top, without making page to jerk on touch

Is there a way to show activity from top, without making page to jerk on touch

scroll starts from middle of activity, I tried to use FocusinTouchMode = true in rootview, it shows activity from top but on touching layout it jumps?

54
Grant “Write” Permission on the Root of Firebase Database (ONLY) to ALL Authenticated Users

Grant “Write” Permission on the Root of Firebase Database (ONLY) to ALL Authenticated Users

I am building an android app in which I want to permit any user that is registered and authenticated to be able to create a node on the root of the databaseBut I want ONLY HIM to be able to write to the child (and sub_child) nodes he created

26
ViewPager2 (AndroidX) causing issues with Count down timer

ViewPager2 (AndroidX) causing issues with Count down timer

I am building pager Recyclerview where each page has a timerAfter some seconds i need to change the page based on timer value

53