3dstreet
3dstreet copied to clipboard
support other methods of referencing JSON for `street` component
Such as loading in assets like this
<a-asset-item id="messageText" src="message.html"></a-asset-item>
(from this example: https://glitch.com/edit/#!/aframe-model-viewer?path=index.html%3A21%3A0
or, in the same html file inline like this:
<script id="segments" type="application/json">
{
"segments": [
{
"width": 9,
"variantString": "inbound|left",
"type": "parking-lane"
},
{
"width": 5,
"variantString": "inbound|green",
"type": "bike-lane"
},
{
"width": 10.5,
"variantString": "inbound|car",
"type": "drive-lane"
},
{
"randSeed": 816290815,
"width": 1,
"variantString": "striped-buffer",
"type": "divider"
},
{
"width": 10.5,
"variantString": "outbound|car",
"type": "drive-lane"
},
{
"width": 5,
"variantString": "outbound|green",
"type": "bike-lane"
},
{
"width": 9,
"variantString": "outbound|right",
"type": "parking-lane"
}
]
}
</script>
Ideas:
- One way to support, use the same
JSONproperty but look to see if first character of string is#in which case treat the string value as an ID selector - Another way is to create a new parameter
JSONSelectorand ifJSONis empty then use that new parameter to fetch the JSON