Technical documentation of Geoportal API

  • FR
  • UK

Index / Documentation / Technical documentation

OpenLayers link (2D Web Javascript API)

Context

The OpenLayers library is mainly a collection of Javascript functions giving a kernel of functionalities allowing lightweight web application development. A part of this library allows designing of the users' front end whilst it is not the main goal. The Geoportal API gives some more functionalities to OpenLayers and a ready to use graphic user interface. IGN's objective is to deliver as many functionalities as possible to the OpenLayers project and build the web application on top of the kernel. In order to progress in that policy, IGN is becoming an associate sponsor of the OSGeO, is already involved in proj4, gdal, geoserver and has hand over patches to proj4js. IGN's skills are on geographical components where its knownledges is recognized by partners and users.

Geoportal overlay

The Geoportal.Map class, as shown in the User chapter, exposes methods that allows to create, configure a map. The functionnalities it delivers should be enough for common use cases. For advanced users, the OpenLayers components should give all the additional functions they are looking for!

To ease the link between Geoportal and OpenLayers APIs, the Geoportal.Map class is an OpenLayers.Map subclass. If one use the Geoportal.Viewer classes, the Geoportal.Map can be obtained through the getMap() method :

//olMap is an instance of OpenLayers.Map class
var olMap = viewer.getMap();

This object contains all the references to the objects embedded in the map (layers, controls, ...). Once got, the webmaster can modify all the components through the use of the relevant OpenLayers methods.

//the OpenLayers map object and embedded objects are all accessible
var layer = new OpenLayers.Layer.WMS(....);
olMap.addLayer(layer);

One can then use OpenLayers' Map methods. In fact, the Geoportal API is just an overlay on top of OpenLayers. As such, it defines new classes that in turns inherit from the OpenLayer's relevant classes. For instance, the Geoportal.Map is a Geoportal class that aggregates the OpenLayers.Map. The Javascript API document can be read there.