3dstreet icon indicating copy to clipboard operation
3dstreet copied to clipboard

support other methods of referencing JSON for `street` component

Open kfarr opened this issue 5 years ago β€’ 0 comments

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 JSON property 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 JSONSelector and if JSON is empty then use that new parameter to fetch the JSON

kfarr avatar Dec 11 '20 04:12 kfarr