How can find nearest place from current location from given data.

后端 未结 3 567
-上瘾入骨i
-上瘾入骨i 2021-02-02 03:31

I have list of location address. from my current location, i need to get the nearest place and have to show it on map. How can i get nearest place from my current location. Firs

3条回答
  •  梦如初夏
    2021-02-02 04:11

    First get your current location Lattitude & Longitude, then get Lattitude & Longitude of each locations you have and find out distance of each place from your current location using distanceTo method of Location class and after that find out least distance from your list.

提交回复
热议问题