OpenLayers

From Wildsong
Jump to navigationJump to search

Search for OpenLayers on this wiki to find other relevant pages. Or look in the category.

What is OpenLayers?

OpenLayers (http://openlayers.org/) is a library of Javascript code you use on your Web server. You reference it from your own HTML and Javascript based pages, to put maps into your web site.

Docs for programmers: http://openlayers.org/en/latest/doc/

OpenLayers is very stable code. Version 4.3.2 was recently released. It supports tiled raster and vector layers. It supports editing. It seems to support everything that I want to do.

Books

OpenLayers is so popular in fact that there are even books about it. And it is so stable that even a book release two years ago is very useful. I removed all the books I had listed here because they were all more than 2 years old. :-) You can look in the History tab if you really want.

The Marin library has 3 ebooks.

I just bought OpenLayers 3.x Cookbook and I am going through it. Yes.. OL 4.x is out, but the big break was 2->3, 3->4 is a smaller jump and there aren't books on 4 yet.

My simple example

Go see http://maps.wildsong.biz/ which I will be putting up on Bellman because I am fond of that machine right now. Bellman is just so cute.

Choose a background. I want to use an ESRI basemap, to show that I can.

Let's start with this: https://github.com/kevinsigwart/EsriOpenLayersClient

cd /var/www/maps/html
git clone [email protected]:kevinsigwart/EsriOpenLayersClient.git

Now go to http://maps.wildsong.biz/EsriOpenLayersClient/ and see what we've done.

These are based on OpenLayers 2.13.1 but I want to use OpenLayers 4.3.2!

Change the ../lib/openlayers.js line to use https://cdnjs.cloudflare.com/ajax/libs/openlayers/4.3.2/ol-debug.js Not that simple though!