Class: GeoreferenceManager

GeoreferenceManager

GeoreferenceManager for working with geographic coordinates in OpenLIME Handles conversions between geographic coordinates (EPSG:4326/WGS84) and Web Mercator (EPSG:3857) and managing map navigation.


new GeoreferenceManager(viewer, layer)

Creates a new GeoreferenceManager

Parameters:
Name Type Description
viewer Object

OpenLIME Viewer instance

layer Object

Layer containing the geographic image

Source:

Methods


canvasToGeo(x, y)

Converts canvas HTML coordinates to WGS84 coordinates

Parameters:
Name Type Description
x number

X coordinate in canvas

y number

Y coordinate in canvas

Source:
Returns:

Geographic coordinates {lat, lon} in degrees

Type
Object

flyTo(lat, lon [, zoom] [, duration] [, easing])

Navigate to a geographic position with animation

Parameters:
Name Type Argument Default Description
lat number

Latitude in degrees

lon number

Longitude in degrees

zoom number <optional>

Zoom level (optional)

duration number <optional>
250

Animation duration in ms

easing string <optional>
'linear'

Easing function

Source:

geoToScene(lat, lon)

Converts WGS84 coordinates to scene coordinates

Parameters:
Name Type Description
lat number

Latitude in degrees

lon number

Longitude in degrees

Source:
Returns:

Scene coordinates {x, y}

Type
Object

geoToWebMercator(lat, lon)

Converts WGS84 (EPSG:4326) coordinates to Web Mercator (EPSG:3857)

Parameters:
Name Type Description
lat number

Latitude in degrees

lon number

Longitude in degrees

Source:
Returns:

Point in Web Mercator coordinates {x, y}

Type
Object

getCurrentPosition()

Gets the current geographic position and zoom

Source:
Returns:

Current position {lat, lon, zoom}

Type
Object

sceneToGeo(x, y)

Converts scene coordinates to WGS84 (EPSG:4326) coordinates

Parameters:
Name Type Description
x number

X coordinate in scene space

y number

Y coordinate in scene space

Source:
Returns:

Geographic coordinates {lat, lon} in degrees

Type
Object

sceneToWebMercator(x, y)

Converts scene coordinates to Web Mercator

Parameters:
Name Type Description
x number

X coordinate in scene space

y number

Y coordinate in scene space

Source:
Returns:

Web Mercator coordinates {x, y}

Type
Object

webMercatorToGeo(x, y)

Converts Web Mercator (EPSG:3857) coordinates to WGS84 (EPSG:4326)

Parameters:
Name Type Description
x number

X coordinate in Web Mercator

y number

Y coordinate in Web Mercator

Source:
Returns:

Geographic coordinates {lat, lon} in degrees

Type
Object

webMercatorToScene(x, y)

Converts Web Mercator coordinates to Scene coordinates

Parameters:
Name Type Description
x number

X coordinate in Web Mercator

y number

Y coordinate in Web Mercator

Source:
Returns:

Scene coordinates {x, y}

Type
Object