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?

Laurel
  • 5,965
  • 14
  • 31
  • 57
petur
  • 1,366
  • 3
  • 21
  • 42
  • 2
    That url is quite funny. The lengths some people will go to. – John Powell Oct 23 '14 at 19:28
  • 2
    I am glad you found the answer, which, is of course, ol-debug.js. I put some instructions on [gis.stackexchange](https://gis.stackexchange.com/questions/123449/how-do-i-create-a-local-web-gis-server-using-node-js/123460#123460) for how to run OL3 locally, if that is of any help. – John Powell Dec 04 '14 at 08:51
  • petur, why the downvote? Only trying to be helpful. – John Powell Dec 04 '14 at 09:38

3 Answers3

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 ;)

markov00
  • 3,682
  • 2
  • 24
  • 25
  • 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. – erilem Dec 04 '14 at 21:20
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

lexicore
  • 42,748
  • 17
  • 132
  • 221
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

John Powell
  • 12,253
  • 6
  • 59
  • 67
  • Should definitely not be used in production. :) – lexicore Oct 23 '14 at 19:41
  • 1
    @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. – John Powell Oct 23 '14 at 19:55
  • 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... – petur Oct 24 '14 at 07:46
  • Really. Go to this page, http://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. – John Powell Oct 24 '14 at 08:07
  • What do you mean by the prints, btw? – John Powell Oct 24 '14 at 08:33