Skip to content

Hide/show zoom control and scale bar (using vanilla JavaScript) #7

@bittner

Description

@bittner

ViaMichelin doesn't support hiding only the zoom control and the scale bar via their JavaScript API.

ViaMichelin support suggests to simply set the display style attribute of the related elements to none andblock, respectively.

Possible Solution

control.find(".ui-map-navigation").style.display = data.zoom_control ? "block" : "none";
control.find(".ui-map-scale").style.display = data.scale_bar ? "block" : "none";

In addition the ui-navigation-mode-selector (hand/lens icon above the zoom control) should generally be hidden, because it's not available with other map providers:

control.find(".ui-navigation-mode-selector").style.display = "none";

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions