Geoportal Extension for Itowns API Reference

Class: GlobeViewExtended

Extended itowns.GlobeView.

new GlobeViewExtended(viewerDiv, coordCarto, options)

Itowns/GlobeViewExtended.js, line 29
Name Type Description
viewerDiv HTMLElement

Where to instanciate the Three.js scene in the DOM

coordCarto Object

longitude, latitude, altitude

options Object optional

Optional properties which includes Itowns GlobeView optional properties (see Itowns documentation).

Name Type Default Description
renderer.isWebGL2 Boolean True optional

is an Itowns GlobeView optional property to enable webgl 2.0 for THREE.js.

position String "relative" optional

"absolute" or "relative"

Extends

  • itowns.GlobeView

Members

constructor

Constructor (alias)

Methods

_fromItownsCoords(itownsCoord){Object}

Itowns/GlobeViewExtended.js, line 859

Transform from itowns coordinates

Name Type Description
itownsCoord Object

itowns coordinates

_getEventTarget(type){Object}

Itowns/GlobeViewExtended.js, line 223

Returns the target of a given event type

Name Type Description
type String

the event type. Can be any of EVENTS

Returns:
- The event target.

_initEventMap()

Itowns/GlobeViewExtended.js, line 90

intializes the evenements map

_transformCoords(coordCarto){Object}

Itowns/GlobeViewExtended.js, line 837

Transform to itowns coordinates

Name Type Description
coordCarto Object

longitude, latitude, altitude

Returns:
coordinates

addLayer(layer){Promise}

Itowns/GlobeViewExtended.js, line 299

Overload itowns.GlobeView addLayer method

Name Type Description
layer Object

The itowns layer

addLayerListener(layer, type, callback){Object}

Itowns/GlobeViewExtended.js, line 203

Associates a function to trigger when a layer event is received.

Name Type Description
layer Object

The itowns layer.

type String

the event type. Can be any of EVENTS.

callback function

The function to execute when the event occures.

Returns:
- The event key

addWidget(widget)

Itowns/GlobeViewExtended.js, line 527

Add a widget to the globe

Name Type Description
widget Object

The Widget object to add

forget(type, callback)

Itowns/GlobeViewExtended.js, line 282

Cancels an event listening

Name Type Description
type Object

The event type

callback function

The event handler

forgetByKey(key)

Itowns/GlobeViewExtended.js, line 252

Cancels an event listening

Name Type Description
key Object

The event key

freezeControl()

Itowns/GlobeViewExtended.js, line 153

Disables globe controls until the globe rendering is completed

getAzimuth(){Number}

Itowns/GlobeViewExtended.js, line 617

Returns azimuth

getCameraTargetPosition(){THREE.Vector3}

Itowns/GlobeViewExtended.js, line 758

getCenter(){Object}

Itowns/GlobeViewExtended.js, line 705

Retuns the coordinates of the central point on screen in lat,lon and alt

getColorLayerById(layerId){Object}

Itowns/GlobeViewExtended.js, line 448

Get color layer by its id

Name Type Description
layerId String

Color layer id

Returns:
Object

getColorLayers(){Array}

Itowns/GlobeViewExtended.js, line 466

Get imagery layers

Returns:
layers

getCoordinateFromMouseEvent(mouseEvent){Coordinates}

Itowns/GlobeViewExtended.js, line 641

Gets the coordinate in lat,lon for a given mouse position.

Name Type Description
mouseEvent MouseEvent

A mouse event.

getCoordinateFromPixel(x, y){Coordinates}

Itowns/GlobeViewExtended.js, line 628

Gets the coordinate in lat,lon for a given pixel.

Name Type Description
x Number

The pixel x-position inside the Globe element.

y Number

The pixel y-position inside the Globe element.

getElevationLayers(){Array}

Itowns/GlobeViewExtended.js, line 505

Get elevation layers

Returns:
layers

getExtent(){Array}

Itowns/GlobeViewExtended.js, line 518

Get the current view extent

Returns:
view extent

getFeatureGeometryLayers(){Array}

Itowns/GlobeViewExtended.js, line 492

Get featureGeometry layers

Returns:
layers

getFeaturesAtMousePosition(mouseEvent){Promise}

Itowns/GlobeViewExtended.js, line 652

Get all visible features that intersect a pixel

Name Type Description
mouseEvent MouseEvent

A mouse event.

getGlobeView(){Object}

Itowns/GlobeViewExtended.js, line 121

Get GlobeViex Object (parent)

Returns:
GlobeView object

getLayerById(layerId){Object}

Itowns/GlobeViewExtended.js, line 429

Get layer by its id

Name Type Description
layerId String

Layer id

Returns:
Object

getLayerEventInfos(evt){Object}

Itowns/GlobeViewExtended.js, line 768

To get the layer event infos

Name Type Description
evt Object

event

Returns:
with event properties

getRange(){Number}

Itowns/GlobeViewExtended.js, line 751

Returns the "range": the distance in meters between the camera and the current central point on the screen.

getScale(){Number}

Itowns/GlobeViewExtended.js, line 579

Returns current view scale

getTargetElement(){HTMLElement}

Itowns/GlobeViewExtended.js, line 570

Get html target element

Returns:
container element

getTilt(){Number}

Itowns/GlobeViewExtended.js, line 598

Returns tilt

getVectorLayers(){Array}

Itowns/GlobeViewExtended.js, line 479

Get vector layers

Returns:
layers

getWidgets(){Array}

Itowns/GlobeViewExtended.js, line 547

Returns all widgets.

Returns:
- The array of widgets.

getZoom(){Number}

Itowns/GlobeViewExtended.js, line 715

Returns the actual zoom.

isInitialized(){Boolean}

Itowns/GlobeViewExtended.js, line 131

Indicates if the globe is initialized or not

listen(type, callback){Object}

Itowns/GlobeViewExtended.js, line 170

Associates a function to trigger when an event is received.

Name Type Description
type String

the event type. Can be any of EVENTS

callback function

The function to execute when the event occures.

Returns:
- The event key

lookAt(target)

Itowns/GlobeViewExtended.js, line 800

Sets camera orientation to look at specified target

Name Type Description
target THREE.Vector3

Target position

metersToPixels(value){Number}

Itowns/GlobeViewExtended.js, line 743

Projection on screen in pixels of length in meter on globe

Name Type Description
value Number

Length in meter on globe

Returns:
in pixels on screen

moveLayerToIndex(layerId, index)

Itowns/GlobeViewExtended.js, line 350

Move layer to the specified index

Name Type Description
layerId String

Layer id

index Boolean

new index of the layer

notifyChange()

Itowns/GlobeViewExtended.js, line 816

Notifies the scene it needs to be updated

onCameraMoveStop(cb)

Itowns/GlobeViewExtended.js, line 141

Detects when the camera movement stops, then launch the callback given as parameter

Name Type Description
cb function

The function to execute when the event occures.

parseMapboxStyle(styleUrl){Object}

Itowns/GlobeViewExtended.js, line 809

Notifies the scene it needs to be updated

Name Type Description
styleUrl String

style url

Returns:
object

pixelsToMeters(pixels){Number}

Itowns/GlobeViewExtended.js, line 734

To convert the projection in meters on the globe of a number of pixels of screen

Name Type Description
pixels Number

count pixels to project

Returns:
in meters on globe

preRenderEventFetchColorLayersDisplayed(b)

Itowns/GlobeViewExtended.js, line 391

Defines if the list of the color layers displayed have to be computed on pre-render event

Name Type Description
b Boolean

tells if the displayed color layers info should be fetched by the event PRE_RENDER

preRenderEventFetchElevationLayersDisplayed(b)

Itowns/GlobeViewExtended.js, line 403

Defines if the list of the elevation layers displayed have to be computed on pre-render event

Name Type Description
b Boolean

tells if the displayed elevation layers info should be fetched by the event PRE_RENDER

preRenderEventFetchLayersDisplayed(b)

Itowns/GlobeViewExtended.js, line 415

Defines if the list of the layers of all types displayed have to be computed on pre-render event

Name Type Description
b Boolean

tells if both displayed color layers and displayed elevation layers infos should be fetched by the event PRE_RENDER

preRenderEventFetchViewExtent(b)

Itowns/GlobeViewExtended.js, line 379

Defines if the current view extent have to be computed on pre-render event

Name Type Description
b Boolean

tells if the view extent info should be fetched by the event PRE_RENDER

removeEventListener(type, callback)

Itowns/GlobeViewExtended.js, line 360

Remove event listener from the globe

Name Type Description
type String

event type

callback function

event handler

removeLayer(layerId)

Itowns/GlobeViewExtended.js, line 316

Overload itowns.GlobeView removeLayer method

Name Type Description
layerId String

The layer id

removeLayerListener(layer, type, callback)

Itowns/GlobeViewExtended.js, line 268

Cancels an layer event listening

Name Type Description
layer Object

The itowns layer

type String

the event type

callback function

The function to execute when the event occures

removeWidget(widget)

Itowns/GlobeViewExtended.js, line 556

Removes a widget.

Name Type Description
widget Object

The Widget object to remove

resize(width, height)

Itowns/GlobeViewExtended.js, line 826

Resizes itowns

Name Type Description
width Integer

canvas width in pixels

height Integer

canvas height in pixels

setAzimuth(azimuth){Promise}

Itowns/GlobeViewExtended.js, line 608

Sets azimuth

Name Type Description
azimuth Number

Azimuth value

Returns:
when setAzimuth is done

setBackground()

Itowns/GlobeViewExtended.js, line 780

Sets background (specific to miniglobe)

setCameraPosition(target, distance)

Itowns/GlobeViewExtended.js, line 792

Sets camera position

Name Type Description
target THREE.Vector3

Target position

distance Number

Distance from target

setCameraTargetGeoPosition(center){Promise}

Itowns/GlobeViewExtended.js, line 695

Changes the center of the scene on screen to the specified in lat, lon.

Name Type Description
center Object

Center object

Name Type Description
longitude Number

Coordinate longitude WGS84 in degree

latitude Number

Coordinate latitude WGS84 in degree

Returns:
promise that resolves when the next 'globe initilazed' event fires.

setLayerOpacity(layerId, opacityValue)

Itowns/GlobeViewExtended.js, line 326

Set layer opacity

Name Type Description
layerId String

Layer id

opacityValue Number

opacity value in [0 1]

setLayerVisibility(layerId, visible)

Itowns/GlobeViewExtended.js, line 338

Set layer visibility

Name Type Description
layerId String

Layer id

visible Boolean

New visibility of the layer

setTilt(tilt){Promise}

Itowns/GlobeViewExtended.js, line 589

Sets tilt

Name Type Description
tilt Number

Tilt value

Returns:
when setTilt is done

setZoom(zoom){Promise}

Itowns/GlobeViewExtended.js, line 725

Sets the current zoom.

Name Type Description
zoom Number

The zoom