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

redraw ExtrudePolygonLayer #24

Open
jaronimoe opened this issue Jan 16, 2018 · 9 comments
Open

redraw ExtrudePolygonLayer #24

jaronimoe opened this issue Jan 16, 2018 · 9 comments

Comments

@jaronimoe
Copy link

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

@fuzhenn
Copy link
Member

fuzhenn commented Jan 17, 2018

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.

@jaronimoe
Copy link
Author

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!

@fuzhenn
Copy link
Member

fuzhenn commented Jan 18, 2018

Thanks for your understanding!

@jaronimoe
Copy link
Author

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.

@fuzhenn
Copy link
Member

fuzhenn commented Jan 30, 2018

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

@jaronimoe
Copy link
Author

thank you!

@andibuwono
Copy link

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

@fuzhenn
Copy link
Member

fuzhenn commented Mar 26, 2018

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.

@andibuwono
Copy link

Many thanks, looking forward for that

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

No branches or pull requests

3 participants