Skip to content

Commit

Permalink
Proj4 doesn't include some projections by default. Include them.
Browse files Browse the repository at this point in the history
  • Loading branch information
manthey committed Jun 7, 2018
1 parent 05b534b commit 114b144
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/reprojection/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ $(function () {
node: '#map',
center: {x: 0, y: 0},
zoom: 2.5,
gcs: gcsTable[gcs],
gcs: gcsTable[gcs] || gcs,
unitsPerPixel: (range[1].x - range[0].x) / 256,
clampBoundsX: false,
clampBoundsY: false,
Expand All @@ -131,7 +131,7 @@ $(function () {
gcs: 'EPSG:3857',
attribution: $('#url-list [value="' + $('#layer-url').val() + '"]').attr(
'credit'),
minLevel: 4,
minLevel: query.minLevel ? parseInt(query.minLevel, 10) : 4,
keepLower: true,
wrapX: false,
wrapY: false
Expand Down
8 changes: 8 additions & 0 deletions src/transform.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
var proj4 = require('proj4');
/* These projections exist in proj4 but aren't included by default. */
proj4.Proj.projections.add(require('proj4/projections/equi'));
proj4.Proj.projections.add(require('proj4/projections/gauss'));
proj4.Proj.projections.add(require('proj4/projections/gstmerc'));
proj4.Proj.projections.add(require('proj4/projections/ortho'));
var util = require('./util');

/**
Expand Down Expand Up @@ -614,4 +619,7 @@ transform.vincentyDistance = function (pt1, pt2, gcs, baseGcs, ellipsoid, maxIte
};
};

/* Expose proj4 to make it easier to debug */
transform.proj4 = proj4;

module.exports = transform;

0 comments on commit 114b144

Please sign in to comment.