Top Banner
INDIAN INSTITUTE OF REMOTE SENSING, DEHRADUN [email protected] OpenLayers: API for data Integration in an Open Source Map Browser Dr. Harish Karnatak
79

OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

Mar 13, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G , D E H R A D U N

[email protected]

OpenLayers: API for data Integration in an Open Source

Map Browser

Dr. Harish Karnatak

Page 2: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

Outline Introduction

OpenLayers Features, history, components Code example Software development features Types and integration of data layers

Conclusion Examples Remarks

Downloads are available:

http://openlayers.org/download/

Page 3: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

What is OpenLayers?

OpenLayers is a project of the Open Source Geospatial Foundation (OsGeo)

Page 4: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

What is OpenLayers?

An API for building web map applications Pure client-side JavaScript “AJAX” “Web 2.0” Supports open standards Supports closed standards, too BSD licensed

Page 5: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

History of the Project

Page 6: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

Web as platform

Participa-tion

Content syndication

Web services Conceptual

& social

TechnicalXML RSS JavaScript AJAX …

Web 2.0

…..…………

Introduction: The Web 2.0 idea

an emerging change in paradigm in what the World Wide Web is and how it works -> decentralisation.

implies conceptual, technical and social aspects.

Page 7: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

GeoWeb – the Geo part of Web 2.0

… merging of geographical (location-based) information with the abstract information of traditional web sites.

Huge amount of data available High interest on tools like Google Map API

Geotagging: “On the Flickr photo-sharing service … users have “geotagged” more

than 25 million pictures, providing location data that allows them to be viewed on a map or through 3-D visualization software like Google Earth.“1

platial.com: Access to > 30.000.000 locations

1http://www.nytimes.com/2007/07/27/technology/27maps.html?ex=1343275200&en=c0ca3a88644ae4a9&ei=5124&partner=permalink&exprod=permalink

Page 8: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

Components of OpenLayers Mapsjust a prototype!

Page 9: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

Simple integration into (X)HTML

Including API(remote or local)

Creating map object

Adding layer

Placeholder

Page 10: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers development: Classes, inheritance

Source:http://www.smartmapbrowsing.org/html/index_en.html [2007-0919]

Page 11: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers development: API documentation

Source: http://dev.openlayers.org/apidocs/files/OpenLayers-js.html [2007-09-07]

Page 12: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

Architecture

Multi-tier REST-based (Representational state transfer)

Internethttp

Webserver (Proxy)http(REST)

OpenLayersClient

Local files

SQL Geo-DBMS

http

http

Page 13: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

What is REST API

Representational State Transfer (REST) is a style of software architecture fordistributed hypermedia systems such as the World Wide Web. The termRepresentational State Transfer was introduced and defined in 2000 by RoyFielding.

REST is an approach for getting information content from a Web site byreading a designated Web page that contains an XML file that describes andincludes the desired content.

REST is an "architectural style" that basically exploits the existing technologyand protocols of the Web, including HTTP and XML.

REST is simpler to use than the well-known SOAP (Simple Object AccessProtocol) approach, which requires writing or using a provided server program(to serve data) and a client program (to request data).

Page 14: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers Features: Layers

OGC WMS OGC WFS GeoRSS CSV ka-Map WorldWind (*) Canvas

Google Maps MSN Virtual Earth Yahoo! Maps Multimap

Page 15: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

Layers Classes

OGC WFS

GeoRSS CSV

GML KML WKT

OGC WMS

Google Maps MSN Live Local Yahoo! Maps Multimap

ka-Map WorldWind

Raster Layers, tiled

Vector Layers, points, lines, polygons

rendered with SVG / VML

Well-known text

Page 16: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers Features: Controls

Zoom / Pan Zoom Bar Mouse controls Layer Switcher (aka “legend”) Scale Ratio Scale Bar Permalink

Page 17: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers Features:...

Markers Popups Feature objects Event handling “AJAX” ... and, of course ...

Page 18: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

GeoRSS

W3C 2006: “a simple model for tagging external content with geographic feature properties which are consistent with the general feature model and syntax of OGC GML.”

supported by Yahoo! Maps, Google Maps, Live Local, WorldKit, MapInfo, FME, Drupal, …

<item xmlns="http://mywebserver.com/rss2"><title>…</title><description>…</description><georss:point xmlns:georss="http://www.georss.org/georss">

45.3515625 75.234375</georss:point>

</item>

Source: cadenhead.org

Page 19: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

GeoRSS in OpenLayers

Presently, two XML serializations are supported: GeoRSS Simple, W3C GeoRSS

var georsslayer = new OpenLayers.Layer.GeoRSS(“georss.xml”, value); map.addLayer(georsslayer);

Page 20: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

GeoJSON

JSON = JavaScript Object Notation

lightweight data-interchange format

efficient use in JavaScript programs

also supported by Google Maps

{"type": "Feature", "id": "OpenLayers.Feature.Vector_122", "properties": {}, "geometry": {

"type": "Point", "coordinates": [

115.3125, 24.9609375

]}, "crs": {

"type": "EPSG", "properties": {

"code": 4326}

}}

Page 21: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OGC‘s Geography Markup Language GML

only version 2 support

Integration of a GML Layer

<wfs:FeatureCollection xmlns:wfs="http://www.opengis.net/wfs"><gml:featureMember xmlns:gml="http://www.opengis.net/gml">

<feature:features xmlns:feature=http://mapserver.gis.umn.edu/mapserverfid="OpenLayers.Feature.Vector_156"><feature:geometry>

<gml:Point><gml:coordinates decimal="." cs=", " ts=“ ">75.2,45.3</gml:coordinates>

</gml:Point></feature:geometry></feature:features>

</gml:featureMember></wfs:FeatureCollection>

map.addLayer(new OpenLayers.Layer.GML("GML", "gml/polygon.xml"));

Page 22: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

Keyhole Markup Language - KML

„I added support for KML point display in about 20 minutes, including the time to find data and write a demo HTML page loading some example data. Adding LineString support was another 15 minutes.“http://crschmidt.net/blog/archives/201/openlayers-vector-support/

polygons not yet supported

Integration of a KML Layer

map.addLayer(new OpenLayers.Layer.GML(

"KML", "kml/mc-search.kml", {format: OpenLayers.Format.KML}

));

Page 23: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

WMS

A WMS layer needs layername, URL, and parameters

var map = new OpenLayers.Map('map');var wmslayer = new OpenLayers.Layer.WMS(

"WMS Stuttgart", "http://suasdemo.easywms.com/WMS/getmapcap.php?",{

layers:'gruenflaechen,oeffentl_gebaeude,private_gebaeude',VERSION: "1.1.1",units: 'meters‚transparent: 'false', format: 'image/png'maxExtent: 'new OpenLayers.Bounds(minx,miny,maxx,maxy)',maxResolution': 'auto‚

} );map.addLayer(wmslayer);

Page 24: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

WMS

GetCapabilities supported by extension1

GetMap and GetFeatureInfo supported

WMS-T support

// Register click eventmap.events.register('click', map, function (e) {// initialize the displaying text$('nodeList').innerHTML = "Loading... ";//define the parameters for getfeatureInfovar url = wmslayer.getFullRequestString({

REQUEST: "GetFeatureInfo",EXCEPTIONS: "application/vnd.ogc.se_xml",BBOX: wms.map.getExtent().toBBOX(),X: e.xy.x, Y: e.xy.y,INFO_FORMAT: 'text/html',QUERY_LAYERS: wms.params.LAYERS,REDIUS:2,WIDTH: wmslayer.map.size.w,HEIGHT: wmslayer.map.size.h});

//get featureInfoOpenLayers.loadURL(url, '', this, setHTML);Event.stop(e);

});//display the resultfunction setHTML(response) {$('nodeList').innerHTML = response.responseText;

}see http://trac.openlayers.org/wiki/WMSManager, http://www.ominiverdi.org/openlayers/sandbox/openlayers/examples/wms_manager.html

1

2

3

4

Page 25: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

WFS support

WFS WFS-Transactional

function init(){OpenLayers.ProxyHost="/proxy/?url=";map = new OpenLayers.Map('map');layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",

"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );map.addLayer(layer);

layer = new OpenLayers.Layer.WFS( "Owl Survey","http://www.bsc-eoc.org/cgi-bin/bsc_ows.asp?",{typename: "OWLS", maxfeatures: 10},{ featureClass: OpenLayers.Feature.WFS});

map.addLayer(layer);}

Page 26: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

Google Maps in OpenLayers

Page 27: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

var googleLayer = new OpenLayers.Layer.Google( "Google Satellite" ,{type: G_SATELLITE_MAP, 'maxZoomLevel':18} );

Google Maps in OpenLayers

Page 28: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

var satellite = new OpenLayers.Layer.Google( "Google Maps" ,{type: G_NORMAL_MAP, 'maxZoomLevel':18} );

Page 29: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

ISRO Bhuvan in OpenLayer

var liss=new OpenLayers.Layer.TileCache("LISSIII",urlArray,"LISSIII",{format:"image/jpeg",isBaseLayer:false,attribution:"IRS Resourcesat-1 LISSIII(23.5m)"});

var l4=new OpenLayers.Layer.WMS("l4",urlArray1,{layers:'l4'},{isBaseLayer:false, attribution:"IRS Resourcesat-1 LISSIV(5.8m)"});

Page 30: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

ISRO Bhuvan in OpenLayer

Page 31: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

MSN Virtual Earth in OpenLayers

Page 32: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

Additionally, OpenLayers supports...

Yahoo! Maps MultiMap

Page 33: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

Samples: Integration of SRTM data

Source: http://dev.openstreetmap.org/~spaetz/?lat=6217998.0293&lon=996891.50684&zoom=8&layers=TTB [2007-09-05]

Page 34: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

Sample: OpenStreetMap

aims to be a free editable map of the whole world.

http://www.openstreetmap.org/

Source: http://www.openstreetmap.org/ [2007-09-10]

Page 35: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

Conclusion

GeoWeb merges locational and abstract information.

Driven by users. Several emerging geo-standards developed by

general IT stakeholders (GeoRSS, KML).

OpenLayers is a promising Open Source web mapping client API.

Modern software development tools and processes ensure quality and progress of the work.

OpenLayers is capable to integrate many data resources and formats

Page 36: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

Quick Demo

Page 37: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers: WMS

<html><head><script src="http://openlayers.org/api/2/OpenLayers.js"></script></head><body><div style="width:100%; height:100%" id="map"></div><script defer="defer" type="text/javascript">

var map = new OpenLayers.Map('map');var wms = new OpenLayers.Layer.WMS("OpenLayers WMS",

"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'});map.addLayer(wms);map.zoomToMaxExtent();

</script></body></html>

Page 38: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers: WMS

<html><head><script src="http://openlayers.org/api/2/OpenLayers.js"></script></head><body><div style="width:100%; height:100%" id="map"></div><script defer="defer" type="text/javascript">

var map = new OpenLayers.Map('map');var wms = new OpenLayers.Layer.WMS("OpenLayers WMS",

"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'});map.addLayer(wms);map.zoomToMaxExtent();

</script></body></html>

Page 39: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers: WMS

<html><head><script src="http://openlayers.org/api/2/OpenLayers.js"></script></head><body><div style="width:100%; height:100%" id="map"></div><script defer="defer" type="text/javascript">

var map = new OpenLayers.Map('map');var wms = new OpenLayers.Layer.WMS("OpenLayers WMS",

"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'});map.addLayer(wms);map.zoomToMaxExtent();

</script></body></html>

Page 40: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers: WMS

<html><head><script src="http://openlayers.org/api/2/OpenLayers.js"></script></head><body><div style="width:100%; height:100%" id="map"></div><script defer="defer" type="text/javascript">

var map = new OpenLayers.Map('map');var wms = new OpenLayers.Layer.WMS("OpenLayers WMS",

"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'});map.addLayer(wms);map.zoomToMaxExtent();

</script></body></html>

Page 41: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers: WMS

<html><head><script src="http://openlayers.org/api/2/OpenLayers.js"></script></head><body><div style="width:100%; height:100%" id="map"></div><script defer="defer" type="text/javascript">

var map = new OpenLayers.Map('map');var wms = new OpenLayers.Layer.WMS("OpenLayers WMS",

"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'});map.addLayer(wms);map.zoomToMaxExtent();

</script></body></html>

Page 42: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers: WMS

<html><head><script src="http://openlayers.org/api/2/OpenLayers.js"></script></head><body><div style="width:100%; height:100%" id="map"></div><script defer="defer" type="text/javascript">

var map = new OpenLayers.Map('map');var wms = new OpenLayers.Layer.WMS("OpenLayers WMS",

"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'});map.addLayer(wms);map.zoomToMaxExtent();

</script></body></html>

Page 43: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers: WMS

(demo)

Page 44: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers + ka-Map

<html><head><script src="http://openlayers.org/api/2/OpenLayers.js"></script></head><body><div style="width:100%; height:100%" id="map"></div><script defer="defer" type="text/javascript">

var map = new OpenLayers.Map('map');var wms = new OpenLayers.Layer.WMS("OpenLayers WMS",

"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'});

map.addLayer(wms);map.zoomToMaxExtent();

</script></body></html>

Page 45: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers + ka-Map

<html><head><script src="http://openlayers.org/api/2/OpenLayers.js"></script></head><body><div style="width:100%; height:100%" id="map"></div><script defer="defer" type="text/javascript">

var map = new OpenLayers.Map('map');var wms = new OpenLayers.Layer.WMS("OpenLayers WMS",

"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'});var kamap = new OpenLayers.Layer.KaMap( "KaMap",

"http://openlayers.org/world/index.php",{g: "satellite", map: "world"});

map.addLayer(wms);map.zoomToMaxExtent();

</script></body></html>

Page 46: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers + ka-Map

<html><head><script src="http://openlayers.org/api/2/OpenLayers.js"></script></head><body><div style="width:100%; height:100%" id="map"></div><script defer="defer" type="text/javascript">

var map = new OpenLayers.Map('map');var wms = new OpenLayers.Layer.WMS("OpenLayers WMS",

"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'});var kamap = new OpenLayers.Layer.KaMap( "KaMap",

"http://openlayers.org/world/index.php",{g: "satellite", map: "world"});

map.addLayers([wms, kamap]);map.zoomToMaxExtent();

</script></body></html>

Page 47: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers + ka-Map

(demo)

Page 48: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

Google Maps in OpenLayers

<html><head><script src="http://openlayers.org/api/2/OpenLayers.js"></script></head><body><div style="width:100%; height:100%" id="map"></div><script defer="defer" type="text/javascript">

var map = new OpenLayers.Map('map');var layer = new OpenLayers.Layer.Google("Google");map.addLayer(layer);map.zoomToMaxExtent();

</script></body></html>

Page 49: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

Google Maps in OpenLayers

(demo)

Page 50: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

MSN Virtual Earth in OpenLayers

<html><head><script src="http://openlayers.org/api/2/OpenLayers.js"></script></head><body><div style="width:100%; height:100%" id="map"></div><script defer="defer" type="text/javascript">

var map = new OpenLayers.Map('map');var layer = new OpenLayers.Layer.VirtualEarth("MSN VE");map.addLayer(layer);map.zoomToMaxExtent();

</script></body></html>

Page 51: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

MSN Virtual Earth in OpenLayers

(demo)

Page 52: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

OSGEO-Workshop, CSSTE-AP, Dehradun, 12-14 January, 2011 [email protected]

Commercial Layers in OpenLayers

Additionally, OpenLayers supports...

Page 53: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

OSGEO-Workshop, CSSTE-AP, Dehradun, 12-14 January, 2011 [email protected]

Commercial Layers in OpenLayers

Y! Maps

Additionally, OpenLayers supports...

Page 54: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

OSGEO-Workshop, CSSTE-AP, Dehradun, 12-14 January, 2011 [email protected]

Commercial Layers in OpenLayers

Y! Maps MultiMap

Additionally, OpenLayers supports...

Page 55: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

OSGEO-Workshop, CSSTE-AP, Dehradun, 12-14 January, 2011 [email protected]

Commercial Layers in OpenLayers

Y! Maps MultiMap (insert your own here)

Additionally, OpenLayers supports...

Page 56: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers: Transparent WMS

var map = new OpenLayers.Map('map');

var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS","http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );

var twms = new OpenLayers.Layer.WMS( "World Map","http://world.freemap.in/cgi-bin/mapserv?",{map: '/www/freemap.in/world/map/factbooktrans.map',transparent:'true', layers: 'factbook', 'format':'png'} );

map.addLayers([wms,twms]);

map.zoomToMaxExtent();

Page 57: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers: Transparent WMS

(demo)

Page 58: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers: WFS

OpenLayers.ProxyHost="/cgi-bin/proxy.cgi?url=";

var map = new OpenLayers.Map('map');var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",

"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );

var layer = new OpenLayers.Layer.WFS( "Owl Survey","http://www.bsc-eoc.org/cgi-bin/bsc_ows.asp?",{typename: "OWLS", maxfeatures: 30});

map.addLayers([wms,georss]);

map.zoomToMaxExtent();

Page 59: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers: WFS

OpenLayers.ProxyHost="/cgi-bin/proxy.cgi?url=";

var map = new OpenLayers.Map('map');var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",

"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );

var layer = new OpenLayers.Layer.WFS( "Owl Survey","http://www.bsc-eoc.org/cgi-bin/bsc_ows.asp?",{typename: "OWLS", maxfeatures: 30});

map.addLayers([wms,georss]);

map.zoomToMaxExtent();

Page 60: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers: WFS

(demo)

Page 61: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers: GeoRSS

OpenLayers.ProxyHost="/cgi-bin/proxy.cgi?url=";

var map = new OpenLayers.Map('map');var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",

"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );

var georss = new OpenLayers.Layer.GeoRSS( "GeoRSS","http://earthquake.usgs.gov/recenteqsww/eqs7day-M2.5.xml"

);

map.addLayers([wms,georss]);

map.zoomToMaxExtent();

Page 62: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers: GeoRSS

(demo)

Page 63: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers: Markers

var map = new OpenLayers.Map('map');

var markers = new OpenLayers.Layer.Markers("Markers");map.addLayer(markers);

var point = new OpenLayers.LonLat(5, 40)var marker = new OpenLayers.Marker(point);markers.addMarker(marker);

map.zoomToMaxExtent();

Page 64: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers: Markers

var map = new OpenLayers.Map('map');

var markers = new OpenLayers.Layer.Markers("Markers");map.addLayer(markers);

var point = new OpenLayers.LonLat(5, 40)var marker = new OpenLayers.Marker(point);markers.addMarker(marker);

map.zoomToMaxExtent();

Page 65: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers: Markers

(demo)

Page 66: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers: Popups

var markers = new OpenLayers.Layer.Markers("Markers");map.addLayer(markers);

popup = new OpenLayers.Popup.Anchored("Example",new OpenLayers.LonLat(5,40),new OpenLayers.Size(200,200),"Welcome to Barcelona");

popup.hide();map.addPopup(popup);

var point = new OpenLayers.LonLat(5, 40)var marker = new OpenLayers.Marker(point);markers.addMarker(marker);

marker.events.register( "click", marker, function (e) {

popup.toggle() } );

Page 67: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers: Popups

var markers = new OpenLayers.Layer.Markers("Markers");map.addLayer(markers);

popup = new OpenLayers.Popup.Anchored("Example",new OpenLayers.LonLat(5,40),new OpenLayers.Size(200,200),"Welcome to Barcelona");

popup.hide();map.addPopup(popup);

var point = new OpenLayers.LonLat(5, 40)var marker = new OpenLayers.Marker(point);markers.addMarker(marker);

marker.events.register( "click", marker, function (e) {

popup.toggle() } );

Page 68: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers: Popups

(demo)

Page 69: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers: Custom Controls

var controls = [new OpenLayers.Control.PanZoomBar(),new OpenLayers.Control.MouseDefaults(),new OpenLayers.Control.Scale(),new OpenLayers.Control.Permalink()

];

var map = new OpenLayers.Map('map', { controls: controls });

Page 70: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

Contributing to OpenLayers

Visit the website: http://openlayers.org/ Join the mailing lists Meet on irc.freenode.net #openlayers Submit a contributor agreement Start sending patches!

Page 71: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

OpenLayers: Custom Controls

(demo)

Page 72: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

Download OpenLayer API

Page 73: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

Unzip

Page 74: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

Folder location

Page 75: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

API Location

Page 76: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

Examples

Page 77: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

Example-Code

Page 78: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]

Page 79: OpenLayers: Datenintegration in einem Open Source Map Browserjsac.jharkhand.gov.in/pdf/EDUSAT/Lecture/26 Feb 2013 Introduction... · OpenLayers: API for data Integration in an Open

I N D I A N I N S T I T U T E O F R E M O T E S E N S I N G, D E H R A D U N

[email protected]