add Feature Collection
fun addFeatureCollection(featureCollection: FeatureCollection, action: DataBoundFeature.() -> Unit? = null): List<DataBoundFeature>
Add a GeoJSON FeatureCollection to this DataRenderer.
For convenience you can add a block to style your features on the fly. This block will be called once per feature in the FeatureCollection. For example:
dataRenderer.addFeatureCollection(myFeatureCollection) {
val randomColor = generateRandomeColor()
fillColor = randomColor
strokeColor = randomColor
strokeWeight = 2.0
}
Content copied to clipboard
Return
a list of DataBoundFeature linking those Feature with this DataRenderer.
Parameters
feature Collection
a GeoJSON FeatureCollection to draw.
action
a block to style each features before drawing it.