The version of shpwrite.js on unpkg is out of date.
For example, https://unpkg.com/@mapbox/shp-write@latest/shpwrite.js (which, at time of writing, redirects to version 0.4.3 at https://unpkg.com/@mapbox/shp-write@0.4.3/shpwrite.js) does not contain the latest code. If you search there for the justType function it reads as:
function justType(type, TYPE) {
return function (gj) {
var oftype = gj.features.filter(isType(type));
return {
geometries: oftype.map(justCoords),
properties: oftype.map(justProps),
type: TYPE,
};
};
}
As opposed to what's in geojson.js for version 0.4.3:
|
function justType(gjType, shpType) { |
|
return function (gj) { |
|
var oftype = gj.features.filter(isType(gjType)); |
|
return { |
|
geometries: shpType === 'POLYLINE' ? [oftype.map(justCoords)] : oftype.map(justCoords), |
|
properties: oftype.map(justProps), |
|
type: shpType, |
|
}; |
|
}; |
|
} |
The version of shpwrite.js on unpkg is out of date.
For example, https://unpkg.com/@mapbox/shp-write@latest/shpwrite.js (which, at time of writing, redirects to version 0.4.3 at https://unpkg.com/@mapbox/shp-write@0.4.3/shpwrite.js) does not contain the latest code. If you search there for the
justTypefunction it reads as:As opposed to what's in geojson.js for version 0.4.3:
shp-write/src/geojson.js
Lines 13 to 22 in 48a0fe7