Ionic 2 Google maps nearby


#1

Hello all
now im in develop apps like uber etc.
so basicly we must to add maps for conecting all driver to customer.
and i wan to ask about that point .

me (customer) -> write all the form like address,and long, lat. (In this point i can do )

after customer click button we call “confirm/order” customer side searching all driver nearby. (at this point, i dont get it about flow or some method i dont know.)

can you please suggest me about that method ???
is customer send data form to database first and then try search nearby or what ??

thanks !


#2

personally i would implement it in the backend
making a web service that receives the user current position
then the web service would return the nearby drivers



#3

so, driver updating realtime their location ???


#4

yeah …
in your app if the logged in user is well user
the will send his location once
if the logged in user is driver
the app will send his location in realtime

when the user click on order
his current position is sent to the server
the server already have the other drivers locations
then the server determines which drivers are closer to the user
the the server sends back their locations


#5

okey, i got it,
any suggestions for realtime send location ?


#6

yes, you can use firebase
there is plenty of tutorials on this subject


https://moquet.net/blog/realtime-geolocation-tracking-firebase


#7

Hai @MarcusIII
now i can get latitude and longitude from any user
and then i started search mehtod to determinant most near customer to driver. any suggest to execution that method ??


#8

Hi @anggaand123

sorry for the late reply been really sick lately
well it depends on your backend, specifically your database
but since the location you want to get locations near the customer is from firebase, i guess this will help you


https://firebase.googleblog.com/2013/09/geofire-location-queries-for-fun-and.html



#9

To add to Marcus,

You would add the native plugin Geolocation to your Ionic app to get the gps location of let’s say a driver. Still, I met some people who built these kind of apps, and Ionic native is just too slow for that (compared to a real native app).