mapbox / mapbox/shp-write

Include a very basic, complete example as documentation?

Open
#122 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
321
Forks
195
PR merge metrics
No merged PRs in 30d

Description

First: thanks for your excellent work!

I'm a HTML+JS noobie, and it would have helped me a lot to see a complete, minimal example, with just HTML+JS:

```html



Shapefile Export



Export Shapefile


function exportShapefile() {
// Sample data
var data = {
type: 'FeatureCollection',
features: [{
type: 'Feature',
properties: {
name: 'Some polygon'
},
geometry: {
type: 'Polygon',
coordinates: [[
[-64.8, 32.3], [-65.5, 18.3], [-80.3, 25.2], [-64.8, 32.3]]]
}
}]
};

// Save the zip file
shpwrite.zip(data, { outputType: "blob" }).then(function (zipBlob) {
saveAs(zipBlob, "my_shapefile.zip");
});
}

```
It can be run here: https://jsfiddle.net/pd14t8ew/2/

It's really not very different from the existing doc, but it took me a while to find the correct inputs.
If you're interested, I could write a corresponding PR for documentation.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the existing documentation and compare it with the complete HTML+JS example and jsfiddle.net link in the issue. Add a minimal runnable example showing the required inputs and shapefile export, then verify that a reader can follow it from a blank HTML file.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.