-
Notifications
You must be signed in to change notification settings - Fork 85
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
Example for Polyline (ideally with arrows) #26
Comments
I have the same problem! for (let key = 0; key < value.length; key++){
let coords = project([value[key].lat, value[key].lon]);
let index = 0;
let markerSprite = new PIXI.Sprite(textures[index]);
var lineLatLngs = (value[key+1])
? [[value[key].lat, value[key].lon], [value[key+1].lat, value[key+1].lon]]
: [[value[key].lat, value[key].lon], [value[key].lat, value[key].lon]];
projectedLineCoords = lineLatLngs.map(coords=>{
return project(coords)
});
let line = new PIXI.Graphics();
line.lineStyle(3 / scale, 0x3388ff, 1);
line.x = projectedLineCoords[0].x;
line.y = projectedLineCoords[0].y;
projectedLineCoords.forEach(function(coords, index) {
if (index == 0) line.moveTo(0, 0);
else line.lineTo(coords.x - line.x, coords.y - line.y);
});
markerSprite.textureIndex = index;
markerSprite.x0 = coords.x;
markerSprite.y0 = coords.y;
markerSprite.anchor.set(0.5, 0.5);
let tint = d3.color(value[key].color);
markerSprite.tint = 256 * (tint.r * 256 + tint.g) + tint.b;
container.addChild(markerSprite);
container.addChild(line);
markerSprites.push(markerSprite);
lines.push(line);
markerSprite.dcId = value[key].dcId;
} But the problem is how to redraw lines when i change zoom. |
Hi. |
@vito2005 did you manage it? Could you share some sample if so? |
Hi,
After having hit the performance border with leaflet standard drawing I found your project and it really looks amazing!
Before starting to work on migrating my app I would like to ask for an example of drawing a Polyline. Ideally with having arrows ever n-th point. Is something like this available?
Thanks for your kind support
The text was updated successfully, but these errors were encountered: