Skip to content

Latest commit

 

History

History
40 lines (30 loc) · 1.29 KB

File metadata and controls

40 lines (30 loc) · 1.29 KB

Turning off measure annotations by default

When measuring a line or polygon, GeoMoose annotates each segment with its length and each polygon with its area directly on the map. These on-map annotations are on by default.

Users can always toggle the annotations on or off while measuring using the labels button in the upper-left map controls.

To change the default so the annotations start off, set showMeasureLabels to false in the application's measure configuration object, alongside the other measure options such as areaUnits and lengthUnits.

Example:

var app = new gm3.Application({
    mapserver_url: CONFIG.mapserver_url,
    mapfile_root: CONFIG.mapfile_root,
    measure: {
        areaUnits: ["ft", "mi", "a", "h", "m", "km"],
        lengthUnits: ["ft", "mi", "ch", "r", "m", "km"],
        showMeasureLabels: false
    }
});

Valid values:

  • showMeasureLabels - Boolean. true (default) shows the annotations when measuring, false hides them until the user turns them on with the labels button.

Note

This only changes the initial state. The labels button still lets a user turn the annotations back on (or off) at any time while the measure tool is active.