Change LineString style for leaflet map with R shiny -
I have a leaflet map in R which contains lots of LineStrings in it. With a certain thickness, blue lines I Change the line color and the thickness depends on a weight variable. I read a geographical file and make a map. Adding the "style" section directly to Geojosan is not working in every litter feature. Here's my code for the map:
colchoice = "red" ptl_str = paste ("#! Function (feature, latlng) {return L.circleMarker (latlng, {radius: feature) Coefficient RDS = 5, filling colors: feature properties, fill corporate. '', Colchoice, '', color: '# 000', weight: 1, fillip: 0.8})}! " = "" M & lt; - Sheet $ new () m $ setView (c (38.892682, -77.031681), zoom = 12) m $ geoJson (geojson, onEachFeature = "#! Function (feature, layer) {layer.bindPopup (feature.properties.popup) }! # ", PointTolyar = PTL_Strict M This map formats the dots in a better way, but now I want to format lines differently. Thank you!
upfront: I do not know anything about R and what I'm sayingI'm not able to test it, but I know your way around the sheet in javascript and you can tell me how to go about completing in JS, so that you translate it R:
var geoJsonLayer = L.geoJson (data, {onEachFeature: function (feature, layer) {if (Layer Instance L. Polyline) {layer.setStyle ({'color': feature.properties.color})}} }}; Here's an example on the plunker:
Comments
Post a Comment