This problem is in IE8 and not in Firefox.

My first problem was that IE8 don't support JSON natively and I get the "JSON is undefined". I solved this by including json2 or json3.

Now JSON.parse (both json2 and json3) throws an exception on proj4.js because of a syntax error.

The projection (from the Danish Geodata Agency) used in leaflet is as follow:

 var crs = new L.Proj.CRS.TMS('EPSG:25832',
                              '+proj=utm +zone=32 +ellps=GRS80 +units=m +no_defs', 
                               [120000, 5900000, 1000000, 6500000], 
                               {resolutions: [1638.4, (...), 0.2, 0.1]

I have removed some of the values from {resolutions}.


proj4.js uses string and array functions (e.g. .split(), .map()) which are not built in to older browsers.

es5-shim (https://github.com/es-shims/es5-shim) fixes this; just load this JavaScript library before anything else (it is benign for newer browsers).


I have realised that proj4js doesn't work in IE below version 9

  • @JasonScheirer The OP is answering his own question (and it does appear to be an answer) – Erica Dec 16 '14 at 18:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.