# Configuración

La extensión se configura en la interfaz de [configuración del proyecto](/s/administrador/manual-del-administrador-jmap-server/proyectos/configuracion-de-proyectos.md) en JMap Admin:

1. Abra la pestaña de Configuration NG.&#x20;
2. Deposite el código javascript que será ejecutado a la apertura y guarde la configuración.&#x20;

   <figure><img src="/files/JzrTbs7sTKDRD6xZXEUL" alt=""><figcaption></figcaption></figure>
3. Luego de guardar el código javascript, active la extensión en la sección **Extensiones** de la página de configuración del proyecto. Debe asegurarse de que el código funciona antes de activar la extensión, de lo contrario podrían producirse errores cuando los usuarios de la aplicación JMap NG abrirán el proyecto.&#x20;

   <figure><img src="/files/9gqBz4YzzyKBlZEaPDgV" alt=""><figcaption></figcaption></figure>

## Ejemplos de configuración <a href="#exemple-de-configuration" id="exemple-de-configuration"></a>

El código siguiente añade el logo Atari y un mapa base proveniente de Geogratis. El mapa se centra en las coordenadas 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);
```

Ejemplo de configuración para cambiar el valor de JMAP\_OPTIONS.reportsBaseUrl según un URL dado.

```
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/s/extensiones/jmap-ng-configuration/configuracion.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.
