Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proj4 is not a function #4

Open
iceteabottle opened this issue Oct 17, 2018 · 4 comments
Open

proj4 is not a function #4

iceteabottle opened this issue Oct 17, 2018 · 4 comments

Comments

@iceteabottle
Copy link

iceteabottle commented Oct 17, 2018

Hi,
I've been trying to use this tool within an angular app (v. 4) and I get this error when I try call toWGS():
ERROR TypeError: proj4 is not a function

When I change the proj4 function call (index.js:23) to proj4.default() it works.

@derhuerst
Copy link

derhuerst commented Oct 17, 2018

Please provide a minimal code snippet that reproduces the error.

@AndyWoerner
Copy link

hi,
ive the same problem with the toGK function.
Line61: to proj4.default() it works as well.

@derhuerst
Copy link

@juliuste

With proj4@^2.4.4 (which currently is proj4@2.7.0), proj4.default is not a function.

const projected = proj4.default(epsg[epsgFromZone(zone)], 'WGS84', Object.assign({}, coordinates))

@FloEdelmann
Copy link

It probably depends on the bundler and its configuration. This could be mitigated by something like:

let proj4 = require('proj4');

if (typeof proj4 !== 'function') {
  proj4 = proj4.default;
}

const projected = proj4();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants