ol-ishare/view

Working with iShare profile configuration relating to the map view.

Methods

(inner) scaleToResolution(scale) → {Number}

Convert a scale value to its corresponding resolution. Assumes units are in meters and fixed DPI.

Parameters:
Name Type Description
scale Number

Map scale (1: scale)

Returns:

resolution Map resolution (pixels per meter)

Type
Number

(inner) resolutionToScale(resolution) → {scale}

Convert a resolution value to its corresponding scale. Assumes units are in meters and fixed DPI.

Parameters:
Name Type Description
resolution Number

Map resolution (pixels per meter)

Returns:

scale Map scale (1: scale)

Type
scale

(inner) nearestZoom(meters, pixels, resolutions) → {Number}

Find the closest zoom level for a given map width in meters.

Parameters:
Name Type Description
meters Number

The width across the map in meters that we are finding a zoom level for.

pixels Number

The current width of the map in pixels.

resolutions Array

An ordered list of resolutions that correspond with the zoom levels for the map.

Returns:

Nearest zoom level to give map width

Type
Number