> For the complete documentation index, see [llms.txt](https://docs.jmapcloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.jmapcloud.io/en/jmap-ng/jmap-ng-developer-documentation/examples/add-attributions-on-the-map.md).

# Add attributions on the map

In this example, we will show how to add one or multiple attributions on the map in JMap NG.

Note that attributions are available in both NG Core and NG App.

## Add a single attribution example

In the example bellow, we add a single attribution composed of one hyperlink forwarding to k2geospatial website.

Try it out in [Codepen.io](https://codepen.io/k2-dev/pen/vYRXyYb)

```html
<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <meta charset="UTF-8">
    <style>
      #my-custom-map {
        width: 600px;
        height: 600px;
        border: 1px solid grey;
        margin-top: 1rem;
      }
    </style>
  </head>
  <body>
    <div id="my-custom-map" class="jmap_wrapper"></div>
    <script type="text/javascript">
      window.JMAP_OPTIONS = {
        projectId: 1,
        restBaseUrl: "https://jmapdoc.jmaponline.net/services/rest/v2.0",
        anonymous: true,
        map: {
          containerId: "my-custom-map",
          zoom: 13.797865986918877,
          center: {
            x: -75.48063889179525,
            y: 45.664231577062765
          },
          onStartupMapReadyFn: () => {
            JMap.Map.Attribution.addSingle({
              id: "custom-attribution",
              text: "© My custom attribution",
              href: "https://k2geospatial.com/jmap-en/"
            })
          }
        },
      };
    </script>
    <script defer type="text/javascript" src="https://cdn.jsdelivr.net/npm/jmap-core-js@jmap-ng-doc"></script>  
  </body>
</html>
```

## Add multiple attributions example

You can add multiple attributions in one call.

In this example, we add two attributions, one composed of a hyperlink forwarding to stackoverflow website and the other composed of a random image forwading to an example domain.

Try it out in [Codepen.io](https://codepen.io/k2-dev/pen/BarLKEp)

```html
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
  <meta charset="UTF-8">
</head>
<body class="jmap_wrapper">
  <script type="text/javascript">
    window.JMAP_OPTIONS = {
      projectId: 1,
      restBaseUrl: "https://jmapdoc.jmaponline.net/services/rest/v2.0",
      anonymous: true,
      map: {
        zoom: 9.573700695830425,
        center: {
          x: -75.48063889179525,
          y: 45.53690235213574
        },
        onStartupMapReadyFn: () => {
          JMap.Map.Attribution.addMultiple([{
              id: "custom-attribution-0",
              text: "© StackOverflow",
              href: "https://stackoverflow.com/"
            },
            {
              id: "custom-attribution-1",
              imageUrl: "https://picsum.photos/180/90",
              href: "https://example.com/"
            }
          ])
        }
      },
    };
  </script>
  <script defer type="text/javascript" src="https://cdn.jsdelivr.net/npm/jmap-core-js@jmap-ng-doc"></script>
</body>
</html>
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.jmapcloud.io/en/jmap-ng/jmap-ng-developer-documentation/examples/add-attributions-on-the-map.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
