Skip to content

Instantly share code, notes, and snippets.

@sugarmo
Last active January 11, 2024 03:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sugarmo/5915287 to your computer and use it in GitHub Desktop.
Save sugarmo/5915287 to your computer and use it in GitHub Desktop.
Embed Github Things (geoJSON, 3D model)

Embedding your geoJSON map elsewhere

<script src="https://embed.github.com/view/geojson/<username>/<repo>/<ref>/<path_to_file>"></script>

Embedding your 3D model elsewhere

<script src="https://embed.github.com/view/3d/<username>/<repo>/<ref>/<path_to_file>"></script>

For example, if your map's URL is github.com/skalnik/secret-bear-clip/blob/master/stl/clip.stl, your embed code would be:

<script src="https://embed.github.com/view/3d/skalnik/secret-bear-clip/master/stl/clip.stl"></script>

By default, the embedded renderer is 420px x 620px, but you can customize the output by passing height and width variables as parameters at the end, such as ?height=300&width=500.

Note: ref can be a branch (like master), or the hash to an individual commit (like 2391ae).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment