---
title: "Add markers to a non-georeferenced image | JavaScript maps SDK"
description: "Add markers to a zoomable non-georeferenced, geographically "
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Add markers to a non-georeferenced image

The MapTiler’s SDK [`ImageViewerMarker`](https://docs.maptiler.com/sdk-js/api/markers/#imageViewerMarker) allows you to add markers to your non-georeferenced images while interacting with them similarly to how you would navigate a regular map.

Image: [1932 Japanese pictorial world map game board - World Adventure](https://commons.wikimedia.org/wiki/File:1932_Japanese_pictorial_world_map_game_board.jpg)

### NPM module setup

```bash
npm install --save @maptiler/sdk
```

#### main.js

```js
import { config, ImageViewer, ImageViewerMarker } from '@maptiler/sdk';
import '@maptiler/sdk/dist/maptiler-sdk.css';

config.apiKey = 'YOUR_MAPTILER_API_KEY_HERE';
const imageViewer = new ImageViewer({
  container: 'map',
  imageUUID: 'YOUR_MAPTILER_TILESET_ID_HERE',
});

imageViewer.on('imageviewerready', () => {
  const marker = new ImageViewerMarker({})
  .setPosition([1000, 2000])
  .addTo(imageViewer);

  const marker1 = new ImageViewerMarker({
  color: "#FF0000",
  draggable: true
  }).setPosition([2496, 1135])
  .addTo(imageViewer);

  marker1.on("dragend", (evt) => {
    console.log(evt);
  })
});
```

#### index.html

```html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="robots" content="noindex">
  <title>Add markers to a non-georeferenced image | NPM example</title>
  <link rel="stylesheet" href="./style.css">
</head>
<body>
  <div id="map"></div>
  <script type="module" src="./main.js"></script>
</body>
</html>
```

#### style.css

```css
body {margin: 0; padding: 0;}
#map {position: absolute; top: 0; bottom: 0; width: 100%;}
```

### Basic JavaScript setup

```html
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>ImageViewer</title>
  <script src="https://cdn.maptiler.com/maptiler-sdk-js/v4.2.0/maptiler-sdk.umd.min.js"></script>
  <link href="https://cdn.maptiler.com/maptiler-sdk-js/v4.2.0/maptiler-sdk.css" rel="stylesheet" />
  <style>
    body {
      margin: 0;
      padding: 0;
    }

    #map {
      position: absolute;
      top: 0;
      bottom: 0;
      width: 100%;
    }
  </style>
</head>

<body>
  <div id="map"></div>
  <script>
    maptilersdk.config.apiKey = 'YOUR_MAPTILER_API_KEY_HERE';
    const imageViewer = new maptilersdk.ImageViewer({
      container: 'map',
      imageUUID: 'YOUR_MAPTILER_TILESET_ID_HERE',
    });

    imageViewer.on('imageviewerready', () => {
      const marker = new maptilersdk.ImageViewerMarker({})
        .setPosition([1000, 2000])
        .addTo(imageViewer);

      const marker1 = new maptilersdk.ImageViewerMarker({
        color: "#FF0000",
        draggable: true
      }).setPosition([2496, 1135])
        .addTo(imageViewer);

      marker1.on("dragend", (evt) => {
        console.log(evt);
      })
    });
  </script>
</body>

</html>
```

## Learn more

Visit the [ImageViewer API reference](https://docs.maptiler.com/sdk-js/api/image-viewer/) for full details on supported options, methods, etc.

Check out the [ImageViewerMarker API reference](https://docs.maptiler.com/sdk-js/api/markers/#imageViewerMarker) for information about available options, functions, and more.

## Related examples

### [Display a non-georeferenced image](https://docs.maptiler.com/sdk-js/examples/image-viewer/)

Examples

Display a zoomable non-georeferenced, geographically "inaccurate" maps in your application using the ImageViewer.

### [Display marker](https://docs.maptiler.com/sdk-js/examples/default-marker/)

Tutorials

Learn how to add a default marker to your map.

### [Add custom icons with markers](https://docs.maptiler.com/sdk-js/examples/custom-marker-icons/)

Examples

Add custom marker icons to your map.
