tangrams/tangram-play

include mapzen.js code snippet

Closed this issue · 6 comments

I was unable to get the tangram.js embed code snippet working -- there were a lot of assumptions there that weren't clear to me. Assuming I'd need to import tangram.js and leaflet.js...

I suspect a mapzen.js code snippet would be more useful, but whatever we provide, it should include everything you'd need from the html and script loading tags to the script itself.

louh commented

hey @burritojustice - thanks for the feedback. For context, the code snippet was extracted from the simple-demo repository. I had opted to focus on just the minimum bare JavaScript and not the scaffolding around it. Clearly, it was not enough! You can imagine that this is difficult to dial in, because developers all have their own preferences and needs; there's no such thing as a one-size-fits-all solution. (and my suspicion, right or wrong, was that a developer would find a packaged boilerplate to contain code unsuitable for their environment, which is why I reduced it down.)

We'll explore a few different ways in iterations to find the most useful templates for code snippets. We are also tracking this issue in #389.

Thanks Lou. My thinking was that a developer experienced with Leaflet would easily be able to pare the snippet down, but someone less familiar with the stack would be able to use the snippet too.

louh commented

Preview.

feb-16-2017 13-57-24

Let's supercede #389.

CooL! this is just toggling the JS code snippet right or leaflet as well?

louh commented

The GIF is just showing turning the HTML scaffolding on and off. The tabs on the right can toggle between Mapzen.js and vanilla Leaflet/Tangram.

This is now working on dev, please try it out: https://dev.mapzen.com/tangram/play/#13.7507/40.7423/-74.1089

cc @burritojustice @rfriberg

looks great Lou!