Skip to content
New issue

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

Change thickness of lines proportional to flow quantities #23

Open
osper66 opened this issue Sep 24, 2020 · 2 comments
Open

Change thickness of lines proportional to flow quantities #23

osper66 opened this issue Sep 24, 2020 · 2 comments
Labels

Comments

@osper66
Copy link

osper66 commented Sep 24, 2020

Any idea?

Thanks for advance.

@jwasilgeo
Copy link
Owner

@osper66 is this what you are looking for? We have a demo that has different line widths (and colors) based on data attributes.

https://jwasilgeo.github.io/Leaflet.Canvas-Flowmap-Layer/docs/class-breaks-symbology/

https://github.com/jwasilgeo/Leaflet.Canvas-Flowmap-Layer/blob/master/docs/class-breaks-symbology/index.html#L94-L137

@osper66
Copy link
Author

osper66 commented Feb 7, 2021

If CanvasFlowmapLayer.js's destinationFeature in line:186's property has flow value(population, migration etc.) , change g this._animateCanvasLineSymbol(ctx, symbol, screenOriginPoint, screenDestinationPoint) in line:642 to this._animateCanvasLineSymbol(ctx, symbol, screenOriginPoint, screenDestinationPoint, lineWidths[feature.properties.population) where lineWidths are given by some scaling rule according to population value and finally change _animateCanvasLineSymbol: function(ctx, symbolObject, screenOriginPoint, screenDestinationPoint, lineWidth) in line:693 and ctx.lineWidth = lineWidth in line:695.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants