Skip to content

ZoomLevelSet

Namespace: ThinkGeo.Core

This class represents a collection of ZoomLevels.

public class ZoomLevelSet

Inheritance objectZoomLevelSet

Remarks:

This class represents a collection of ZoomLevels. Each ZoomLevel has a different scale and can store Styles that determine how InternalFeatures draw.

Properties

TileSize

Gets or sets the tile dimension (in pixels) used by this zoom level set.

public int TileSize { get; set; }

Property Value

int

MaxExtent

Gets or sets the maximum geographic extent covered by the zoom level set.

public RectangleShape MaxExtent { get; set; }

Property Value

RectangleShape

Name

Gets or sets the display name for the zoom level set.

public string Name { get; set; }

Property Value

string
A user-defined label for tooling such as legends.

CustomZoomLevels

This property gets the custom zoom levels from the zoomLevelSet.

public Collection<ZoomLevel> CustomZoomLevels { get; }

Property Value

Collection<ZoomLevel>
This property gets the custom zoom levels from the zoomLevelSet.

Remarks:

None

ZoomLevel01

Gets the zoom level definition for level 01.

public ZoomLevel ZoomLevel01 { get; }

Property Value

ZoomLevel

ZoomLevel02

Gets the zoom level definition for level 02.

public ZoomLevel ZoomLevel02 { get; }

Property Value

ZoomLevel

ZoomLevel03

Gets the zoom level definition for level 03.

public ZoomLevel ZoomLevel03 { get; }

Property Value

ZoomLevel

ZoomLevel04

Gets the zoom level definition for level 04.

public ZoomLevel ZoomLevel04 { get; }

Property Value

ZoomLevel

ZoomLevel05

Gets the zoom level definition for level 05.

public ZoomLevel ZoomLevel05 { get; }

Property Value

ZoomLevel

ZoomLevel06

Gets the zoom level definition for level 06.

public ZoomLevel ZoomLevel06 { get; }

Property Value

ZoomLevel

ZoomLevel07

Gets the zoom level definition for level 07.

public ZoomLevel ZoomLevel07 { get; }

Property Value

ZoomLevel

ZoomLevel08

Gets the zoom level definition for level 08.

public ZoomLevel ZoomLevel08 { get; }

Property Value

ZoomLevel

ZoomLevel09

Gets the zoom level definition for level 09.

public ZoomLevel ZoomLevel09 { get; }

Property Value

ZoomLevel

ZoomLevel10

Gets the zoom level definition for level 10.

public ZoomLevel ZoomLevel10 { get; }

Property Value

ZoomLevel

ZoomLevel11

Gets the zoom level definition for level 11.

public ZoomLevel ZoomLevel11 { get; }

Property Value

ZoomLevel

ZoomLevel12

Gets the zoom level definition for level 12.

public ZoomLevel ZoomLevel12 { get; }

Property Value

ZoomLevel

ZoomLevel13

Gets the zoom level definition for level 13.

public ZoomLevel ZoomLevel13 { get; }

Property Value

ZoomLevel

ZoomLevel14

Gets the zoom level definition for level 14.

public ZoomLevel ZoomLevel14 { get; }

Property Value

ZoomLevel

ZoomLevel15

Gets the zoom level definition for level 15.

public ZoomLevel ZoomLevel15 { get; }

Property Value

ZoomLevel

ZoomLevel16

Gets the zoom level definition for level 16.

public ZoomLevel ZoomLevel16 { get; }

Property Value

ZoomLevel

ZoomLevel17

Gets the zoom level definition for level 17.

public ZoomLevel ZoomLevel17 { get; }

Property Value

ZoomLevel

ZoomLevel18

Gets the zoom level definition for level 18.

public ZoomLevel ZoomLevel18 { get; }

Property Value

ZoomLevel

ZoomLevel19

Gets the zoom level definition for level 19.

public ZoomLevel ZoomLevel19 { get; }

Property Value

ZoomLevel

ZoomLevel20

Gets the zoom level definition for level 20.

public ZoomLevel ZoomLevel20 { get; }

Property Value

ZoomLevel

Constructors

ZoomLevelSet()

This is the default constructor.

public ZoomLevelSet()

Remarks:

This constructor is where we set the default scales for each ZoomLevel. If you inherit from this class to create your own custom ZoomSet, then you should not call the base constructor if you want to supply your own custom ZoomLevels.

ZoomLevelSet(int)

Initializes a new instance of the ZoomLevelSet class.

public ZoomLevelSet(int tileSize)

Parameters

tileSize int

ZoomLevelSet(int, RectangleShape)

Initializes a new instance of the ZoomLevelSet class.

public ZoomLevelSet(int tileSize, RectangleShape maxExtent)

Parameters

tileSize int

maxExtent RectangleShape

ZoomLevelSet(int, RectangleShape, GeographyUnit)

