Skip to main content

MapMenu Add-on

Initialize a map with a Map Menu control. Learn more about the MapMenu add-on.

<!DOCTYPE html>
<html lang="en">
        <meta charset="utf-8" />
        <link rel="stylesheet" href="" />
        <script src=""></script>
        <script src=""></script>
        <link rel="stylesheet" href="" />
            body { margin: 0; padding: 0; }

            #map {
                position: absolute;
                top: 0;
                bottom: 0;
                width: 100%;
        <div id="map"></div>

            TrimbleMaps.APIKey = 'YOUR_API_KEY_HERE';
            const map = new TrimbleMaps.Map({
              container: 'map', // container id
                style: TrimbleMaps.Common.Style.TRANSPORTATION, // hosted style id
                center: [-74.2, 40.5],
                zoom: 7
            mapMenusOptions = {
                showContentLayers: true,
                showBaseStyles: true,
                showCustomStyles: false,
                showMobileStyles: false,
                hideStyles: ['Accessible Dark', 'Accessible Light', 'Basic'],
                hideLayers: ['3D Buildings'],

            var ctrl = new TrimbleMapsControl.MapMenus(mapMenusOptions);

            // Map#addControl takes an optional second argument to set the position of the control.
            // If no position is specified the control defaults to `top-right`.
            map.addControl(ctrl, "top-left");
Last updated June 15, 2023.