sul-dlss / earthworks

Geospatial discovery application for Stanford University Libraries.
https://earthworks.stanford.edu
Other
18 stars 3 forks source link

Add autogenerated code samples for using layers #1049

Open thatbudakguy opened 3 weeks ago

thatbudakguy commented 3 weeks ago

You can view this prototype by visiting the interactive prototype, visiting a layer detail page, and clicking "code samples" in the tools panel.

This deserves a little bit of thought with regard to maintainability: do we just have the code samples as string templates that get the layer ID, etc. injected into them? Do we do any work to validate that the code still runs/is up to date? Can they be tested? etc.

If directly writing out the code isn't the best way, perhaps step-by-step instructions or links would still be helpful. @mapninja is a good person to ask about how this will be used in practice (e.g. by students).

thatbudakguy commented 3 weeks ago

See #910 for details on the code snippets (I guess this is a duplicate).