maptalks.biglayer icon indicating copy to clipboard operation
maptalks.biglayer copied to clipboard

redraw ExtrudePolygonLayer

Open jaronimoe opened this issue 7 years ago • 9 comments

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

jaronimoe avatar Jan 16 '18 13:01 jaronimoe

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.

fuzhenn avatar Jan 17 '18 01:01 fuzhenn

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!

jaronimoe avatar Jan 17 '18 09:01 jaronimoe

Thanks for your understanding!

fuzhenn avatar Jan 18 '18 12:01 fuzhenn

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.

jaronimoe avatar Jan 23 '18 16:01 jaronimoe

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

fuzhenn avatar Jan 30 '18 09:01 fuzhenn

thank you!

jaronimoe avatar Feb 01 '18 10:02 jaronimoe

Hii, Is the VectorLayer ready for Extrude Polygon like functionality now? Thank you.

andibuwono avatar Mar 24 '18 01:03 andibuwono

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.

fuzhenn avatar Mar 26 '18 04:03 fuzhenn

Many thanks, looking forward for that

andibuwono avatar Mar 26 '18 06:03 andibuwono