You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now using the mapbox-streets-v7 and mapbox-streets-v8 tile-sets querying place labels throws excpetions when parsing properties. The exception happens when the API returns duplicated keys. For example for the class property it returns both country and disputed_country.
The problematic code is in VectorTileFeatures.csGetProperties() method
publicDictionary<string,object>GetProperties(){if(0!=Tags.Count%2){thrownewException(string.Format("Layer [{0}]: uneven number of feature tag ids",_layer.Name));}Dictionary<string,object>properties=newDictionary<string,object>();inttagCount=Tags.Count;for(inti=0;i<tagCount;i+=2){properties.Add(_layer.Keys[Tags[i]],_layer.Values[Tags[i+1]]);}returnproperties;}
Suggested fix:
publicDictionary<string,object>GetProperties(){if(Tags.Count%2!=0)thrownewInvalidOperationException($"Layer [{_layer.Name}]: uneven number of feature tag ids");varproperties=newDictionary<string,object>();vartagCount=Tags.Count;for(vari=0;i<tagCount;i+=2){varkey=_layer.Keys[Tags[i]];varvalue=_layer.Values[Tags[i+1]];if(properties.TryGetValue(key,outvaroldValue)){if(Equals(value,oldValue)){continue;}else{// To work around the issue we started using this projects source directly in Unity. This logging should be different in the actual fixUnityEngine.Debug.LogWarning($"Overriding tile property. Key: {key}, Old value: {properties[key]}, New value: {value}");}}properties[key]=value;}returnproperties;}
The text was updated successfully, but these errors were encountered:
Right now using the
mapbox-streets-v7
andmapbox-streets-v8
tile-sets querying place labels throws excpetions when parsing properties. The exception happens when the API returns duplicated keys. For example for theclass
property it returns bothcountry
anddisputed_country
.The problematic code is in
VectorTileFeatures.cs
GetProperties()
methodSuggested fix:
The text was updated successfully, but these errors were encountered: