I was wondering what are the necessary files for hosting a webgis server with OpenLayers3 without using a CDN?

I am testing on a localhost without internet access. It doesn't work to merely copy the direct js (and css) file pointed to by a CDN such as


to the local webserver as <script src="js/ol.js"></script>.

Also, the same question holds for jquery and bootstrap. I had

<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>

But I wasn't sure how to get a complete local version for those.

  • You can run your own server using nodejs locally, if you first pull all the source files from github. You will not need an internet connection for this. If you are interested in this approach, I will write it up. – John Powell Nov 25 '14 at 19:45
  • @JohnBarça Yes, I am interested in that approach. I've asked a new question about it gis.stackexchange.com/questions/123449/…, in case there are more traditional ways that should be considered right. I did notice openlayers has something named npm in it, but I am not familiar with using node.js. Thanks. – tinlyx Nov 25 '14 at 21:40

Download the v3.0.0 distribution from https://github.com/openlayers/ol3/releases , then copy the js file(s) inside the build/ subdirectory to your webserver.

| improve this answer | |
  • Thanks. This works. I was looking at the source tar ball, which didn't have the build subdir. – tinlyx Nov 25 '14 at 23:06

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.