# Configuration

The extension is configured in the JMap Admin project configuration page:&#x20;

1. Open the NG Configuration tab.&#x20;
2. Drop the javascript code that will be executed when opening, then save.<br>

   <figure><img src="/files/4EI1R3vX39JQkaUMYFzR" alt=""><figcaption></figcaption></figure>
3. Once the javascript code is saved, activate the extension in the **Extensions** section of a project configuration page. Make sure the code is functional before activating the extension, otherwise errors may occur when opening JMap NG for current users of the project.<br>

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

## Configuration examples&#x20;

The following code adds an Atari logo and a base map from Geogratis. It also zooms to coordinates 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);
```

Example configuration to change the value of JMAP\_OPTIONS.reportsBaseUrl based on a given URL.

```
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-jmapserver-lima.k2geospatial.com/e/extensions/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.
