# Using with Mapbox

[Mapbox GL JS](<https://github.com/mapbox/mapbox-gl-js>) is a JavaScript library for interactive, customizable vector maps on the web. Mapbox GL JS v1.x was open source, and it was forked as MapLibre, so [using Martin with Mapbox is similar to MapLibre](<https://maplibre.org/martin/using-with-maplibre/index.md>). Mapbox GL JS can accept [MVT vector tiles](<https://github.com/mapbox/vector-tile-spec>) generated by Martin, and applies [a style](<https://maplibre.org/maplibre-style-spec/>) to them to draw a map using Web GL.

You can add a layer to the map and specify Martin TileJSON endpoint as a vector source URL. You should also specify a `source-layer` property. For [Table Sources](<https://maplibre.org/martin/sources-pg-tables/index.md>) it is `{table_name}` by default.

```js
map.addLayer({
    id: 'points',
    type: 'circle',
    source: {
        type: 'vector',
        url: 'http://localhost:3000/points'
    },
    'source-layer': 'points',
    paint: {
        'circle-color': 'red'
    }
});
```
