maptalks.biglayer
maptalks.biglayer copied to clipboard
redraw ExtrudePolygonLayer
hi, I wanted to animate the extruded buildings by continuously increasing or decreasing their height. for this I simply update the data of the ExtrudePolygonLayer.
however, I was unable to figure out how to redraw the Layer once I updated the data.
kind regards
Thanks for the issue!
It doesn't have a method to update data.
maptalks.biglayer
is an experimental plugin about to retire, I am working on a new layer plugin (naming maptalks.vectortile
) to replace biglayer
to load data via in-memory vector tiles. The new one has animation support in nature.
So if you can wait for a while (about 3-4 weeks), I will keep you updated once the new plugin completes.
If you can't wait, please let me know, I will manage to add some new methods in ExtrudePolygonLayer for your requests.
thank you for the reply!
I was able to set the data via
polylayer.data = polys; //where polylayer is a maptalks.ExtrudePolygonLayer(..) object
my layer then contained the new data - so I thought if I simply trigger a redraw of that layer I would see the change.
if that's not possible, you do not have to add any new features to the deprecated plugin just for me - I can definitely wait.
cheers!
Thanks for your understanding!
I have another question concerning the extrudePolyLayer:
is it possible to change the direction of the incoming light?
currently the light source shines straight down onto the extruded building which means that the brightest face of a building is the one on top. however, for my purposes I use a tilted view, so it would be preferable if the light would shine from the front, for instance from the direction of the camera.
Sorry, didn't see your comment.
Yes, you can change the light direction by setting an option named lightPos
, the default is [0, 0, 35]
var layer = new maptalks.ExtrudePolygonLayer(id, data, {
lightPos : [0, 0, 35] //change to other direction you like
});
And there are some other possible useful options, please check out the source code: https://github.com/maptalks/maptalks.biglayer/blob/master/src/layer/ExtrudePolygonLayer.js#L70
thank you!
Hii, Is the VectorLayer ready for Extrude Polygon like functionality now? Thank you.
Hi @andibuwono , I'm working on a new gl renderer of VectorLayer, it may be ready in about 3-4 weeks.
It's designed to render geometries with webgl with convience of maptalks.VectorLayer
and maptalks.Geometry
. And of course extrusion will be included in.
You can refer to this issue for details.
Many thanks, looking forward for that