Last active
September 19, 2019 10:06
-
-
Save jknair0/eddcff3170dae8c61e025335c9a68504 to your computer and use it in GitHub Desktop.
highlight a feature in mapbox android
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private fun updateScannedFeatures(scannedCodeStatus: List<ScannedCodeStatus>) { | |
| val loadedStyle = mapBoxMap?.style ?: return | |
| val mainSolarTablesLayer = loadedStyle.getLayer(MAIN_SOLAR_TABLES_LAYER_ID) as? FillLayer ?: return | |
| val uidLiteralsArray = scannedCodeStatus.map { it.featureUid } | |
| val stops = uidLiteralsArray.map { Expression.stop(it, Expression.color(Color.RED)) } | |
| mainSolarTablesLayer.setProperties( | |
| PropertyFactory.fillColor( | |
| Expression.match(Expression.get("uid"), | |
| Expression.color(Color.BLACK), | |
| * stops.toTypedArray() | |
| ) | |
| ) | |
| ) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment