VisiOmatic web client

Class

Scale

Extends
  • leaflet.Control.Scale

new Scale(optionsopt) → {Scale}

Create a new scale bar.

Parameters

  • options object <optional>

    Options.

    Properties

    • title string <optional>
      'Scale'

      Title of the control.

    • position 'bottomleft' | 'bottomright' | 'topleft' | 'topright' <optional>
      'topright'

      Position of the scale bar.

    • maxWidth number <optional>
      128

      Maximum length of the scale bar.

    • metric boolean <optional>
      false

      Show metric scale?

    • metricTitle string <optional>

      Title of the control in metric mode. Defaults to global title.

    • imperial boolean <optional>
      false

      Show imperial scale?

    • imperialTitle string <optional>

      Title of the control in imperial mode. Defaults to global title.

    • degrees boolean <optional>
      true

      Show scale in degrees/arcminutes/arcseconds?

    • degreesTitle string <optional>

      Title of the control in degrees mode. Defaults to global title.

    • pixels boolean <optional>
      false

      Show scale in pixels?

    • pixelsTitle string <optional>

      Title of the control in pixels mode. Defaults to global title.

    • custom boolean <optional>
      false

      Show custom scale?

    • customTitle string <optional>

      Title of the control in custom mode. Defaults to global title.

    • customScale number <optional>
      1.0

      Scaling factor for the custom scale.

    • customUnits string <optional>
      ''

      Units of the custom scale.

    • updateWhenIdle boolean <optional>
      false

      Update only when the map stops moving?

    • planetRadius number <optional>

      Planet radius (in meters) for the metric and imperial modes.

Returns

  • Scale

    Instance of a scale bar.

Source

Methods

privatestatic

_addScales(options, className, container)

Add the scale bar(s).

Parameters

  • options object

    Scale bar options (see {link @Scale} for details).

  • className string

    Element class name for the scale bar.

  • container object

    Scale bar container

Source

privatestatic

_jacobian() → {number}

Return the Jacobian determinant of the deprojection at the given world coordinates.

Parameters

  • leaflet.LatLng

Returns

  • number

    Jacobian determinant of the deprojection.

Source

privatestatic

_updateCustom(maxCust, units)

Update the custom scale.

Parameters

  • maxCust number

    Maximum scale value in custom units.

  • units string

    Custom units.

Source

privatestatic

_updateDegrees(maxdegrees)

Update the degree scale.

Parameters

  • maxdegrees number

    Maximum scale value in pixel units.

Source

privatestatic

_updatePixels(maxPix)

Update the pixel scale.

Parameters

  • maxPix number

    Maximum scale value in pixel units.

Source