diff --git a/src/transform.js b/src/transform.js index ecbd06e4b8..ad08fe9926 100644 --- a/src/transform.js +++ b/src/transform.js @@ -307,14 +307,14 @@ transform.lookup = function (projection) { code = parts[1]; return $.ajax({ - url: 'https://epsg.io/?q=' + code + '&format=json' + url: 'https://epsg.io/' + encodeURIComponent(code) + '.proj4' }).done(function (data) { var result = (data.results || [])[0]; - if (!result || !result.proj4) { + if (!result) { return defer.reject(data).promise(); } - proj4.defs(projection, result.proj4); + proj4.defs(projection, result); return $.when(proj4.defs[projection]); }); }; diff --git a/tests/cases/transform.js b/tests/cases/transform.js index bc43e03113..3f5813c9da 100644 --- a/tests/cases/transform.js +++ b/tests/cases/transform.js @@ -124,7 +124,7 @@ describe('geo.transform', function () { geo.transform.lookup('EPSG:5000').then(spy); request = server.requests[0]; - expect(request.url).toMatch(/\?q=5000/); + expect(request.url).toMatch(/5000\.proj4/); request.respond(200, {'Content-Type': 'application/json'}, JSON.stringify({ status: 'ok', number_result: 1,