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?
精彩评论