Closed steve9164 closed 6 years ago
#start={"version":"0.0.05","initSources":[ { "catalog": [ { "name": "props-test", "type": "csv", "data": "sa4_code_2011,val,time\n101,2,2016-07-23\n102,3,2016-07-23\n101,4,2016-08-06\n102,5,2016-08-06", "featureInfoTemplate": { "name": "SA4 Code: {{SA4_CODE11}}", "template": "<h3>Property from CSV</h3><p>Value: <b>{{val}}</b></p><h3>Property from vector tile</h3><p>Area: <b>{{ALBERS_SQM}}</b></p>" }, "isEnabled": true } ] } ]}
TerriaJS branch vt_feature_info. This will work with any instance that uses vector tiles.
vt_feature_info
Using the above, properties available to feature info template are like this:
{ "asset_name_from_vector_tiles": "something", "available_capacity_from_vt": "[{\"year\":2016,\"capacity\":55,\"load\":41.6,\"available_capacity\":13.4}]", "csv_data_attribute": 43.7 }
and I don't think mustache can access the nested stringified data.
<chart>
<table>
terriaProperties
JSON.parse
@kring I included you in this in case you have an opinion on either of the "Actual questions" I included at the end.
For the Actual Question 2, yes I think we should expose all props.
Fixed by #2696.
Feature info template for testing
TerriaJS branch
vt_feature_info
. This will work with any instance that uses vector tiles.Problem
Using the above, properties available to feature info template are like this:
and I don't think mustache can access the nested stringified data.
Possible solutions:
<chart>
and<table>
terriaProperties
) in vector tile features that isJSON.parse
d before merging with data propertiesActual questions:
JSON.parse
mustache function?