How to calculate delta latitude and longitude for MapView component in React-Native?

前端 未结 2 1600
有刺的猬
有刺的猬 2021-02-20 06:03

How can i calculate delta-latitude and delta-longitude values form latitude and longitude values for MapView component in React-Native. Thank You

2条回答
  •  春和景丽
    2021-02-20 07:01

    longitudeDelta and latitudeDelta is described will in the source code MapView, where it says difference between the minimum and maximum points that you want displayed.

    So, if you want to find the latitudeDelta then you should calculate the max difference between your latitudes and likewise for the longitude delta. You can look at Ryan H.'s answer to see an actual implementation.

提交回复
热议问题