Get Latitude and Longitude of all location that are within 10km radius of my current location through google map(using PHP)

后端 未结 3 540
半阙折子戏
半阙折子戏 2021-02-02 03:40

i am new to Google map things. i have a table in which there are list of all the location( the location of super stores) with their Latitude and Longitude .

Now i want t

3条回答
  •  感动是毒
    2021-02-02 04:18

    You can Use Following Query of Mysql to get all stores within specified miles

    select * from stores where lat!='' and lng!='' and ( 3959 * acos( cos( radians(" . $centerpoints['lat'] . ") ) * cos( radians( lat ) ) * cos( radians( lng ) - radians(" . $centerpoints['lng'] . ") ) + sin( radians(" . $centerpoints['lat'] . ") ) * sin( radians( lat ) ) ) ) < " . $distanceInMile
    

提交回复
热议问题