Skip to content

Commit

Permalink
comments from pr resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
bozmir committed Oct 21, 2024
1 parent e7ce8fc commit a3ef2dd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
8 changes: 6 additions & 2 deletions Assets/Scripts/Layers/LayerTypes/RootLayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Runtime.Serialization;
using Netherlands3D.Twin.Projects;
using Newtonsoft.Json;
using UnityEngine.Events;

namespace Netherlands3D.Twin.Layers
{
Expand All @@ -11,6 +12,8 @@ public class RootLayer : LayerData
{
[JsonIgnore] public List<LayerData> SelectedLayers { get; private set; } = new();

[JsonIgnore] private UnityAction<ProjectData> projectDataListener;

public RootLayer(string name) : base(name)
{

Expand All @@ -19,7 +22,8 @@ public RootLayer(string name) : base(name)
public void Initialize()
{
ReconstructParentsRecursive();
ProjectData.Current.OnDataChanged.AddListener(data => UpdateLayerTreeOrder(0));
projectDataListener = data => UpdateLayerTreeOrder(0);
ProjectData.Current.OnDataChanged.AddListener(projectDataListener);
}

public void AddLayerToSelection(LayerData layer)
Expand Down Expand Up @@ -49,7 +53,7 @@ public override void DestroyLayer()
{
child.DestroyLayer();
}

ProjectData.Current.OnDataChanged.RemoveListener(projectDataListener);
ProjectData.Current.RemoveLayer(this);
LayerDestroyed.Invoke();
}
Expand Down
3 changes: 1 addition & 2 deletions Assets/_Functionalities/Wms/Scripts/WMSImportAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,7 @@ public List<WMSLayerQueryParams> GetWmsLayers()
if (styles.Count > 0)
layerQueryParams.style = styles[0]; // Pick the first style by default
else
layerQueryParams.style = "";
//layerQueryParams.style = string.Join(",", styles);
layerQueryParams.style = "";

}
layers.Add(layerQueryParams);
Expand Down
4 changes: 1 addition & 3 deletions Assets/_Functionalities/Wms/Scripts/WMSTileDataLayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ protected override IEnumerator DownloadDataAndGenerateTexture(TileChange tileCha
{
Debug.LogWarning($"Could not download {url}");
RemoveGameObjectFromTile(tileKey);
callback(tileChange);
}
else
{
Expand All @@ -98,10 +97,9 @@ protected override IEnumerator DownloadDataAndGenerateTexture(TileChange tileCha

//set the render index, to make sure the render order is maintained
textureDecalProjector.SetPriority(renderIndex);

}
callback(tileChange);
}
callback(tileChange);
}

private void UpdateDrawOrderForChildren()
Expand Down

0 comments on commit a3ef2dd

Please sign in to comment.