iTowns / itowns

A Three.js-based framework written in Javascript/WebGL for visualizing 3D geospatial data
http://www.itowns-project.org
Other
1.09k stars 293 forks source link

Naming convention for Dynamic Layer #1908

Open agrignard opened 1 year ago

agrignard commented 1 year ago

I create a new issue though it might related somehow to this one https://github.com/iTowns/itowns/issues/1863

When updating from itowns v 2.37to 2.38 we had a demo that didn't work anymore

I am trying to explain what happens here

Your Environment

Context

The demo is part and using the of UD_VIZ framework and the code can be found here

So with 2.37 version of itowns despite this issue related to the addition and removal of layer , the demo was working with the following code

  1. Every iteration I would remove the existing layer with app.view3D.getItownsView().removeLayer("PEOPLE");
  2. adding a new one (corresponding to a next step of a simualtion gama_layer = new itowns.FeatureGeometryLayer("PEOPLE", {...

However when updating to itowns 2.38 we saw that the demo was not working anymore as the layer were not displayed anymore (just very briefly on the first frame). By investigating more and with the help of @valentinMachado we found the issue and realised that changing the name of the layer every time would fix the problem as you can see in this commit https://github.com/VCityTeam/UD_ReAgent_ABM/commit/91d8f065fba8e4cf6647992d5ec06e7f30bd2e92

We wanted to let you know this change of behavior to know if it was made by purpose also we have an issue now is that the name of the layer which is supposed to represents people moving had to be named "PEOPLE"whereas with a dyamic name that will depend on the iteration.

Steps to Reproduce (for bugs)

1. 3. 4. 5.

Expected Behavior

As it was with 2.37 to be able to add/remove any layer on the fly

Actual Behavior

The new layer needs a different id that the previous one

mgermerie commented 1 year ago

Hi, thanks for this issue. I will be on leave for the rest of the week, but I will look at it when I return next week.