Skip to content
Snippets Groups Projects
Commit 0b29970a authored by Knuiman, Bart's avatar Knuiman, Bart
Browse files

Bridges now go as intended.

parent 1d86639f
No related branches found
No related tags found
No related merge requests found
...@@ -13,6 +13,7 @@ namespace Mapbox.Vector.Tile ...@@ -13,6 +13,7 @@ namespace Mapbox.Vector.Tile
/* Added to this struct for easier managing layer info. */ /* Added to this struct for easier managing layer info. */
public int SelectedLayerIdx { get; set; } public int SelectedLayerIdx { get; set; }
public int RelativeHeight { get; set; }
} }
......
...@@ -197,7 +197,8 @@ namespace Wander ...@@ -197,7 +197,8 @@ namespace Wander
// Identify feature by specifying a (unique) index based on some criteria. This can very per // Identify feature by specifying a (unique) index based on some criteria. This can very per
// vector tile provider. // vector tile provider.
public void IdentifyLayers( Func<VectorTileLayer, List<KeyValuePair<string, object>>, int> selectionCallback ) public void IdentifyLayers( Func<VectorTileLayer, List<KeyValuePair<string, object>>, int> selectionCallback,
Func<VectorTileLayer, List<KeyValuePair<string, object>>, int> relativeHeightCallback )
{ {
for (int l = 0;l < layers.Count;l++) for (int l = 0;l < layers.Count;l++)
{ {
...@@ -212,6 +213,8 @@ namespace Wander ...@@ -212,6 +213,8 @@ namespace Wander
{ {
feature.SelectedLayerIdx = uniqueId; feature.SelectedLayerIdx = uniqueId;
} }
uniqueId = relativeHeightCallback( layer, feature.Attributes );
feature.RelativeHeight = uniqueId;
} }
} }
layersIdentified = true; layersIdentified = true;
...@@ -269,6 +272,12 @@ namespace Wander ...@@ -269,6 +272,12 @@ namespace Wander
if (polygons.vertices.Count == 0) if (polygons.vertices.Count == 0)
continue; continue;
if (feature.SelectedLayerIdx == 254)
continue;
if (feature.RelativeHeight > 0)
continue;
var poly = polygonLayers[lIdx][ftrIdx]; var poly = polygonLayers[lIdx][ftrIdx];
var mins = poly.mins; var mins = poly.mins;
var maxs = poly.maxs; var maxs = poly.maxs;
...@@ -293,7 +302,8 @@ namespace Wander ...@@ -293,7 +302,8 @@ namespace Wander
if (hit) break; if (hit) break;
cachedTriIdx = 0; cachedTriIdx += 1;
if(cachedTriIdx == triCount) cachedTriIdx = 0;
} }
if (hit) break; if (hit) break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment