Skip to content

Duplicate properties in the JSON cause a dictionary duplicate Key error #1

Description

@sbland

If there are multiple property keys with the same name i.e.:
"properties": {
"id": 1,
"lyr": "CityVerveBorderb-6yknyc",
"id": "1"
}
Unity will throw a error.

Can be resolved by updating parseProperties() in FeatureObject.cs to the following:

protected void parseProperties(JSONObject jsonObject) { for(int i = 0; i < jsonObject.list.Count; i++){ string key = (string)jsonObject.keys[i]; JSONObject value = (JSONObject)jsonObject.list[i]; try { properties.Add(key, value.str); } catch { Debug.LogWarning("Duplicate Key: " + key + " in properties"); } } }

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions