new SceneManager(options)
Parameters:
| Name | Type | Description |
|---|---|---|
options |
Mapspace.street.threejs.SceneManagerOptions | Object with options as properties. |
- Source:
- mapspace-street/scenemanager.js
Fires:
- ol.events.Event#event:camerachanged
- ol.events.Event#event:renderinvalid
- ol.events.Event#event:resize
Extends
- ol.Object
Members
-
facesOrder :string
-
The list of chars for cube face order.
- Source:
- mapspace-street/scenemanager.js
-
fovLimitEpsilon :number
-
A fov of exactly 0 or π breaks some computations, so we constrain it to the [fovLimitEpsilon, π - fovLimitEpsilon] interval. We use 9 decimal places for the epsilon value since this is the maximum number of significant digits for a 32-bit floating-point number. Note that after a certain zoom level, rendering quality will be affected by the loss of precision in floating-point computations.
- Source:
- mapspace-street/scenemanager.js
-
viewer :Mapspace.street.Viewer
-
The viewer.
- Source:
- mapspace-street/scenemanager.js
Methods
-
addAxisCollection(distance)
-
Adds the
Mapspace.street.threejs.AxisCollectionif no one is added.Parameters:
Name Type Description distancenumber The length of axes or planes. Defaults to 100.
- Source:
- mapspace-street/scenemanager.js
-
addFeature(feature)
-
Adds the
THREE.Object3Dcontained in aol.Featureto the scene. The Object3D must be stored in observable property calledMapspace.STREET_GEOMETRY_NAMEin the feature. Do not call render so a render call is needed after adding all required objects.Parameters:
Name Type Description featureol.Feature The feature to add.
- Source:
- mapspace-street/scenemanager.js
-
addIcon(svg, position, w, h, scale, name)
-
Adds a SVG icon. Returns the created object.
Parameters:
Name Type Argument Description svgstring The string containing the SVG icon.
positionMapspace.Coordinate Location for the icon in local coordinates.
wnumber Width of SVG in pixels.
hnumber Height of SVG in pixels.
scalenumber <nullable>
Scale to apply to returned object. If SVG is defined with default units (pixels) one pixel is converted to one meter. To avoid large SVG icons in the scene the passed scale will be used or 1 if no scale is passed.
namestring <nullable>
Optional name for searching the icon.
- Source:
- mapspace-street/scenemanager.js
Returns:
- Type
- THREE.Object3D
-
addPopup(feature, popup)
-
Adds the
THREE.Object3Dthat will set as a popup to aol.Featureand to the scene. The Object3D passed will be added as subobject to the Object3D that must be stored in observable property calledMapspace.STREET_GEOMETRY_NAMEin the feature. Do not call render so a render call is needed after adding all required objects. A subobject is a popup when has a valueMapspace.css.CLASS_MEASUREMENT_TOOLTIPorMapspace.css.CLASS_ANNOTATION_TOOLTIPset to true in theuserDataof the subobject.Parameters:
Name Type Description featureol.Feature The feature to which add the popup.
popupTHREE.Object3D The popup.
- Source:
- mapspace-street/scenemanager.js
-
addVectorLayer(layer)
-
Adds all the
THREE.Object3Dobjects contained in the provided vector layer and then calls render.Parameters:
Name Type Description layerMapspace.layer.Vector The vector layer.
- Source:
- mapspace-street/scenemanager.js
-
changeBrightness(brightness)
-
Change brightness.
Parameters:
Name Type Description brightnessnumber Brightness.
- Source:
- mapspace-street/scenemanager.js
-
changeContrast(contrast)
-
Change contrast.
Parameters:
Name Type Description contrastnumber Contrast.
- Source:
- mapspace-street/scenemanager.js
-
forceRender()
-
Forces a render of the scene even if no change has occurred in the camera.
- Source:
- mapspace-street/scenemanager.js
-
getCoordinateAtGroundFromPixel(pixel)
-
Returns the coordinates at ground in local projection of a NDC pixel in screen.
Parameters:
Name Type Description pixelArray.<number> Two values with NDC x and y.
- Source:
- mapspace-street/scenemanager.js
Returns:
A three values x, y, z with coordinates at the ground level in local current projection. Local current projection is included in current image metadata as a srid property. Returns null if pixel do not intersects ground.
- Type
- Mapspace.Coordinate
-
getIcon(name)
-
Returns the icon with the given name or null if no one exists in the scene.
Parameters:
Name Type Description namestring Name of the object.
- Source:
- mapspace-street/scenemanager.js
Returns:
- Type
- THREE.Object3D
-
highlightImagePointAtPixel(pixel)
-
Highlights the first image point found at the given pixel, if any.
Parameters:
Name Type Description pixelMapspace.Coordinate The pixel as a NDC event pixel.
- Source:
- mapspace-street/scenemanager.js
-
isPopupsOfVectorLayerVisible(layer)
-
Returns true if all the subobjects that are defined as popups in each
THREE.Object3Dobjects contained in the provided vector layer are visible.Parameters:
Name Type Description layerMapspace.layer.Vector The vector layer.
- Source:
- mapspace-street/scenemanager.js
Returns:
- Type
- boolean
-
isPopupsVisible(feature)
-
Returns true if the subobjects that are defined as popups in the
THREE.Object3Dobject contained in the provided feature are visible.Parameters:
Name Type Description featureol.Feature The feature to change.
- Source:
- mapspace-street/scenemanager.js
Returns:
- Type
- boolean
-
logVisibleTiles()
-
Logs current visible tiles.
- Source:
- mapspace-street/scenemanager.js
-
openImage(rotation, done)
-
Open the current image of the viewer in the scene. This function does all the needed steps for opening a new image. If an opened image exists it transitions from one the next and finally calls to the done function at the end.
Parameters:
Name Type Description rotationnumber Rotation in decimal degrees to use to initialize the camera once the cubic panorama is initialized.
donefunction Function to call once image is opened.
- Source:
- mapspace-street/scenemanager.js
-
removeAllVectorLayers()
-
Removes all the
THREE.Object3Dobjects contained in all the vector layers currently loaded in the viewer this SceneManager belongs to and then calls render.- Source:
- mapspace-street/scenemanager.js
-
removeAxisCollection()
-
Removes the
Mapspace.street.threejs.AxisCollection.- Source:
- mapspace-street/scenemanager.js
-
removeFeature(feature)
-
Removes the
THREE.Object3Dcontained in aol.Featurefrom the scene. The Object3D must be stored in observable property calledMapspace.STREET_GEOMETRY_NAMEin the feature.Do not call render so a render call is needed after removing all required objects.Parameters:
Name Type Description featureol.Feature The feature to remove.
- Source:
- mapspace-street/scenemanager.js
-
removeIcon(object)
-
Removes an icon represented by passed object (the object returned by addIcon).
Parameters:
Name Type Description objectTHREE.Object3D Object with an icon.
- Source:
- mapspace-street/scenemanager.js
-
removePopup(feature)
-
Removes all the
THREE.Object3Dthat are popups from theol.Featureand from the scene. Do not call render so a render call is needed after removing all required objects.Parameters:
Name Type Description featureol.Feature The feature from which remove popups.
- Source:
- mapspace-street/scenemanager.js
-
removePopupsOfVectorLayer(layer)
-
Removes all the
THREE.Object3Dobjects that are popups contained in the provided vector layer and then calls render.Parameters:
Name Type Description layerMapspace.layer.Vector The vector layer.
- Source:
- mapspace-street/scenemanager.js
-
removeVectorLayer(layer)
-
Removes all the
THREE.Object3Dobjects contained in the provided vector layer and then calls render.Parameters:
Name Type Description layerMapspace.layer.Vector The vector layer.
- Source:
- mapspace-street/scenemanager.js
-
render()
-
Requests a new render of the scene using the current status of objects. The object in charge of managing the renders is the RenderLoop.
- Source:
- mapspace-street/scenemanager.js
-
setDebugGrid(debugGrid)
-
Shows or hides debug grid to the existing CubicPanorama.
Parameters:
Name Type Description debugGridboolean True to show and false to hide.
- Source:
- mapspace-street/scenemanager.js
-
setDebugGridColor(debugColor)
-
Changes color of the debug grid.
Parameters:
Name Type Description debugColorstring Color as CSS color.
- Source:
- mapspace-street/scenemanager.js
-
setFeatureVisible(feature, visible)
-
Changes the visibility of the
THREE.Object3Dobject contained in the provided feature. Do not call render so a render call is needed after changing objects.Parameters:
Name Type Description featureol.Feature The feature to change.
visibleboolean If show the objects or hide them.
- Source:
- mapspace-street/scenemanager.js
-
setIconPosition(object, position)
-
Relocates an icon represented by passed object (the object returned by addIcon).
Parameters:
Name Type Description objectTHREE.Object3D Object with an icon.
positionMapspace.Coordinate Coordinates in local space.
- Source:
- mapspace-street/scenemanager.js
-
setPopupPosition(feature, position, offset)
-
Relocates a popup.
Parameters:
Name Type Description featureol.Feature The feature to relocate popup.
positionMapspace.Coordinate Coordinates in local coordinates of the Object3D that is the parent of the popup. It is used to calculate the correct rotation for the popup.
offsetMapspace.Coordinate Coordinate offset for popup relatives to parent object.
- Source:
- mapspace-street/scenemanager.js
-
setPopupsOfVectorLayerVisible(layer, visible)
-
Changes the visibility of the subobjects that are defined as popups in each
THREE.Object3Dobjects contained in the provided vector layer and then calls render. A subobject is a popup when has a valueMapspace.css.CLASS_MEASUREMENT_TOOLTIPorMapspace.css.CLASS_ANNOTATION_TOOLTIPset to true in theuserDataof the subobject.Parameters:
Name Type Description layerMapspace.layer.Vector The vector layer.
visibleboolean If show the objects or hide them.
- Source:
- mapspace-street/scenemanager.js
-
setPopupsVisible(feature, visible)
-
Changes the visibility of the subobjects that are defined as popups in the
THREE.Object3Dobject contained in the provided feature. Do not call render so a render call is needed after changing objects. A subobject is a popup when has a valueMapspace.css.CLASS_MEASUREMENT_TOOLTIPorMapspace.css.CLASS_ANNOTATION_TOOLTIPset to true in theuserDataof the subobject.Parameters:
Name Type Description featureol.Feature The feature to change.
visibleboolean If show the objects or hide them.
- Source:
- mapspace-street/scenemanager.js
-
setVectorLayerVisible(layer, visible)
-
Changes the visibility of the
THREE.Object3Dobjects contained in the provided vector layer and then calls render.Parameters:
Name Type Description layerMapspace.layer.Vector The vector layer.
visibleboolean If show the objects or hide them.
- Source:
- mapspace-street/scenemanager.js
-
updateCamera(params)
-
Updates camera pointing to current yaw, pitch, roll and fov.
Parameters:
Name Type Description paramsMapspace.street.CameraParameters Camera parameters.
- Source:
- mapspace-street/scenemanager.js
-
updateDepthMap(status)
-
Updates the visible tiles using the new status for the depth map.
Parameters:
Name Type Description statusboolean Id the depth map must be visible or not.
- Source:
- mapspace-street/scenemanager.js
-
updateSize()
-
Updates the scene manager size to fill the containing element.
This function is automatically called when the browser window is resized. Most clients won't need to explicitly call it to keep the size up to date.
- Source:
- mapspace-street/scenemanager.js