open layers. history google maps ◦ announced on february 2005 ◦ possibility to explore the world...

29
OPEN LAYERS

Upload: lesley-stevens

Post on 27-Dec-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: OPEN LAYERS. History Google Maps ◦ Announced on February 2005 ◦ Possibility to explore the world OpenLayers ◦ First release on June 2006 ◦ Open alternative

OPEN LAYERS

Page 2: OPEN LAYERS. History Google Maps ◦ Announced on February 2005 ◦ Possibility to explore the world OpenLayers ◦ First release on June 2006 ◦ Open alternative

HistoryGoogle Maps

◦ Announced on February 2005

◦ Possibility to explore the world

OpenLayers

◦ First release on June 2006

◦Open alternative to Google Maps and Bing made by a group of MetaCarta employees

Page 3: OPEN LAYERS. History Google Maps ◦ Announced on February 2005 ◦ Possibility to explore the world OpenLayers ◦ First release on June 2006 ◦ Open alternative

History

2004 20072005

Googl

e Map

s

2006

Yaho

o! M

aps API

Micro

soft

Virtu

al E

arth

API

Yaho

o! M

aps API

V2

Micro

soft

Live

Loc

al

Kosm

osni

mki

NASA W

orld

Win

d

Micro

soft

Live

Loc

al 3

D

Géopo

rtail

Géopo

rtail 3D

Googl

e Ac

quire

s Ke

yhole

Bayer

nViewer

Bayer

nViewer

3D

Ope

nLay

ers

Page 4: OPEN LAYERS. History Google Maps ◦ Announced on February 2005 ◦ Possibility to explore the world OpenLayers ◦ First release on June 2006 ◦ Open alternative

What is OpenLayer?

◦an API for building web mapping applications

◦pure client-side object-oriented JavaScript, using components from Prototype.js and the Rico library

◦AJAX (Asynchronous JavaScript and XML)

◦efficient tiling

◦BSD licensed (standard licence for open source software)

Page 5: OPEN LAYERS. History Google Maps ◦ Announced on February 2005 ◦ Possibility to explore the world OpenLayers ◦ First release on June 2006 ◦ Open alternative

The Map….

◦The map is the central piece on a web mapping application and is represented by instances of the OpenLayers.Map class

◦The map has some important properties:  projection, resolutions(zoom levels), units, etc

◦A map contains one or more layers

◦A map can contain one or more controls

Page 6: OPEN LAYERS. History Google Maps ◦ Announced on February 2005 ◦ Possibility to explore the world OpenLayers ◦ First release on June 2006 ◦ Open alternative

The Map….

Page 7: OPEN LAYERS. History Google Maps ◦ Announced on February 2005 ◦ Possibility to explore the world OpenLayers ◦ First release on June 2006 ◦ Open alternative

The Map….

Page 8: OPEN LAYERS. History Google Maps ◦ Announced on February 2005 ◦ Possibility to explore the world OpenLayers ◦ First release on June 2006 ◦ Open alternative

The Map…The map has plenty of methods to deal with:

◦Layers

addLayer(), getLayer(), removeLayer(), ...

◦Controls

addControl(), getControl(), removeControl(), ...

◦To move around:

zoomTo(), zoomIn(), zoomOut(), pan(), panTo(), ...

Page 9: OPEN LAYERS. History Google Maps ◦ Announced on February 2005 ◦ Possibility to explore the world OpenLayers ◦ First release on June 2006 ◦ Open alternative

The Layers…

◦The concept of Layer allows us to group/classify the elements that must be rendered on the Map

◦All layers inherit from the base class OpenLayers.Layer

Page 10: OPEN LAYERS. History Google Maps ◦ Announced on February 2005 ◦ Possibility to explore the world OpenLayers ◦ First release on June 2006 ◦ Open alternative

The Layers…defines some common properties for all subclasses:

Page 11: OPEN LAYERS. History Google Maps ◦ Announced on February 2005 ◦ Possibility to explore the world OpenLayers ◦ First release on June 2006 ◦ Open alternative

The Layers…We can classify layers in two main categories:

◦Raster (for imagery)

Raster layers show imagery from different service providers: Google, Bing, a WMS server, OSM, etc

◦Vector (for features)

Vector layers allows us to work with features loaded from a data source...

A feature is digital representation of something in the real world: city, river, mountain, ...

Page 12: OPEN LAYERS. History Google Maps ◦ Announced on February 2005 ◦ Possibility to explore the world OpenLayers ◦ First release on June 2006 ◦ Open alternative

The Layers…

