Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support to google 3d tiles for query string #42

Open
kfarr opened this issue Mar 13, 2024 · 1 comment
Open

add support to google 3d tiles for query string #42

kfarr opened this issue Mar 13, 2024 · 1 comment

Comments

@kfarr
Copy link
Contributor

kfarr commented Mar 13, 2024

Currently the long / lat / height / API KEY are hardcoded in index.html: https://github.com/3DStreet/aframe-loader-3dtiles-component/blob/dev/examples/google-tiles/index.html#L38-L41

Instead, provide an option such as that a user can specify lat / long / height via querystring.

Optional: create a basic UI allowing user to set these values and set querystring to trigger component reload

Once this is working so a non-technical user can test, then add link to examples index page with screenshot https://github.com/nytimes/aframe-loader-3dtiles-component/blob/dev/index.html

@kfarr
Copy link
Contributor Author

kfarr commented Mar 22, 2024

Here's example code I put together for a different project on glitch that sets lat / long / elevation via querystring

     AFRAME.registerComponent("load-lat-long", {
        init: function () {
          const queryParams = new URLSearchParams(document.location.search);

          // Default is SF Fort Mason Northwest Pier Streetlight
          const demoLat = queryParams.get("lat") ?? 37.807193;
          const demoLong = queryParams.get("long") ?? -122.431964;
          const demoHeight = queryParams.get("elevation") ?? -28;

          console.log(demoLat, demoLong);
          this.el.setAttribute('loader-3dtiles', 'long', demoLong)
          this.el.setAttribute('loader-3dtiles', 'lat', demoLat)
          this.el.setAttribute('loader-3dtiles', 'height', demoHeight)
        },
      });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant