Skip to content

Commit

Permalink
settings now come from the layer gameobject itself because the templa…
Browse files Browse the repository at this point in the history
…te prefab will not be initialized correctly in webgl
  • Loading branch information
bozmir committed Oct 21, 2024
1 parent 5dcc7a6 commit 95ca251
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 19 deletions.
6 changes: 3 additions & 3 deletions Assets/_Functionalities/Wms/Prefabs/WMSLayer.prefab

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Assets/_Functionalities/Wms/Scripts/WMSImportAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void Execute(LocalFile localFile)
var sourceUrl = localFile.SourceUrl;
string url = sourceUrl.Split('?')[0];
var wmsFolder = new FolderLayer(url);

switch (wms.requestType)
{
case WMS.RequestType.GetCapabilities:
Expand Down
14 changes: 7 additions & 7 deletions Assets/_Functionalities/Wms/Scripts/WMSLayerGameObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ namespace Netherlands3D.Twin.Layers
/// </summary>
public class WMSLayerGameObject : CartesianTileLayerGameObject, ILayerWithPropertyData
{
public WMSTileDataLayer WMSProjectionLayer => wmsProjectionLayer;
public bool TransparencyEnabled => WMSProjectionLayer.TransparencyEnabled;
public int DefaultEnabledLayersMax => WMSProjectionLayer.DefaultEnabledLayersMax;
public Vector2Int PreferredImageSize => WMSProjectionLayer.PreferredImageSize;
public WMSTileDataLayer WMSProjectionLayer => wmsProjectionLayer;
public bool TransparencyEnabled = true; //this gives the requesting url the extra param to set transparancy enabled by default
public int DefaultEnabledLayersMax = 5; //in case the dataset is very large with many layers. lets topggle the layers after this count to not visible.
public Vector2Int PreferredImageSize = Vector2Int.one * 512;
public LayerPropertyData PropertyData => urlPropertyData;

private WMSTileDataLayer wmsProjectionLayer;
Expand All @@ -28,8 +28,8 @@ protected override void Awake()

protected override void Start()
{
base.Start();
wmsProjectionLayer.WmsUrl = urlPropertyData.Data.ToString();
base.Start();
WMSProjectionLayer.WmsUrl = urlPropertyData.Data.ToString();
LayerData.LayerOrderChanged.AddListener(SetRenderOrder);
SetRenderOrder(LayerData.RootIndex);
}
Expand All @@ -38,7 +38,7 @@ protected override void Start()
public void SetRenderOrder(int order)
{
//we have to flip the value because a lower layer with a higher index needs a lower render index
wmsProjectionLayer.RenderIndex = -order;
WMSProjectionLayer.RenderIndex = -order;
}

public virtual void LoadProperties(List<LayerPropertyData> properties)
Expand Down
9 changes: 1 addition & 8 deletions Assets/_Functionalities/Wms/Scripts/WMSTileDataLayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,7 @@
namespace Netherlands3D.Twin
{
public class WMSTileDataLayer : ImageProjectionLayer
{
//this gives the requesting url the extra param to set transparancy enabled by default
public bool TransparencyEnabled = true;

//in case the dataset is very large with many layers. lets topggle the layers after this count to not visible.
public int DefaultEnabledLayersMax = 5;

public Vector2Int PreferredImageSize = Vector2Int.one * 512;
{

public int RenderIndex
{
Expand Down

0 comments on commit 95ca251

Please sign in to comment.