We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I've added arrowheads along the path of a GeoJson. I'm wondering if there is a way to customize the stroke color to be different from fill color?
Here are the options I tried:
{ offset: "20%", repeat: "30%", symbol: L.Symbol.arrowHead({ pixelSize: zoom * 2, pathOptions: { fillOpacity: 1, weight: 0, // fill: true, // fillColor: "#c71002", color: "#c71002", stroke: true, strokeColor: "#fff" } }) } ]
The text was updated successfully, but these errors were encountered:
Try this code but it's static.
let arrow = L.polylineDecorator(layer, { id: layer._leaflet_id, patterns: [ { offset: '100%', endOffset: '100%', repeat: 0, symbol: L.Symbol.arrowHead({ pixelSize: 15, polygon: false, pathOptions: { fill: false, fillColor: '', fillOpacity: 1, stroke: true, color: feature.properties.color, opacity: 1, weight: 5, lineCap: 'square', lineJoin: 'miter', }, }), }, ], }).addTo(vm.map);
If you want it dynamically you will need something so:
this.arrowHeads.map((arrow) => { if (arrow.options.id === this.layerShape._leaflet_id) { arrow.options.patterns[0].symbol.options.pathOptions.weight = val; // Refresh map after update arrow value this.map.fitBounds(this.map.getBounds()); } });
Sorry, something went wrong.
No branches or pull requests
I've added arrowheads along the path of a GeoJson. I'm wondering if there is a way to customize the stroke color to be different from fill color?
Here are the options I tried:
The text was updated successfully, but these errors were encountered: