Technical documentation of Geoportal API

  • FR
  • UK

Index / Documentation / Technical documentation

Controls overview

Controls are components which enable to establish a dialog with the map: display et reorganize layers, pan the map, control the zoom level,...

  • The Default Control Set

    The following controls apprear on the map by default to provide users with minimal interactions with the map:

    NameRole
    CopyrightDisplays a copyright for the current application.
    KeyBoardNavigationAllows users to move the map with the keyboard
    LogoDisplays the logos of suppliers layers displayed on the map
    MouseNavigationAllows users to move the map by drag / drop and zoom With the mouse wheel
    PanPanelGraphical component to move the map using buttons
    PermanentLogoDisplays the Geoportal's logo
    TermsOfServiceDisplays a link to Geoportal's terms of use
    ZoomBarGraphical component to zoom using a slider
  • Other Controls

    Below is the list of controls that must be request specifically to be added to the map:

    NameRole
    DrawingToolbarGraphical component containing a set of tools for drawing
    GraphicScaleDisplays a standard distance and the digital scale value
    GraticuleDisplays a map grid to display a marker lon / lat
    LayerCatalogDisplays a list of existing Geoportal layers
    LayerSwitcherDisplays all layers in the map
    MeasureToolbarGraphical component containing a set of measurement tools
    MousePositionDisplays the mouse coordinates
    OverviewMapDisplays an Overview map synchronized with the main view
    Search EnginesComponents for performing address, geographical names, cadastral parcels or reverse search

In this section, we will see details of the following controls:

LayerSwitcher 
DrawingToolbar 
LayerCatalog 
Search engines 

LayerSwitcher

The LayerSwitcher control displays the layers in the map. We can find for each layer the following features:

Displaying the layer's legend and description:

The layer's name is always rendered, excepted when the layer is marked as baseLayer (in this case, the layer never appears on the interface within the Geoportal's API).

For Geoportal layers, a clic on the layer's name opens a new window containing the legend, the description of the layer and possibly provides access to more than two links:

  • A web page for downloading the data when the download link is indicated;
  • A web page to display metadata when the link is shown.

Layer's activation:

There are 4 cases for layer's activation status :

  • the layer is activated and visible at current scale.
  • The layer is activated, but not visible at current scale.
  • The layer is not activated and not visible at current scale.
  • The layer is not activated, but eventually visible at current scale.

Layer's order:

Changing the layer's order is possible by clicking on the arrows on the right.

More options:

when clicking on the wheel, the following content appears:

  • A click on the "magnifying glass" zooms out on the extent of the layer.
  • A click on the "trash" removes the layer from the layer manager;
  • Dragging the slider changes the transparency of the layer;

DrawingToolbar

By default, the DrawingToolbar control is in the multiple mode (each drawing toolbar is displayed in the layer switcher under the layer name).

This control can be used in a single mode (one drawing toolbar which interacts with an active vector layer) :

To change the active vector layer just select it with a click in the layer switcher. The drawing toolbar interacts now with the selected layer.

LayerCatalog

The LayeCatalog control displays the layers authorized for the user's keys.

  • (a) A layer in the catalog can be added to the map (and to the layers manager) with the green "plus" icon. The catalog lists all available layers for the user's keys. If a layer has a projection incompatible with map projection, or if a layer is already added (present in the layers manager), or if a layer is not available for the current territory, the layer can't be added to the map and the "plus" icon is disabled (grey icon).
  • (b) The layer's name is always rendered. Clicking on the layer's name (b) opens a window with a description.
  • (c) A filter button allows the user to filter the catalog's layers : display in the catalog the layers in the current map extent, search a layer by its name, filter layers by keywords, thematics or dates.
  • (d) A reset button allows the user to cancel previous filters and so to display all available layers for the user's keys.

Search engines

The Geoportail's API gives access to two search engines :

  • a geographical names search service based on the BD NYME® product ;
  • an addresses search service based on the ROUTE ADRESSE® product.

To be able to use these services, the API's contract must contain the relevant layers (Cf. "Create a new contract"):

  • geographical names search : Toponyms (PositionOfInterest) ;
  • addresses search : Addresses (StreetAddress).

Geographical names search :

The Javascript API uses a component that interacts directly with the search engine.

A click on the search by names picto displays the search form :

The Location field allows keying in the searched location ! A click on the Search button launches the search :

Results are displayed at the bottom of the search form :

A click on a result centers the map on the selected location and closes the search form. A Cntrl-click on a result centers the map on the selected location without closing the search form.

An option allows to activate the auto-complete in order to provide suggestions while the user type into the search field :

Addresses search :

The Javascript API uses a component that interacts directly with the search engine.

A click on the search by addresses picto displays the search form :

The Street allows keying in the street address, the Place field allows keying in the city. The Postal code field is not yet used. A click on the Search button launches the search :

Results are displayed at the bottom of the search form :

A click on a result centers the map on the selected address and closes the search form. A Cntrl-click on a result centers the map on the selected address without closing the search form. A target shows the selected address on the map ; on hovering the target, a popup arises with the address' informations.

A Cntrl-Alt-click on a result that is a city refines the search by adding the selected city and postal code in the form.

An option allows to activate the auto-complete in order to provide suggestions while the user type into the search field. When the auto-complete is on, the postal code and city fields are not present, there is only one field for the address :

cadastral Parcel search :

The Javascript API uses a composant that interacts directly with the cadastral parcels search engine.

A click on the search by cadastral parcels picto displays the search form :

The cadastral parcel is given the following way :

  • "Département" field (2 digits) ;
  • "Commune INSEE" field (3 chiffres) ;
  • "Commune absorbée INSEE" field (3 digits, often '000') ;
  • "Section" field (2 digits or letters zero completed on the right) ;
  • "Numéro" field (4 digits or letters, zero completed on the right).

    A click on the Search button launches the search. results are displayed in the form.

    A click on a result centers the map on the selected parcel and closes the search form.

Reverse search :

The Javascript API uses a component that interacts directly with the reverse search engine.

A click on the reverse search picto displays the search form :

The Longitude allows keying the longitude, the Latitude allows keying the latitude. These fields center the map in order to do a new search centered on specified coordinates. These fields are updated on drag-and-drop of the target picto (positionned at the map center).

The research can be restricted to a circle by selecting Restrict the research : Draw a circle option. It allows to draw a circle on the map and then do a reverse search in this circle.

The research can be restricted to an extent by selecting Restrict the research : Draw an extent option. It allows to draw a rectangle on the map and then do a reverse search in this rectangle.

The Search address option specify that we want search locations with StreetAddress type. The Search toponyme option specify that we want search locations with PositionOfInterest type. A click on the Search button launches the search.

Results are displayed on the map. On hovering a target, a popup arises with the informations of the location :