I'm using the leaflet-gpx plugin to draw various .gpx files on my map. How can I change the color/style of it?
gpxvar[{{loop.index0}}] = new L.GPX("{{url_for('static', filename='gpx/' + r )}}", {
async: true,
marker_options: {
startIconUrl: "{{url_for('static', filename='img/pin-icon-start.png')}}",
endIconUrl: "{{url_for('static', filename='img/pin-icon-end.png')}}",
shadowUrl: "{{url_for('static', filename='img/pin-shadow.png')}}"
}
gpxvar is my L.GPX object, I tried the below code but it didn't change anything, any pointers?
var highlightStyle = {
color: '#9b1d41',
weight: 3,
opacity: 0.6,
fillOpacity: 0.65,
fillColor: '#9b1d41'
};
gpxvar[{{loop.index0}}].setStyle(highlightStyle);