Logo
Developer

VisioWeb 1.17.1

Global

Members summary


Name Description
floorContentLOD The content object reference the floor content
lods Available LODs for this floor. For the moment we only load the highest LOD for each floor.
node The node attribute is a reference to the floor node in the scenegraph
pickables The pickable objects for this lod
POIFactory contains some default POI options values
POIFactory removes a public POI from the list of known pois of mapviewer.
POIFactory adds a public POI from the list of known pois of mapviewer.
POIFactory adds a public POI from the list of known pois of mapviewer.
POIFactory tries to create a POI using batch implementation.
POIFactory initiate a texture animation based on a string definition that was passed in POI's options
POIFactory takes the results of loading a model in a modelSlot and attaches it to a rotationObject. Can handle models in formatVersion 3.2, and transient mapeditor format 3.1, which the only client that uses it, still has old map.
POIFactory We need removeMaterial to remove textures, usually from text that can leak when doing lots of setPlaceName(); traverses the node and its children, and checks the reference count of the materials, and if appropriate it removes it from the _mapviewer cache, and calls dispose() on it, which deallocates the WebGL ressource associated with it.

Methods summary


Name Description
decodeDracoFile
dot computes the dot product between 2 2D vectors
getAppID Get appID
getURL Get url
isInside2D Determines if a point {x:,y:} is inside a polygon (Array of points), ignore z attribute.
logStat Log statistics into database
POIFactory This method allow to add a POI Object in the scene. The POI is visible by default after creation.
projectPointToPolygon Computes the projection of input point onto a polygon. Returns the same point if inside, else a projected point on the polygon's boundary.
PublicInterface Simple module to host the static creation method
setAppID Set appID
setDrawMode
setMapParameters Set map parameters
setSkipDequantization
setURL Set url
setVerbosity
squareDistanceToSegment computes the distance (squared to avoid making square root operations) between a point and a segment and returns it along with the closest point on the segment
updateCameraObjects updates different objects that depend on camera position and orientation - pois_with_selector - floor.floorContentLOD.cameraUpdatableObjects - lod.cameraUpdatableObjects - floor.floorContentLOD.rampObjects - lod.rampObjects - _mapviewer.globalCameraUpdatebleLinks

Members detail

floorContentLOD

The content object reference the floor content

lods

Available LODs for this floor. For the moment we only load the highest LOD for each floor.

node

The node attribute is a reference to the floor node in the scenegraph

pickables

The pickable objects for this lod

POIFactory

contains some default POI options values
Since:
  • 1.7.22

POIFactory

removes a public POI from the list of known pois of mapviewer.
Since:
  • 1.7.22

POIFactory

adds a public POI from the list of known pois of mapviewer.
Since:
  • 1.7.22

POIFactory

adds a public POI from the list of known pois of mapviewer.
Since:
  • 1.7.22

POIFactory

tries to create a POI using batch implementation.
Since:
  • 1.7.22
See:

POIFactory

initiate a texture animation based on a string definition that was passed in POI's options
Since:
  • 1.8.3

POIFactory

takes the results of loading a model in a modelSlot and attaches it to a rotationObject. Can handle models in formatVersion 3.2, and transient mapeditor format 3.1, which the only client that uses it, still has old map.

POIFactory

We need removeMaterial to remove textures, usually from text that can leak when doing lots of setPlaceName(); traverses the node and its children, and checks the reference count of the materials, and if appropriate it removes it from the _mapviewer cache, and calls dispose() on it, which deallocates the WebGL ressource associated with it.

Methods detail

decodeDracoFile()

Deprecated:
  • Kept for backward-compatibility with previous DRACOLoader versions.

dot(v1, v2) → {number}

computes the dot product between 2 2D vectors
Parameters:
Name Type Description
v1 Object {x, y}
v2 Object {x, y}
Since:
  • 1.8.9
Returns:
Type
number

getAppID() → {string}

Get appID
Returns:
Application's ID
Type
string

getURL() → {string}

Get url
Returns:
the statistics URL
Type
string

isInside2D(point, polygon) → {boolean}

Determines if a point {x:,y:} is inside a polygon (Array of points), ignore z attribute.
Parameters:
Name Type Description
point Object
polygon Array array of points
Since:
  • 1.8.9
Returns:
true if point is inside polygon
Type
boolean

logStat(type, data)

Log statistics into database
Parameters:
Name Type Description
type string of statistic
data object

POIFactory(addPoiVariables, _options, originalPublicPOI) → {visioweb.POI}

