OpenLayers: Difference between revisions

From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs)
mNo edit summary
Brian Wilson (talk | contribs)
 
(15 intermediate revisions by the same user not shown)
Line 3: Line 3:
== What is OpenLayers? ==
== What is OpenLayers? ==


OpenLayers (http://openlayers.org/) is a library of Javascript code you use on your Web server.
OpenLayers (http://openlayers.org/) is 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.
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/
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.
OpenLayers is very stable code. It supports tiled raster and vector layers. It supports editing.
It seems to support everything that I want to do.
It seems to support everything that I want to do.
== OpenLayers 6 is coming ==
Version 6 in beta now. I have started using it so that my project can keep up.
Here are the steps I took to work with the beta, along with the command I used.
# Download the zip of the beta source code from Github, openlayers/openlayers releases.
# Unpack it, for example '''unzip openlayers-6.0.0-beta.11.zip'''
# Build it. Chdir into the folder and then '''npm install && npm run build-package'''
# Remove ol 5 from my project to make sure it will use the beta. '''cd ../ol-react && npm uninstall ol'''
# Copy the new package into my project. '''cd ../ol-react && cp -r ../openlayers/build/ol .'''
# Tell npm to use it. '''npm install ./ol'''
You can run the OpenLayers samples too. '''npm start''' and go to http://localhost:8080/
In my project's home page (example0.js) I added 2 lines of code,
import {VERSION} from 'ol'
.
and added a little bit to the JSX portion.
.
Currently using OpenLayers version {VERSION}


== Books ==
== Books ==


OpenLayers is so popular in fact that there are even books about it.
OpenLayers is so popular that ''there are even books about it''! None for version 5 yet that I know of.
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.
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.
The [http://marinet.lib.ca.us/ Marin library] has ebooks via Safari but they are for version 3.
 
I 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. Or 5.
 
== My test samples ==
 
=== live server ===
 
Lately I have been working on https://map46.com
Sometimes I have http://maps.wildsong.biz/ up on [[Bellman]].
 
=== at github ===
 
Currently I am using Node.JS and testing on my desktop.
You can see code I have running here: https://github.com/brian32768/map46 and https://github.com/brian32768/OpenlayersTests
 
For the first week I extensively used [[Microsoft Visual Studio]] and [[Parcel]].
Since then I have learned enough JavaScript that I've just been using Emacs to edit, Parcel to build, and Chrome to test and debug.
 
That project has samples with OpenLayers 2, 4, and 5 (3 and 4 are the same basically so only one).
Because there were BOOKS on 2 and 3 I started there and built samples, got them running and then stepped up.
 
There is an example using XYZ so that I could test an ESRI tile server.
 
Now I am now adding a [[Bootstrap]] + OpenLayers sample so that I can make something that looks like a real web site.


I just bought OpenLayers 3.x Cookbook and I am going through it.
== OpenLayers + ArcGIS REST ==
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 ==
https://boundlessgeo.com/2015/12/improving-interoperability-between-openlayers-and-esri-arcgis-restv/


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


Choose a background. I want to use an ESRI basemap, to show that I can.
I have a separate page on [[React]].


Let's start with this: https://github.com/kevinsigwart/EsriOpenLayersClient
Three sample projects on Github, all stopped at OpenLayers 3.


cd /var/www/maps/html
This one actually just loads and runs, making me happy.
git clone git@github.com:kevinsigwart/EsriOpenLayersClient.git
[https://github.com/pka/ol3-react-example Pirmin Kalberer's OL3-React-Example]
Works right out of the box.


Now go to http://maps.wildsong.biz/EsriOpenLayersClient/ and see what we've done.
[https://github.com/richardhills/ol-react Richard Hill's ol-react]. Took me 1/2 a day to get it to build but there is no example on how to use it. Bad for me, a React newbie.


These are based on OpenLayers 2.13.1 but I want to use OpenLayers 4.3.2!
[https://github.com/allenhwkim/react-openlayers Allen Kim's react_openlayers]


[[Category: OepnLayers]]
[[Category: OpenLayers]]
[[Category: JavaScript]]
[[Category: GIS]]
[[Category: GIS]]

Latest revision as of 03:42, 25 July 2019

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

What is OpenLayers?

OpenLayers (http://openlayers.org/) is 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. It supports tiled raster and vector layers. It supports editing. It seems to support everything that I want to do.

OpenLayers 6 is coming

Version 6 in beta now. I have started using it so that my project can keep up.

Here are the steps I took to work with the beta, along with the command I used.

  1. Download the zip of the beta source code from Github, openlayers/openlayers releases.
  2. Unpack it, for example unzip openlayers-6.0.0-beta.11.zip
  3. Build it. Chdir into the folder and then npm install && npm run build-package
  4. Remove ol 5 from my project to make sure it will use the beta. cd ../ol-react && npm uninstall ol
  5. Copy the new package into my project. cd ../ol-react && cp -r ../openlayers/build/ol .
  6. Tell npm to use it. npm install ./ol

You can run the OpenLayers samples too. npm start and go to http://localhost:8080/

In my project's home page (example0.js) I added 2 lines of code,

import {VERSION} from 'ol'
.
and added a little bit to the JSX portion.
.
Currently using OpenLayers version {VERSION}

Books

OpenLayers is so popular that there are even books about it! None for version 5 yet that I know of. 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 ebooks via Safari but they are for version 3.

I 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. Or 5.

My test samples

live server

Lately I have been working on https://map46.com Sometimes I have http://maps.wildsong.biz/ up on Bellman.

at github

Currently I am using Node.JS and testing on my desktop. You can see code I have running here: https://github.com/brian32768/map46 and https://github.com/brian32768/OpenlayersTests

For the first week I extensively used Microsoft Visual Studio and Parcel. Since then I have learned enough JavaScript that I've just been using Emacs to edit, Parcel to build, and Chrome to test and debug.

That project has samples with OpenLayers 2, 4, and 5 (3 and 4 are the same basically so only one). Because there were BOOKS on 2 and 3 I started there and built samples, got them running and then stepped up.

There is an example using XYZ so that I could test an ESRI tile server.

Now I am now adding a Bootstrap + OpenLayers sample so that I can make something that looks like a real web site.

OpenLayers + ArcGIS REST

https://boundlessgeo.com/2015/12/improving-interoperability-between-openlayers-and-esri-arcgis-restv/

OpenLayers and React

I have a separate page on React.

Three sample projects on Github, all stopped at OpenLayers 3.

This one actually just loads and runs, making me happy. Pirmin Kalberer's OL3-React-Example Works right out of the box.

Richard Hill's ol-react. Took me 1/2 a day to get it to build but there is no example on how to use it. Bad for me, a React newbie.

Allen Kim's react_openlayers