Initializes a new instance of the ZoomLevelSet class.

public ZoomLevelSet(int tileSize, RectangleShape maxExtent, GeographyUnit maxExtentUnit)

Parameters

tileSize int

maxExtent RectangleShape

maxExtentUnit GeographyUnit

Methods

Load(string)

Performs load.

public void Load(string styleJsonPath)

Parameters

styleJsonPath string
The style JSON path.

Returns

void

Load(Uri)

Performs load.

public void Load(Uri styleJsonUri)

Parameters

styleJsonUri Uri
The style JSON URI.

Returns

void

GetZoomLevel(RectangleShape, double, GeographyUnit)

This method returns the active ZoomLevel based on an extent, a map unit and a screen width.

public ZoomLevel GetZoomLevel(RectangleShape extent, double screenWidth, GeographyUnit mapUnit)

Parameters

extent RectangleShape
This parameter is a world extent.

screenWidth double
This parameter is the width of the map in pixels.

mapUnit GeographyUnit
This parameter is the unit of the map.

Returns

ZoomLevel

GetZoomLevel(RectangleShape, double, GeographyUnit, float)

This method returns the active ZoomLevel based on an extent, a map unit and a screen width.

public ZoomLevel GetZoomLevel(RectangleShape extent, double screenWidth, GeographyUnit mapUnit, float dpi)

Parameters

extent RectangleShape
This parameter is a world extent.

screenWidth double
This parameter is the width of the map in pixels.

mapUnit GeographyUnit
This parameter is the unit of the map.

dpi float
This parameter is the dpi of the extent.

Returns

ZoomLevel

GetZoomLevelForDrawing(RectangleShape, double, GeographyUnit, float)

This method returns the active ZoomLevel based on an extent, a map unit and a view width.

public ZoomLevel GetZoomLevelForDrawing(RectangleShape extent, double screenWidth, GeographyUnit mapUnit, float dpi)

Parameters

extent RectangleShape
This parameter is a world extent.

screenWidth double
This parameter is the width of the view in pixels.

mapUnit GeographyUnit
This parameter is the unit of the map.

dpi float
This parameter is the dpi of the extent.

Returns

ZoomLevel

        This method returns the active ZoomLevel based on an extent, map unit and a view

GetZoomLevelForDrawing(double)

Returns zoom level for drawing for .

public ZoomLevel GetZoomLevelForDrawing(double currentScale)

Parameters

currentScale double
The scale factor to apply.

Returns

ZoomLevel
The result of the operation.

GetZoomLevelForDrawing(RectangleShape, double, GeographyUnit)

This method returns the active ZoomLevel based on an extent, a map unit and a view width.

public ZoomLevel GetZoomLevelForDrawing(RectangleShape extent, double screenWidth, GeographyUnit mapUnit)

Parameters

extent RectangleShape
This parameter is a world extent.

screenWidth double
This parameter is the width of the view in pixels.

mapUnit GeographyUnit
This parameter is the unit of the map.

Returns

ZoomLevel

        This method returns the active ZoomLevel based on an extent, map unit and a view

GetZoomLevels()

This method return all of the zoomLevels in the zoomLevelSet.

public Collection<ZoomLevel> GetZoomLevels()

Returns

Collection<ZoomLevel>
This method return all of the zoomlevels in the zoomLevelSet.

Remarks:

None.

GetLowerZoomLevelScale(double, ZoomLevelSet)

ZoomToScale in, the result is less than input

public static double GetLowerZoomLevelScale(double currentScale, ZoomLevelSet zoomLevelSet)

Parameters

currentScale double

zoomLevelSet ZoomLevelSet

Returns

double

GetHigherZoomLevelScale(double, ZoomLevelSet)

ZoomToScale out, the result is greater than input

public static double GetHigherZoomLevelScale(double currentScale, ZoomLevelSet zoomLevelSet)

Parameters

currentScale double

zoomLevelSet ZoomLevelSet

Returns

double

GetDefaultZoomLevelByIndex(int)

Get the Default zoomlevel by the given index.

public ZoomLevel GetDefaultZoomLevelByIndex(int zoomLevelIndex)

Parameters

zoomLevelIndex int
zoomlevel Index Based on 1

Returns

ZoomLevel
returns ZoomLevel01 if the input zoomLevelIndex is 1, etc.

GetScales()

Returns scales.

public Collection<double> GetScales()

Returns

Collection<double>
The result of the operation.

GetZoomForScale(double)

Given a target map scale, computes the fractional zoom level by linearly interpolating between the two nearest predefined zoom scales.

public double GetZoomForScale(double targetScale)

Parameters

targetScale double
The desired map scale (e.g. meters per pixel).

Returns

double

          A zoom index (double) where the integer part is the lower zoom level,
          and the fractional part is how far you are toward the next level.