Page 13: OPEN LAYERS. History Google Maps ◦ Announced on February 2005 ◦ Possibility to explore the world OpenLayers ◦ First release on June 2006 ◦ Open alternative

Raster Layers…

Page 14: OPEN LAYERS. History Google Maps ◦ Announced on February 2005 ◦ Possibility to explore the world OpenLayers ◦ First release on June 2006 ◦ Open alternative

Vector Layers…

Page 15: OPEN LAYERS. History Google Maps ◦ Announced on February 2005 ◦ Possibility to explore the world OpenLayers ◦ First release on June 2006 ◦ Open alternative

The Layers…◦The protocol determines the way a vector layer

communicates with a data source (HTTP,…). It must be an instance of some of the OpenLayers.Protocol subclasses

◦The format determines how features must be read or written. It must be an instance of some of the OpenLayers.Format subclasses

Page 16: OPEN LAYERS. History Google Maps ◦ Announced on February 2005 ◦ Possibility to explore the world OpenLayers ◦ First release on June 2006 ◦ Open alternative

The Layers…When a layer must be drawn:

◦The layer calls the protocol so it can load the data

◦The protocol communicates with the data source and reads the data

◦The protocol uses the specified format to transform the data into features and add them to the layer

◦The layer delegates to the renderer the task to render the features

◦The renderer draws each feature

Page 17: OPEN LAYERS. History Google Maps ◦ Announced on February 2005 ◦ Possibility to explore the world OpenLayers ◦ First release on June 2006 ◦ Open alternative

The Layers…

OpenLayers differentiates two kinds of layers: 

Base layers and Overlays

Page 18: OPEN LAYERS. History Google Maps ◦ Announced on February 2005 ◦ Possibility to explore the world OpenLayers ◦ First release on June 2006 ◦ Open alternative

The Layers…

Page 19: OPEN LAYERS. History Google Maps ◦ Announced on February 2005 ◦ Possibility to explore the world OpenLayers ◦ First release on June 2006 ◦ Open alternative

The Layers…

◦Base layers are mutually exclusive, only one can be shown at a time

◦There can be any number of OverLays

◦The isBaseLayer() property inherited from OpenLayers.Layer determines the kind of the Layer

Page 20: OPEN LAYERS. History Google Maps ◦ Announced on February 2005 ◦ Possibility to explore the world OpenLayers ◦ First release on June 2006 ◦ Open alternative

The Truth About OpenLayer…

◦Most of the JavaScript code we write with OpenLayers is transformed into HTML elements !!!

Page 21: OPEN LAYERS. History Google Maps ◦ Announced on February 2005 ◦ Possibility to explore the world OpenLayers ◦ First release on June 2006 ◦ Open alternative

The Truth About OpenLayer…

Page 22: OPEN LAYERS. History Google Maps ◦ Announced on February 2005 ◦ Possibility to explore the world OpenLayers ◦ First release on June 2006 ◦ Open alternative

The Controls…

◦Controls allows to interact with the Map

◦All controls inherits from base class OpenLayers.Control

Page 23: OPEN LAYERS. History Google Maps ◦ Announced on February 2005 ◦ Possibility to explore the world OpenLayers ◦ First release on June 2006 ◦ Open alternative

The Controls…

◦Controls allows to interact with the Map

◦All controls inherits from base class OpenLayers.Control

◦OpenLayers offers controls for almost any required action: navigation, zoom, feature selection,feature edition, etc

Page 24: OPEN LAYERS. History Google Maps ◦ Announced on February 2005 ◦ Possibility to explore the world OpenLayers ◦ First release on June 2006 ◦ Open alternative

The Controls…

Page 25: OPEN LAYERS. History Google Maps ◦ Announced on February 2005 ◦ Possibility to explore the world OpenLayers ◦ First release on June 2006 ◦ Open alternative
Page 26: OPEN LAYERS. History Google Maps ◦ Announced on February 2005 ◦ Possibility to explore the world OpenLayers ◦ First release on June 2006 ◦ Open alternative
Page 27: OPEN LAYERS. History Google Maps ◦ Announced on February 2005 ◦ Possibility to explore the world OpenLayers ◦ First release on June 2006 ◦ Open alternative

Here is the output

Page 28: OPEN LAYERS. History Google Maps ◦ Announced on February 2005 ◦ Possibility to explore the world OpenLayers ◦ First release on June 2006 ◦ Open alternative

Another output ( Vector layer )

Page 29: OPEN LAYERS. History Google Maps ◦ Announced on February 2005 ◦ Possibility to explore the world OpenLayers ◦ First release on June 2006 ◦ Open alternative

Thanks for You Attention…