How to highlight line in <GeoJSONLayer/>
See original GitHub issueI have this code, Lines are drawn. But I want to highlight a line when hovered or clicked.
{Object.keys(this.props.pavements).length > 0 && (
<GeoJSONLayer
data={this.props.pavements}
linePaint={{
'line-color': ['get', 'color'],
'line-width': 10,
}}
lineLayout={{
'line-cap': 'round',
}}
lineOnClick={e => this.populateInfobox(e)}
lineOnMouseEnter={e => this.populateInfobox(e)}
/>
)}
What can I do in lineOnClick to change the color of the clicked line?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top Results From Across the Web
Highlighting selected geojson feature and return to ...
Point is that I'd like to have the selected feature to highlight when clicked and return to unselected state when another one is...
Read more >How to set line color in Geojson layer using xamarin forms
I am new in Xamarin forms I want to add a line color to my GeoJson Layer. How Can I do this. Please...
Read more >GeoJsonLayer - deck.gl
The outline will have "horizontal" lines closing the top and bottom polygons and a vertical line (a "strut") for each vertex on the...
Read more >update GeoJsonLayer feature color on click · Issue #3545
I'm using the deck.gl GeoJsonLayer to display regions on a map. through an event, I was able to make these regions selectable. what...
Read more >Highlight point features | Sample Code - ArcGIS Developers
This sample shows how to highlight features in a layer. Features in SceneLayer, FeatureLayer, CSVLayer, GeoRSSLayer and GraphicsLayer can be highlighted.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can use React state to provide a different
line-color
property after the click or provide a differentcolor
property on the clicked feature.I did it by saving the color property of GeoJson in redux and changing the color of the selected feature