This method allow to add a POI Object in the scene. The POI is visible by default after creation.
Parameters:
Name Type Description
addPoiVariables Object
_options Object
Properties
Name Type Attributes Default Description
text string <optional>
'' The text to display above the POI. The use of options.text is mutually exclusive with options.selector/options.model.
textTextureHeight number <optional>
64 Used to control the height of the texture used for the text. Low numbers like 20 are tolerable, and necessary for low memory devices. Bigger numbers means sharper text using more memory. Not generally used, unless memory problems, zero not allowed.
color string <optional>
'#ffffff' The text color, in hexadecimal. Used in conjunction with options.text. default is white
family string <optional>
'Arial' The font type. Used in conjunction with options.text.
url string <optional>
'' URL to an image to display. The use of options.url is mutually exclusive with options.selector/options.model.
selector string <optional>
'' The div id (eg. '#test') to overlay at position. Use selector when you want something to be constant size and you can to control its style via CSS. The selector css display is set to visible (and 'none' when removed). The use of options.selector is mutually exclusive with options.url/options.text.
model string <optional>
'' The path to a JSON file describing a 3D model to insert in the scene. The use of options.model is mutually exclusive with options.text/options.url/options.selector.
textureAnimation string <optional>
'' string describing a texture animation. See createTextureAnimation for more information.
startAnimations Array.<Object> <optional>
{} array of objects listing all the animations that should be played at startup. Animation should be specified as follows: {id: number, loopMode: string}. LoopMode can be 'once', 'repeat' or 'pingpong'.
position Object <optional>
{x:0.0, y:0.0, z:0.0}
alignment Object <optional>
{x:0.0, y:0.0} Valid values are between 1 and -1. With {x:1,y:1} being bottom left corner so the selector will be placed above and to the right of the given position. {x:-1,y:-1} being top right. If you want to align the bottom middle of your selector to be on the position, use {x: 0, y: 1.0}
multiline boolean <optional>
false Only affects options.text. If text has multiple words automatic linebreaks will be computed.
scale Object | number <optional>
{x:1.0, y:1.0, z:1.0} It only affects options.url and options.text. Will have no effect if width and height or zoomScaleFactor are used.
iconScale Object | number <optional>
{x:1.0, y:1.0, z:1.0} DEPRECATED in VisioWeb 1.8.1. Used in conjunction with options.url, you should now use scale instead.
zoomScaleFactor number <optional>
0.0 Defines a coefficient to compute the scale as a function of the zoom (i.e. the camera radius). When combined with a box definition (width and height != -1), the POI will be shown only if it fits in the box. When the same value is set to all POIs, it allows to guarantee a uniform 3D character size for all texts.
zoomScaleFast number <optional>
false Defines whether POIs should be scaled down rather fast when user zooms in. If set to false, POIs will be scaled more gently.
floor string <optional>
currentFloorName The floor to add the POI.
visible number <optional>
true If enabled, the POI will be visible directly after calling this method.
id string <optional>
null Used to identify the POI. Should not be an already used id.
visibilityRampStartVisible number <optional>
2.0 Only applicable if options.url or options.text exist.
visibilityRampFullyVisible number <optional>
5.0 Only applicable if options.url or options.text exist.
visibilityRampStartInvisible number <optional>
3000.0 Only applicable if options.url or options.text exist.
visibilityRampFullyInvisible number <optional>
5000.0 Only applicable if options.url or options.text exist.
onObjectMouseOver function <optional>
global callback Only applicable if options.url or options.text AND options.id exist. This function gets called anytime the mouse moves this POI surface (as opposed to just once when it enters). When this callback exists for a POI, it will not call the global callback (passed on .initialize) or a .trigger().
onObjectMouseOut function <optional>
global callback Only applicable if options.url or options.text AND options.id exist. When this callback exists for a POI, it will not call the global callback (passed on .initialize) or a .trigger().
onObjectMouseUp function <optional>
global callback Only applicable if options.url or options.text AND options.id exist. When this callback exists for a POI, it will be called first, then it will call the global callback (passed on .initialize) or a .trigger()
clickable boolean <optional>
true setting this to false prevents calling any callback over this POI: options.onObjectMouseOver, options.onObjectMouseOut, options.onObjectMouseUp, and their global counter parts. This is similar to VisioMove's VgPoint notifyPOISelectedOnClick. Does not apply to "selector" pois.
fixed boolean <optional>
false When enabled the POI is shown at a fixed angle. The fixed angle is determined by options.angle and it forces the options.face2D to true. Useful for representing directional arrows, for example an arrow which points North. Used in conjunction with options.angle and options.url. Does not apply to options.selector. When using this function the Mapviewer's onObjectMouseUp/trigger mouseup will not be called.
angle number <optional>
0 Angle in degrees with respect to map's natural rotation, use only .angle or .heading but not both. Only applicable if used in conjunction with options.url OR options.text WITH options.fixed=true. 0 means horizontal with respect to how the map look in VisioMapEditor. If you want the labels facing north (letters from west to east), then set .angle = -mapviewer.cameraNorthRotation or better use .heading=0.
heading number <optional>
-mapviewer.cameraNorthRotation Heading in degrees, use only .angle or .heading but not both. Only applicable if used in conjunction with options.url OR options.text WITH options.fixed=true. 0 means facing north (letters from west to east).
width number <optional>
-1 Used with height to specify the box in which the text and icon will reside. If you use this option make sure to set .scale to {x:1,y:1,z:1}
height number <optional>
-1 Used with width to specify the box in which the text and icon will reside. If you use this option make sure to set .scale to {x:1,y:1,z:1}
overlay boolean <optional>
false When enabled the POI will be displayed over the other geometries.
flip boolean <optional>
false When enabled the POI will automatically flip so that it is easily readable from the current camera position. Only applicable if options.fixed=true and if options.angle does not exist.
face2d boolean <optional>
false When enabled the POI will lay flat on the ground. Otherwise the POI will always be camera facing (independent of the camera's pitch). Only applicable if options.fixed=false. When using camera facing (options.fixed = false and options.face2d = false), to avoid the POI "penetrating" the surface below, make sure it is slightly floating (position.z += width/2), or it is anchored at the bottom (options.alignment={x:0,y:1}), or use overlay (options.overlay=true).
image boolean <optional>
false When enabled the POI will not be used for setting the text when doing setPlaceName().
track boolean <optional>
false When enabled the POI position will be tracked for statistics.
originalPublicPOI PublicPOI
Since:
  • 1.8.1 introduced zoomScaleFactor, multiline options, deprecated icon_scale.
Returns:
Type
visioweb.POI
Examples
// For text that zooms in and out
// which you could also control the visibility (with ramp functions)
// use 'text' and 'url' fields
// use onObjectMouseUp to get a callback on click
selected_poi = mapviewer.addPOI({
    url: "test.png",
	   text: 'The object "'+element.vg.id+'" has been clicked',
	   position: {x: element.vg.position.x, y: element.vg.position.y, z: 10},
    id: 'mypoi',
    onObjectMouseUp: function() {alert('click');},
	   scale: 6
});
// For constant size text with full css/html control
// use 'selector' which overlays a <div> over the map.
<div style="display: none;">
  <div id="test" style="font-weigth: bold; font-size: 24px; color: #fff; background: none;"\>
  </div>
</div>
...
selected_poi = mapviewer.addPOI({
	   selector: '#test',
	   position: {x: element.vg.position.x, y: element.vg.position.y, z: 10},
});

projectPointToPolygon(point, polygon) → {Object}

Computes the projection of input point onto a polygon. Returns the same point if inside, else a projected point on the polygon's boundary.
Parameters:
Name Type Description
point Object {x, y}
polygon Array array of points
Since:
  • 1.8.9
Returns:
{x, y}
Type
Object

PublicInterface()

Simple module to host the static creation method

setAppID(appID)

Set appID
Parameters:
Name Type Description
appID string

setDrawMode()

Deprecated:
  • Yes

setMapParameters(p)

Set map parameters
Parameters:
Name Type Description
p object

setSkipDequantization()

Deprecated:
  • Yes

setURL(url)

Set url
Parameters:
Name Type Description
url string

setVerbosity()

Deprecated:
  • Yes

squareDistanceToSegment(point, segment) → {Object}

computes the distance (squared to avoid making square root operations) between a point and a segment and returns it along with the closest point on the segment
Parameters:
Name Type Description
point Object {x, y}
segment Object of 2D points {start: {x, y}, end: {x, y}}
Since:
  • 1.8.9
Returns:
{squareDistance, closestPoint}
Type
Object

updateCameraObjects()

updates different objects that depend on camera position and orientation - pois_with_selector - floor.floorContentLOD.cameraUpdatableObjects - lod.cameraUpdatableObjects - floor.floorContentLOD.rampObjects - lod.rampObjects - _mapviewer.globalCameraUpdatebleLinks

Type Definitions

mouseEventCallback()

Parameters:
Type Description
event
Place | POI