Center a map in d3 given a geoJSON object

后端 未结 11 2238
慢半拍i
慢半拍i 2020-11-21 22:55

Currently in d3 if you have a geoJSON object that you are going to draw you have to scale it and translate it in order to get it to the size that one wants and translate it

11条回答
  •  南方客
    南方客 (楼主)
    2020-11-21 23:23

    In addition to Center a map in d3 given a geoJSON object, note that you may prefer fitExtent() over fitSize() if you want to specify a padding around the bounds of your object. fitSize() automatically sets this padding to 0.

提交回复
热议问题