Reverse geocoding with big array is fastest way? - javascript and performance

前端 未结 4 1053
终归单人心
终归单人心 2021-01-07 00:30

I have many points on Google Maps and I want to show for each point the nearest city (so a reverse geocoding). I have a multidimensional array like this:

4条回答
  •  情话喂你
    2021-01-07 00:37

    You may want to sort after the second array element:

     citta_vicine.sort(function(a, b) {
       return a[1] - b[1];
     }); 
    

提交回复
热议问题