Search code examples
azure-maps

How to use the new Grayscale maps


The Azure maps blog states Grayscale maps: A dark-gray map style is for users who want to have a darker scale representation of a map.

How can you enable this in the Javascript implementation?


Solution

  • You can set style: "grayscale_dark" when you define the map.

    var map = new atlas.Map("map", {
      center: mapCenterPosition,
      zoom: 15,
      style: "grayscale_dark"
    });
    

    You can also just create a control on the map that allows you to switch between different modes:

    map.addControl(new atlas.control.StyleControl(), { position: "top-right" });