Geoportal Extension for OpenLayers3 API Reference
The Geoportal Extension for OpenLayers 3 provides additionnal javascript functionalities (Sources, Layers and Controls) making access to french geoportal webservices easier when using OpenLayers 3 javascript library.
This extension is not standalone and has to be used together with OpenLayers 3 library. In a web page, you thus have to include both OpenLayers and Geoportal Extension resources. For instance :
<!-- OpenLayers 3 -->
<link rel="stylesheet" href="path/to/ol3/ol.css" />
<script src="path/to/ol3/ol.js"></script>
<!-- Geoportal Extension for OpenLayers 3 -->
<script src="path/to/GpPluginOl3.js" data-key="{your-geoportal-access-key}"></script>
<link rel="stylesheet" href="path/to/GpPluginOl3.css" />
NB : to have complete access to this extension functionnalities, you need to provide your geoportal access key (obtained here) either when loading extension script (using the data-key attribute) or by conditinning their use to the onSuccess callback function of a Gp.Services.GetConfig() call with that key. Otherwhise some functionalities may not work as announced.
Geoportal Sources
Sources provided by the Geoportal Extension are additionnal OpenLayers 3 Sources that give simple access to Geoportal data that can then be used to feed OpenLayers 3 layers.
Geoportal Source | Description |
---|---|
ol.source.GeoportalWMS | Provides access to Geoportal or INSPIRE WMS web services. |
ol.source.GeoportalWMTS | Provides access to Geoportal WMTS web service. |
Geoportal Layers
Layers provided by the Geoportal Extension are additionnal OpenLayers 3 layers already connected to previous Geoportal Extension sources that can be added to an OpenLayers Map like any other OpenLayers 3 layer.
Geoportal Layer | Description |
---|---|
ol.layer.GeoportalWMS | Provides access to Geoportal or INSPIRE WMS web services. |
ol.layer.GeoportalWMTS | Provides access to Geoportal WMTS web service. |
Geoportal Controls
Controls provided by the Geoportal Extension are additionnal OpenLayers 3 controls that, when added to an OpenLayers Map, allows user to interact with it.
Geoportal Control | Description |
---|---|
ol.control.GeoportalAttribution | Is a substitute for built in ol.control.Attribution. It has the additionnal capability of handling geoportal dynamic attributions depending on zoom level and positionning of the map. |
ol.control.LayerSwitcher | Allows users to manage layer organisation of the map |
ol.control.GeoportalMousePosition | Is a substitute for built in ol.control.MousePosition. It has the additionnal capability of displaying elevation of Mouse Position based on elevation service of the Geoportal Platform. |
ol.control.SearchEngine | Allows users to search and display locations on a map using autocompletion service and geocoding service of the Geoportal Platform. |
ol.control.ReverseGeocode | Allows users to find locations by clicking on a map using geocoding service of the Geoportal Platform. |
ol.control.Route | Allows users to compute and display routes on a Map using routing service of the Geoportal Platform. |
ol.control.Isocurve | Allows users to compute and display Isochrone or Isodistance curves on a Map using isochron/isodistance service of the Geoportal Platform. |
ol.control.Drawing | Provides tools to users for making and saving annotations on a map. |
ol.control.LayerImport | Provides tools to users for their own geographical data on a map. |
ol.control.MeasureArea | Allows users to compute an area measure. |
ol.control.MeasureLength | Allows users to compute a length measure. |
ol.control.MeasureAzimuth | Allows users to compute an azimuth measure. |
ol.control.ElevationPath | Allows users to compute an altimetric profile using elevation service of the Geoportal Platform. |