# Configuration

L’extension est configurée dans la page de [configuration de projet](https://docs.k2geospatial.com/v/fr2/administrateur/manuel-de-ladministrateur-jmap-server/projets/configuration-de-projets) de JMap Admin :&#x20;

1. Cliquez sur ![](/files/MtCcsu8mEoRLeq1ZIZtb) pour ouvrir le menu et ensuite sur Configuration NG.<br>

   <figure><img src="/files/tTTMEK25yDWBnbN7s5RR" alt=""><figcaption></figcaption></figure>
2. Déposez le code javascript qui sera exécuté à l’ouverture, puis sauvegardez.<br>

   <figure><img src="/files/WT0CUjuRlzU6mTZvt1an" alt=""><figcaption></figcaption></figure>
3. Une fois le code javascript sauvegardé, activez l’extension dans la section Extensions de la page de configuration d’un projet. \
   Assurez-vous que le code soit fonctionnel avant d’activer l’extension, sinon des erreurs pourraient arriver à l’ouverture de JMap NG pour les utilisateurs actuels du projet.<br>

   <figure><img src="/files/R0dN2g5mp6nQ1PbRLkRo" alt=""><figcaption></figcaption></figure>

## Exemples de configuration <a href="#exemple-de-configuration" id="exemple-de-configuration"></a>

Le code suivant ajoute un logo Atari ainsi qu'une carte de base provenant de Geogratis. Il zoome également vers les coordonnées (45.630701447925134, -73.54322795543986):

```
JMap.Map.Attribution.addMultiple([{
    id: "custom-attribution-0",
    text: "? K2Geospatial",
    imageUrl: "https://upload.wikimedia.org/wikipedia/commons/thumb/3/3b/Atari_logo.svg/640px-Atari_logo.svg.png",
    href: "https://k2geospatial.com/jmap-en/"
}, {
    id: "custom-attribution-1",
    text: "? StackOverflow",
    href: "https://stackoverflow.com/"
}]);
JMap.Map.Basemap.removeById("canvec");
JMap.Map.Basemap.add({
    id: "canvec",
    label: "Geogratis-test",
    tileUrls: [
        "https://maps.geogratis.gc.ca/wms/canvec_en?&amp;version=1.3.0&amp;REQUEST=GetMap&amp;format=image/png&amp;transparent=true&amp;width=512&amp;height=512&amp;crs=EPSG:3857&amp;bbox={bbox-epsg-3857}&amp;layers=land,hydro,man_made,residentialarea_50k,transport,administrative"
    ]
}, true);
JMap.Map.panAndZoomTo({
    "x": -73.54322795543986,
    "y": 45.630701447925134
}, 10);
```

Exemple de configuration pour changer la valeur de JMAP\_OPTIONS.reportsBaseUrl selon un URL donné.

```
if (window.location.href.includes("myjmap.com"))  {
      JMAP_OPTIONS.reportsBaseUrl = "http:/reports.myjmap.com/diffuser/2.0/";
      console.log('NG Configuration: Reports home changed to ' + JMAP_OPTIONS.reportsBaseUrl);
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.k2geospatial.com/fr2/extensions-jmap-server/jmap-ng-configuration/configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
