Skip to main content

Looped map

You can manage the looped map mode that enables moving and building geometries through the 180th meridian (antimeridian). If the mode is enabled, you can endlessly move the map along the equator. This function is available for MapGL JS API version 1.47.0 or higher.

To enable the looped map mode, pass the true value to the loopWorld property of MapOptions:

const map = new mapgl.Map('container', {
center: [55.31878, 25.23584],
zoom: 2,
key: 'Your API access key',
loopWorld: true,
});

You can also enable and disable the mode on the fly using the setOption map method:

// Enable looped map mode
map.setOption('loopWorld', true);

// Disable looped map mode
map.setOption('loopWorld', false);

Loop in data sources

If the looped map mode is enabled, geometries from user data sources (GeoJsonSource, RasterTileSource, and others) will also be spread across all map replicas beyond the 180th meridian.


Loop in map objects

Objects on the map are also spread across all map replicas except for HtmlMarker instances, which are not duplicated and are displayed according to the distance from the map center. Geometries of lines, polygons, and others can be built through the 180th meridian.