GeoGirafe-API

This page describes how to use the GeoGirafe API. The API provides a modern web component that enables easy integration into websites.
Technically, the API is a lightweight GeoGirafe application that already includes predefined components and services.

Examples are provided below.

Basics

To use the API, simply add the following code on your website:

<head>
  <script type="module" crossorigin src="/geogirafe-api.js"></script>
  <link rel="stylesheet" href="/geogirafe-api.css" />
</head>

Add a simple map view

Add a simple map to the page, with its default configuration.

Add a map with center coordinates

Set the default center point.

Add a map with a custom zoomlevel

Set the default zoom level.

Add a map with a custom basemap

Set the default basemap.

Add a map with a basemap selector

Activate the basemap selector, allowing the user to select a different basemap.

Add a crosshair somewhere on the map

Add a cross at the defined coordinates.

Add a toolip somewhere on the map

Add a tooltip with cutom text at the defined coordinates.

Add a marker somewhere on the map

Add a marker at the defined coordinates.

Add multiple markers on the map

Add multiple markers at the defined coordinates.

Add a layer to the map

Add a layer to the map. The layer name must be defined in the themes.json file.

Add multiple layers to the map

Add multiple layers to the map. The layer names must be defined in the themes.json file.

Add a layer to the map, including default opacity and filter

Add a layer to the map. The layer name must be defined in the themes.json file. The layer options follow the format defined in the documentation.

Add a map with a search bar

Activate the searchbar, allowing the user to search for objects and layers.

Add a map and allow selection

Activate the selection window, allowing the user to select objects and display their properties.

Set map values with javascript

This example shows how to use javascript to set attributes after the map creation.