Skip to content
Change the Default Position for Attribution

Change the Default Position for Attribution

By default, the Maptoolkit attribution control appears in the bottom-right corner of the map. You can move it to any corner by passing a position value such as top-left or bottom-left to the attributionControl option when initializing the map. Use this when other UI elements occupy the default position or when your layout requires the attribution to be in a specific corner to avoid conflicts.

const API_KEY = 'YOUR_API_KEY';

    const map = new maptoolkit.Map({
        container: 'map',
        apiKey: API_KEY,
        style: `https://styles.maptoolkit.net/maptoolkit/maptoolkit.summer.json?api_key=${API_KEY}`,
        center: [11.39085, 47.27574],
        zoom: 12,
        attributionControl: false
    });

    map.addControl(new maptoolkit.NavigationControl(), 'top-right');
    map.addControl(new maptoolkit.AttributionControl({ compact: false }), 'top-left');
<!DOCTYPE html>
<html lang="en">
<head>
    <title>Change the Default Position for Attribution - Maptoolkit Maps JS</title>
    <meta property="og:description" content="Move the attribution control to a different corner of the map." />
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="https://unpkg.com/@maptoolkit/[email protected]/dist/maptoolkit.js"></script>
    <link rel="stylesheet" href="https://unpkg.com/@maptoolkit/[email protected]/dist/maptoolkit.css" />
    <style>
        html, body { width: 100%; height: 100%; margin: 0; padding: 0; }
        #map { width: 100%; height: 100%; }
    </style>
</head>
<body>
<div id="map"></div>
<script>
    const API_KEY = 'YOUR_API_KEY';

    const map = new maptoolkit.Map({
        container: 'map',
        apiKey: API_KEY,
        style: `https://styles.maptoolkit.net/maptoolkit/maptoolkit.summer.json?api_key=${API_KEY}`,
        center: [11.39085, 47.27574],
        zoom: 12,
        attributionControl: false
    });

    map.addControl(new maptoolkit.NavigationControl(), 'top-right');
    map.addControl(new maptoolkit.AttributionControl({ compact: false }), 'top-left');
</script>
</body>
</html>

Use the prompt below with any LLM to get the same result. Make sure the Maptoolkit MCP server is connected first — check out AI Integration & MCP to get started.

Use the Maptoolkit Connector. Create an interactive map with zoom level 12, centered around [11.39085, 47.27574], with the attribution control positioned in the top-left corner.