LuciadCPillar C# 2024.0.05
Luciad.Maps.MapScale Struct Reference

This class represents a map scale, a ratio of a distance on the map to the corresponding actual distance. More...

Inheritance diagram for Luciad.Maps.MapScale:

Public Member Functions

 MapScale (double value)
 Creates a new MapScale based on the given ratio. More...
 
bool Equals (MapScale other)
 
override bool Equals (object other)
 
override int GetHashCode ()
 
override string ToString ()
 
MapScale ZoomIn (double factor)
 Creates a new MapScale which is zoomed in with a given factor. More...
 
MapScale ZoomOut (double factor)
 Creates a new MapScale which is zoomed outn with a given factor. More...
 

Static Public Member Functions

static MapScale FromDenominator (double denominator)
 Creates a map scale from a denominator value. More...
 
static operator double (MapScale mapScale)
 
static implicit operator MapScale (double value)
 
static bool operator!= (MapScale lhs, MapScale rhs)
 
static bool operator< (MapScale lhs, MapScale rhs)
 
static bool operator<= (MapScale lhs, MapScale rhs)
 
static bool operator== (MapScale lhs, MapScale rhs)
 
static bool operator> (MapScale lhs, MapScale rhs)
 
static bool operator>= (MapScale lhs, MapScale rhs)
 

Properties

double Denominator [get]
 The denominator of this map scale. More...
 
static MapScale MaxZoomedIn = new MapScale(Double.MaxValue) [get]
 The value that represents a maximally zoomed in map scale (1:0 ≈ the maximum double value) More...
 
static MapScale MaxZoomedOut = new MapScale(0.0) [get]
 The value that represents a maximally zoomed out map scale (1:inf == 0) More...
 
double Value [get]
 The scale value. More...
 

Detailed Description

This class represents a map scale, a ratio of a distance on the map to the corresponding actual distance.

For example: a map scale of 1:50000 means that 1 centimeter on a map corresponds with 500 meters on the ground.

This class gives a natural ordering to map scales, from zoomed out to zoomed in. When a part of the API takes an ordered collection as input, it must be ordered according to this natural ordering (unless stated otherwise).

In order for a Map instance to interpret MapScale values correctly, it needs to know the DPI (see Map.Dpi) value of the screen on which it is rendered.

See also the related article

Constructor & Destructor Documentation

◆ MapScale()

Luciad.Maps.MapScale.MapScale ( double  value)
inline

Creates a new MapScale based on the given ratio.

Parameters
valuea value that represents 1 / denominator. For example: a MapScale of 1:50000 can be created using 0.00002 (=1/50000) as value.
Exceptions
System.ArgumentExceptionwhen the map scale is smaller than 0.

Member Function Documentation

◆ Equals() [1/2]

bool Luciad.Maps.MapScale.Equals ( MapScale  other)
inline

◆ Equals() [2/2]

override bool Luciad.Maps.MapScale.Equals ( object  other)
inline

◆ FromDenominator()

static MapScale Luciad.Maps.MapScale.FromDenominator ( double  denominator)
inlinestatic

Creates a map scale from a denominator value.

For example when using 1:50000 as map scale, the denominator is 50000.

Parameters
denominatorthe scale denominator.
Returns
a map scale that corresponds to 1:denominator
Exceptions
System.ArgumentExceptionwhen the denominator is negative.

◆ GetHashCode()

override int Luciad.Maps.MapScale.GetHashCode ( )
inline

◆ operator double()

static Luciad.Maps.MapScale.operator double ( MapScale  mapScale)
inlineexplicitstatic

◆ operator MapScale()

static implicit Luciad.Maps.MapScale.operator MapScale ( double  value)
inlinestatic

◆ operator!=()

static bool Luciad.Maps.MapScale.operator!= ( MapScale  lhs,
MapScale  rhs 
)
inlinestatic

◆ operator<()

static bool Luciad.Maps.MapScale.operator< ( MapScale  lhs,
MapScale  rhs 
)
inlinestatic

◆ operator<=()

static bool Luciad.Maps.MapScale.operator<= ( MapScale  lhs,
MapScale  rhs 
)
inlinestatic

◆ operator==()

static bool Luciad.Maps.MapScale.operator== ( MapScale  lhs,
MapScale  rhs 
)
inlinestatic

◆ operator>()

static bool Luciad.Maps.MapScale.operator> ( MapScale  lhs,
MapScale  rhs 
)
inlinestatic

◆ operator>=()

static bool Luciad.Maps.MapScale.operator>= ( MapScale  lhs,
MapScale  rhs 
)
inlinestatic

◆ ToString()

override string Luciad.Maps.MapScale.ToString ( )
inline

◆ ZoomIn()

MapScale Luciad.Maps.MapScale.ZoomIn ( double  factor)
inline

Creates a new MapScale which is zoomed in with a given factor.

For example, when applying this method on a 1:50000 scale, with a factor or 2, the resulting map scale will be 1:25000.

Parameters
factorthe factor using which to zoom in
Returns
a new map scale that is zoomed in using the given factor.

◆ ZoomOut()

MapScale Luciad.Maps.MapScale.ZoomOut ( double  factor)
inline

Creates a new MapScale which is zoomed outn with a given factor.

For example, when applying this method on a 1:50000 scale, with a factor or 2, the resulting map scale will be 1:100000.

Parameters
factorthe factor using which to zoom out
Returns
a new map scale that is zoomed out using the given factor.

Property Documentation

◆ Denominator

double Luciad.Maps.MapScale.Denominator
get

The denominator of this map scale.

[get]

Returns the denominator of this map scale. For example when the Map Scale is 1:50000, this method returns 50000.

◆ MaxZoomedIn

MapScale Luciad.Maps.MapScale.MaxZoomedIn = new MapScale(Double.MaxValue)
staticget

The value that represents a maximally zoomed in map scale (1:0 ≈ the maximum double value)

◆ MaxZoomedOut

MapScale Luciad.Maps.MapScale.MaxZoomedOut = new MapScale(0.0)
staticget

The value that represents a maximally zoomed out map scale (1:inf == 0)

◆ Value

double Luciad.Maps.MapScale.Value
get

The scale value.

[get]

Returns the scale value.