开发者

Android GoogleMaps: GeoJsonLayer.features change the order of geojson file

I have a location geojson file as below:

{
"type":"FeatureCollection", 
"features":[
  {"type":"Feature","properties":{"name":"West"}},
  {"type":"Feature","properties":{"name":"East"}},
  {"type":"Feature","properties":{"name":"North"}}
]}
var geoJsonLayer = GeoJsonLayer(googleMap, R.raw.location, this)

geoJsonLayer.features.forEach {
   print(it.properties)
}

I found the order of geoJsonLayer.features becomes:

{
  "East",
  "West",
  "North"
}

The official doc does not state if it returns feature elements randomly.

I wanted to iterate the geoJsonLayer.features to get the开发者_StackOverflow中文版 properties in the order shown in the location file.

Is there any workaround?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