Appearance
函数: flip()
flip<
T>(geojson:T,options?: {mutate?:boolean; }):T
Function
Takes input features and flips all of their coordinates from [x, y] to [y, x].
类型参数
T
T extends AllGeoJSON
参数
geojson
T
input features
options?
Optional parameters
mutate?
boolean
allows GeoJSON input to be mutated (significant performance increase if true)
返回
T
a feature or set of features of the same type as input with flipped coordinates
示例
ts
var serbia = turf.point([20.566406, 43.421008]);
var saudiArabia = turf.flip(serbia);
//addToMap
var addToMap = [serbia, saudiArabia];