I created GeoJson with geojson.io:
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"stroke": "#555555",
"stroke-width": 1,
"stroke-opacity": 1,
"fill": "#cc1414",
"fill-opacity": 0.5
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
38.91359567642212,
47.25578268604025
],
[
38.91415894031525,
47.25578268604025
],
[
38.91415894031525,
47.25588827416263
],
[
38.91359567642212,
47.25588827416263
],
[
38.91359567642212,
47.25578268604025
]
]
]
}
}
]
}
There is fill color in properties:
"properties": {
"stroke": "#555555",
"stroke-width": 1,
"stroke-opacity": 1,
"fill": "#cc1414",
"fill-opacity": 0.5
}
Then I convert it from String to JSONObject like this: JSONObject(geoJsonString), and this is how I apply layer to the map:
fun drawPolygons(jsonObj: JSONObject) {
map?.let { map ->
val layer = GeoJsonLayer(map, jsonObj)
layer.addLayerToMap()
}
}
But Google map ignoring all properties at all. No fill color, no stroke width. I need to apply it all from geojson string, without a code. How to do it?