# Map Engine Setup

MapsIndoors provides support for both Mapbox GL JS v2 and v3. Our commitment to staying at the forefront of mapping technologies ensure that you have the flexibility to choose the Mapbox version that best align with your requirements.

## Mapbox V3

In order to access Mapbox v3 and its options, use `mapView`:

```javascript
const mapView = new mapsindoors.mapView.MapboxV3View({
    accessToken: 'YOUR_MAPBOX_ACCESS_TOKEN',
    element: document.getElementById('map'),
    center: { lat: 38.8974905, lng: -77.0362723 },
    zoom: 17,
    maxZoom: 25,
    mapsIndoorsTransitionLevel: 17,
    showMapMarkers: false,
    lightPreset: 'dusk'
});

// Then the MapsIndoors SDK is initialized
const mi = new mapsindoors.MapsIndoors({
    mapView: mapView,
    floor: "1",
    labelOptions: {
        pixelOffset: { width: 0, height: 18 }
    }
});
```

For Mapbox v3, we exposed three new constructor parameters for Mapbox v3:

* `mapsIndoorsTransitionLevel: number`- controls transition between Mapbox and MapsIndoors data. Defaults to `17`. Setting it to `17` will make a transition between Mapbox and MapsIndoors data between zoom levels `17` to `18`.
* `showMapMarkers: boolean` - boolean parameter that dictates if Mapbox map markers such as POIs should be shown or not. By not setting this parameter, Mapbox map markers will be hidden as soon as MapsIndoors data is shown.
* `lightPreset: string` - sets global light. Can be set to: **day**, **dawn**, **dusk** or **night**. Defaults to **day**.

The new Mapbox v3 Standard Style design provides the new design of the map and 3D buildings.

<figure><img src="/files/bNeqv196gP1htMGcMYvG" alt=""><figcaption><p>Mapbox v3 Map layout</p></figcaption></figure>

Mapbox' extruded buildings are not visible when MapsIndoors data is shown at the specified zoom level:

<figure><img src="/files/XDnIgGuKnJlpwDDVoxBa" alt=""><figcaption><p>MapsIndoors solution</p></figcaption></figure>

You can now choose between 4 different types of light: **day**, **dawn**, **night** or **dusk**.

<figure><img src="/files/oRgIEDd6kMtA0wnhgRzp" alt=""><figcaption><p>Mapbox v3 'dusk' light</p></figcaption></figure>

You can read more about the latest Mapbox v3 Standard Style [here](https://www.mapbox.com/blog/standard-core-style).

## Mapbox V2

In order to access Mapbox v2 and its options, use `mapView` and instantiate it as a new MapsIndoors object:

```javascript
const mapView = new mapsindoors.mapView.MapboxView({
    accessToken: YOUR_MAPBOX_ACCESS_TOKEN
    element: document.getElementById('map'),
    center: { lat: 38.8974905, lng: -77.0362723 },
    zoom: 17,
    maxZoom: 25,
});

// Then the MapsIndoors SDK is initialized
const mi = new mapsindoors.MapsIndoors({
    mapView: mapView,
    floor: "1",
    labelOptions: {
        pixelOffset: { width: 0, height: 18 }
    }
});
```

After successful `mapView` load you should be able to use Mapbox v2:

<figure><img src="/files/MVQjFI5YcFBqT1MB2Bja" alt=""><figcaption><p>Solution using Mapbox v2</p></figcaption></figure>

[<br>](https://docs.mapsindoors.com/getting-started/web/)


---

# 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.mapsindoors.com/sdks-and-frameworks/web/tutorial/getting-started/prerequisites.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.
