OpenLayers that is not minified?
Asked Answered
F

3

9

I'm trying to find an OpenLayers3.js file that is not minifed, it is a pain debugging stuff that is minified, can anyone help me find it?

Im using this address now: http://openlayers.org/en/v3.0.0/build/ol.js

By the way, it is a special thingy at the top. See the website: http://ol3.js.org/ ? Made me laugh.

Help?

Finagle answered 23/10, 2014 at 14:54 Comment(3)
That url is quite funny. The lengths some people will go to.Gillian
I am glad you found the answer, which, is of course, ol-debug.js. I put some instructions on gis.stackexchange for how to run OL3 locally, if that is of any help.Gillian
petur, why the downvote? Only trying to be helpful.Gillian
A
8

If you need the unminified ol, you can use the one from ol:

http://openlayers.org/en/v3.0.0/build/ol-debug.js

It's a file of 3.5M so don't use this in production ;)

Afflux answered 28/10, 2014 at 16:47 Comment(1)
ol-debug.js is just a concatenation (in dependency order) of the OpenLayers files and the Closure Library files on which the OpenLayers depends. So it's a very large file that should not be used for anything else than debugging.Turning
C
1

Have you tried the Download link on the main page?

https://github.com/openlayers/ol3/releases/download/v3.0.0/v3.0.0.zip

If you want a hosted version, upload one here:

https://cdnjs.com

Consistence answered 23/10, 2014 at 16:20 Comment(0)
G
1

Yes, http://openlayers.org/en/v3.0.0/examples/loader.js will load all the raw files -- basically by writing out a bunch of script tags. As @lexicore has already said, you can get the source from github, though this involves setting up nodejs locally to run (which actually isn't that painful, but more so than just debugging from a hosted source). Take a look at package.json to get a feel for how much has gone into OpenLayers 3.

If you go to the OpenLayers 3 examples, for example animation, change production to development in the drop down, and then do view source, you will get the link above. You can also see all the raw js files in the Javascript console.

EDIT: I put some instructions, following the official OL dev page, on how to build/run locally, which will also get you the unminified OL source code

Gillian answered 23/10, 2014 at 19:27 Comment(5)
Should definitely not be used in production. :)Consistence
@lexicore. No, sure, it does say development, but I agree with OP, trying to debug minified js isn't fun :-). I tried, for about a minute, to debug Arcgis Javascript API and Google Maps once -- scary stuff. Google closure does an amazing job of minification, though, which you obviously do want in production.Gillian
I'm able to run these locally, but the prints of the object are still in minified format. Like "V {Qa: Ic, Se: V, pd: null, c: 3, closure_uid_993555295: 45…}". I really want to see what the objects are...Finagle
Really. Go to this page, openlayers.org/en/v3.0.0/examples/animation.html?mode=raw, open chrome or ff dev console, view sources, and all the files are there, in non-minified form.Gillian
What do you mean by the prints, btw?Gillian

© 2022 - 2024 — McMap. All rights reserved.