Conversation
|
Did Proj4js really break all backwards compatibility with a point release? Should we really drop all support for earlier versions Proj4js? Is proj4js hosted on a CDN somewhere? The GitHub folks tend not to like people using |
|
The API is still backwards compatible, but the namespace has changed. Anyway, we'll see that we can get the new proj4.js hosted on a CDN. @calvinmetcalf, any ideas on this? When done, I'll update the urls. And I see no reason why it would make sense to maintain support for earlier versions of Proj4js. |
just a quick comment. I'd suggest adding something to this effect to the api docs: ol3 handles 4326/3857 transform; for other projections, load proj4.js together with appropriate def(s); not compatible with older versions of Proj4js. I was going to add something to the docs based on @twpayne's comment on #1222 but there's no point if this new code is ready to roll. |
also, defs is now a function instead of an array |
why not just submit to cdnjs? |
|
so fyi the only version we published besides 1.3 was 1.1, so it would be more accurate to say we depreciated version 1.1, which in hindsight probobly shouldn't have been published anyway as it was very alpha quality) |
|
Not true @calvinmetcalf. There was 1.0 and 1.1 (same API as 1.0) published off SVN, and 1.0 has been used in production and together with other libraries for by many and for years. |
|
Ah woops I stated counting based off the wrong thing. Yeah add a note saying proj4 isn't backwards compatible with proj4js. Only a related note, going forward it's probably a bad idea for you guys to rely on objects being plane objects as opposed to function or anything else that is an object but has a different type. That's rarely explicitly documented and can be avoided with duck typing via 'obj && obj.prop' style tests. |
|
I think you can remove proj from examples/wmts-capabilities which afaics is just parsing text :-) |
|
This needs more work - I'll update the pull request to work with Proj4js 2.0.0. |
examples/wmts-ign.js
Outdated
There was a problem hiding this comment.
this whole business can be removed, can't it? AFAICS, the new proj doesn't do anything with spatialreference.org
There was a problem hiding this comment.
Yup, you may still need to include the epgs code thought
On Dec 8, 2013 11:47 AM, "Peter Robins" notifications@github.com wrote:
In examples/wmts-ign.js:
@@ -11,9 +11,9 @@ goog.require('ol.source.WMTS');
// CRS. We include the Proj4js definition of that projection to prevent
// Proj4js from requesting that definition from spatialreference.org.this whole business can be removed, can't it? AFAICS, the new proj doesn't
do anything with spatialreference.org—
Reply to this email directly or view it on GitHubhttps://github.com//pull/1228/files#r8185293
.
|
Proj4js 2.1.0 released and should push to cdnjs. If you update this please change from raw.github to the cdn Edit: Create Issue for cdnjs: cdnjs/cdnjs#2499 PS: rename Soldier-Boy -> ximex |
|
@Soldier-Boy Thanks for the hint, will do. As stated above, this needs more work anyway. |
|
A note about Proj4js, its use of Array methods map, filter, reduce, forEach, indexOf, Array.isArray, make it incompatible with IE8 and earlier which negates some of the benefit of #1605. |
|
I will point out that Microsoft no longer supports ie8 and there are
|
|
@calvinmetcalf I long for the day when IE users upgrade like other users do and we don't have to even think about supporting browsers before the current version :) Shims in conditional comments FTW. |
|
I updated the pull request based on @probins's suggestions. Transparent proj4js integration is still there, but much simpler, and the API was updated to make working with custom coordinate transform functions easier. This is ready for review. |
|
thanks @ahocevar. At first glance, this looks vg. I'll pull in your branch and take a more detailed look. |
|
I'm interested to have a look at this. Hope to do this tomorrow or Thursday. |
package.json
Outdated
There was a problem hiding this comment.
I think these are alpha sequence
There was a problem hiding this comment.
What does that mean? Should I remove the ~?
There was a problem hiding this comment.
The Tilda ~ means 1.1.x or I will take patches but not backwards compatible
changes, usually you want a carrot ^ which is 1.x.x or I will take all non
breaking changes
On Jul 8, 2014 5:40 AM, "Andreas Hocevar" notifications@github.com wrote:
In package.json:
@@ -30,6 +30,7 @@
"taffydb": "~2.7.0",
"temp": "~0.7.0",
"underscore": "~1.6.0",
- "walk": "~2.3.3"
- "walk": "~2.3.3",
- "proj4": "~2.1.4"
What does that mean? Should I remove the ~?
—
Reply to this email directly or view it on GitHub
https://github.com/openlayers/ol3/pull/1228/files#r14644507.
There was a problem hiding this comment.
what I meant was that proj4 begins with 'p' - it should be further up the list
|
one difference to note between using custom transforms and Proj4js is that the Proj4js code adds transforms between/among all supported projections, although you could fake that with custom by transforming via 4326 |
|
Thanks for your effort @ahocevar. I'll have another look tomorrow. |
yes, I wasn't meaning they needed to be addressed here |
There was a problem hiding this comment.
My editor's linter complains that these functions are used before they are defined. We could move them at the beginning of the file but this will make the example's code harder to read and understand. So let's keep them here. My eyes will bleed each time I open this file but I guess it's ok :-)
There was a problem hiding this comment.
You're right, and the reason why I decided to move the swisstopo code to the bottom was readability of the example code.
There was a problem hiding this comment.
@elemoine set the "predef":"nofunc" option on your linter for this project (assuming it's jshint)
There was a problem hiding this comment.
you could put this code in a separate file
There was a problem hiding this comment.
If the file is not compiled it will externs. We do that already for things that are in resources/example-behaviour.js.
But in this case I find it's good to have these function in the example's js file, because it gives more context to the reader, and thereby makes things easier to understand. So I'd rather keep them here.
|
I've just added a comment suggesting to cherry-pick https://github.com/elemoine/ol3/commit/6524124a763a7185e948408f4a5b9cf65d786ff3 from my branch. This looks really good and is a great improvement to the library. +1 for merging. |
👍 |
|
Thanks for all the reviews, waiting for Travis now 😄. |
|
@ahocevar if you're not already doing something, I can work on improving the docs. Should have something for review by tomorrow |
|
Please go ahead @probins, thanks! |
There was a problem hiding this comment.
I think this is wrong; I think this should read ... proj4(code). proj4.defs(code) returns null
Not sure how I managed to miss this whilst testing yesterday :-(
There was a problem hiding this comment.
This is correct. We want the definition, not the WGS84->projection forward/inverse. And proj4.defs('unknown') returns undefined, not null.
There was a problem hiding this comment.
yeah, you're right. There's something else wrong in my app ...
There was a problem hiding this comment.
have to use proj4 2.2; I had 2.1 in there from last month, which doesn't work :-(
There was a problem hiding this comment.
Yes, this is expected. Maybe also a documentation task...
This change updates ol3 to work with the new proj4.js. Proj4js versions < 2.2 are no longer supported.