new StreetPanel( [options])
A control to show a small overview of a Street viewer inside a panel.
The purpose of this control is to be used as a way to see neighbour Street images that surround the current visible one to obtain coordinates and other data mixing information from several Street images.
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
options |
Mapspace.control.ControlOptions |
<optional> |
Panel options. |
- Source:
- mapspace/controls/streetpanel.js
Fires:
- Mapspace.control.event:StreetPanelEvent
- Mapspace.control.event:ToolEvent
- ol.events.Event#event:outputprojectionchanged
- ol.events.Event#event:renamed
- ol.events.Event#event:saved
- ol.events.Event#event:unitschanged
- ol.events.Event#event:vieweractivated
- ol.events.Event#event:viewerdeactivated
- ol.events.Event#event:viewernamechanged
Extends
Methods
-
addSection(element, name, key, text, classType, collapsed)
-
Adds a section button to the control.
Parameters:
Name Type Argument Description element
HTMLElement Element in which inserting the section.
name
string Name for the section.
key
string <nullable>
Globalization key. If not provided or not exist a value for it the default text will be used.
text
string Default text to show in case globalization key is null or not exist.
classType
Object Optional class type to use for creation of the element that must be returned.
collapsed
boolean <nullable>
Optional boolean. If section must be created collapsed or not.
- Inherited From:
- Source:
- mapspace/controls/toolscontrol.js
Returns:
Element for inserting controls or control if classType param is passed.
- Type
- HTMLElement | Mapspace.control.Control
-
clearControl()
-
Clears all the HTML elements under the control element and clear listeners.
- Source:
- mapspace/controls/streetpanel.js
-
containsInteractiveTool(tool)
-
Returns true if this control contains the given interactive tool.
Parameters:
Name Type Argument Description tool
Mapspace.InteractiveToolNames <nullable>
The tool name.
- Inherited From:
- Source:
- mapspace/controls/toolscontrol.js
Returns:
- Type
- boolean
-
getButtonDisabled(name)
-
Gets if a button is disabled or not.
Parameters:
Name Type Description name
Mapspace.ToolNames The name of the button.
- Inherited From:
- Source:
- mapspace/controls/toolscontrol.js
Returns:
- Type
- boolean
-
getButtonSelected(name)
-
Gets if a button is selected or not.
Parameters:
Name Type Description name
Mapspace.ToolNames The name of the button.
- Inherited From:
- Source:
- mapspace/controls/toolscontrol.js
Returns:
- Type
- boolean
-
getButtonVisibility(name)
-
Gets the visibility of a button.
Parameters:
Name Type Description name
Mapspace.ToolNames The name of the button.
- Inherited From:
- Source:
- mapspace/controls/toolscontrol.js
Returns:
- Type
- boolean
-
getCoordinatesFromFeature(feature)
-
Gets an array of coordinates from a feature. Feature must be a measurement or an annotation, and the geometry must be a the ones allowed in that layers, Point, LineString or Polygon. If not, returns null.
Parameters:
Name Type Argument Description feature
ol.Feature <nullable>
Feature.
- Source:
- mapspace/controls/streetpanel.js
Returns:
- Type
- Array.<Mapspace.Coordinate>
-
getCurrentData()
-
Gets an object with all information in the control, like the layer, feature, vertexObjects, etc. This can be used to restore data in different viewers using
restoreData
.- Source:
- mapspace/controls/streetpanel.js
Returns:
- Type
- Object
-
getCurrentInteractiveTool()
-
Returns the current interactive tool selected in the control or null if none.
- Inherited From:
- Source:
- mapspace/controls/toolscontrol.js
Returns:
-
getFeature()
-
Gets the feature to edit.
- Source:
- mapspace/controls/streetpanel.js
Returns:
- Type
- ol.Feature
-
getLayer()
-
Gets the layer with the feature to edit.
- Source:
- mapspace/controls/streetpanel.js
Returns:
-
getRedefinedPoint(index)
-
Gets the redefined point of a vertex, or null if no redefinition is done. The new point in is Mercator Spheric, redefined using the mean between all clicked points in the Street images.
Parameters:
Name Type Description index
number Index of the vertex.
- Source:
- mapspace/controls/streetpanel.js
Returns:
- Type
- ol.geom.Point
-
getSectionsUniqueNumber()
-
Returns a unique number (as string) to use in IDs inside sections, to avoid collisions between IDs. Each control deriving this class must implement its own method.
- Inherited From:
- Overrides:
- Source:
- mapspace/controls/toolscontrol.js
Returns:
- Type
- string
-
getSidePanel()
-
Returns the reference to the Side Panel this panel belongs to or null if no Side Panel is set.
- Inherited From:
- Source:
- mapspace/controls/toolscontrol.js
Returns:
-
getToolObjects()
-
Returns the array of objects that contain the tool buttons.
- Inherited From:
- Overrides:
- Source:
- mapspace/controls/toolscontrol.js
Returns:
- Type
- Array.<Mapspace.ToolDefinition>
-
getVertexes()
-
Gets the array of coordinates of the current feature in Mercator Spheric. The array returned is a copy, not the reference to the internal array.
- Source:
- mapspace/controls/streetpanel.js
Returns:
- Type
- Array.<Mapspace.Coordinate>
-
getVertexSelectedIndex()
-
Gets the vertex selected index, or -1 if no one is selected.
- Source:
- mapspace/controls/streetpanel.js
Returns:
- Type
- number
-
isFeaturePolygon()
-
Returns true if current feature is a polygon one.
- Source:
- mapspace/controls/streetpanel.js
Returns:
- Type
- boolean
-
isImagesFilterByTime()
-
Returns true if current images filter is by time. If false is by distance.
- Source:
- mapspace/controls/streetpanel.js
Returns:
- Type
- boolean
-
isSectionCollapsed(name)
-
Returns true if a section is collapsed.
Parameters:
Name Type Description name
string Name of section.
- Inherited From:
- Source:
- mapspace/controls/toolscontrol.js
Returns:
- Type
- boolean
-
isSectionVisible(name)
-
Returns true if a section is visible.
Parameters:
Name Type Description name
string Name of section.
- Inherited From:
- Source:
- mapspace/controls/toolscontrol.js
Returns:
- Type
- boolean
-
notifyButtonClick(tool, interactive)
-
Notifies that a given tool has been selected.
Parameters:
Name Type Argument Description tool
Mapspace.ToolNames <nullable>
The tool selected or null if tool has been deselected.
interactive
boolean If the tool is interactive or not.
- Source:
- mapspace/controls/streetpanel.js
-
resetControl()
-
Resets the control clearing data, control element and listeners.
- Source:
- mapspace/controls/streetpanel.js
-
resetVertexObject(index, refresh)
-
Resets a given vertex object and clear current objects drawn in viewer.
Parameters:
Name Type Description index
number Vertex index.
refresh
boolean If refresh the viewer or not.
- Source:
- mapspace/controls/streetpanel.js
-
resetVertexObjects()
-
Resets vertex objects and clear current objects drawn in viewer.
- Source:
- mapspace/controls/streetpanel.js
-
restoreData(data)
-
Restores information in the control using an object and refreshes it.
Parameters:
Name Type Description data
Object - Source:
- mapspace/controls/streetpanel.js
-
selectInteractiveTool(tool)
-
Sets one interactive tool as selected. If tool passed is null then any interactive tool in the control is unselected. This function do not executes any related action due to tool selection, it just modifies the visual state of buttons.
Parameters:
Name Type Argument Description tool
Mapspace.InteractiveToolNames <nullable>
The tool name.
- Inherited From:
- Source:
- mapspace/controls/toolscontrol.js
-
setAllButtonsVisibility(viewType)
-
Sets the visibility of buttons to the correct one for the given view type.
Parameters:
Name Type Description viewType
Mapspace.ViewType The view type.
- Inherited From:
- Source:
- mapspace/controls/toolscontrol.js
-
setButtonDisabled(name, disabled)
-
Sets if a button is disabled or not. This do not trigger any event, just modifies the visual state of the button.
Parameters:
Name Type Description name
Mapspace.ToolNames The name of the button.
disabled
boolean If the button must be disabled or not.
- Inherited From:
- Source:
- mapspace/controls/toolscontrol.js
-
setButtonSelected(name, selected)
-
Sets if a button is selected or not. This do not trigger any event, just modifies the visual state of the button.
Parameters:
Name Type Description name
Mapspace.ToolNames The name of the button.
selected
boolean If the button must be selected or not.
- Inherited From:
- Source:
- mapspace/controls/toolscontrol.js
-
setButtonsVisibility(names, visible)
-
Sets the visibility of a button or several buttons using its tools name.
Parameters:
Name Type Description names
Mapspace.ToolNames | Array.<Mapspace.ToolNames> One or several names of the buttons to modify.
visible
boolean If the buttons must be visible or not.
- Inherited From:
- Source:
- mapspace/controls/toolscontrol.js
-
setFeatureAndLayer(feature, layer)
-
Sets the feature to edit. If any previous feature was in redefinition mode and changes were not accepted, they are lost.
Parameters:
Name Type Argument Description feature
ol.Feature <nullable>
The feature to edit.
layer
Mapspace.layer.Vector <nullable>
Layer with the feature to edit.
- Source:
- mapspace/controls/streetpanel.js
-
setImages(curImage, nearImages, maxDistance)
-
Sets the array of list of images to use.
Parameters:
Name Type Description curImage
Mapspace.street.Image Current Street image in which the feature to redefine is drawn.
nearImages
Array.<Array.<Mapspace.street.Image>> Array of arrays of Street images, one per each vertex in the current feature.
maxDistance
number Maximum distance that a ray must be shown.
- Source:
- mapspace/controls/streetpanel.js
-
setImagesFilterDropdown(byTime)
-
Sets the index in the images filter dropdown. This do not triggers an event. It is only used for refreshing the dropdown if the change has been canceled.
Parameters:
Name Type Description byTime
boolean If set by time filter.
- Source:
- mapspace/controls/streetpanel.js
-
setSectionCollapsed(name, collapsed)
-
Sets a section as collapsed or uncollapsed.
Parameters:
Name Type Description name
string Name of the section.
collapsed
boolean True to collapse, false to uncollapse.
- Inherited From:
- Source:
- mapspace/controls/toolscontrol.js
-
setSectionVisible(name, visible)
-
Sets a section visible or hidden.
Parameters:
Name Type Description name
string Name of the section.
visible
boolean True to show, false to hide.
- Inherited From:
- Source:
- mapspace/controls/toolscontrol.js
-
setSidePanel(panel)
-
Sets the reference to the Side Panel this panel belongs to. This do not re-targets the HTML element of the panel. Use setTarget for that.
Parameters:
Name Type Description panel
Mapspace.control.SidePanel The Side panel reference.
- Inherited From:
- Source:
- mapspace/controls/toolscontrol.js
-
setStreetPointsStyleIcons(icon)
-
Sets the current SVG icons to show for Street points in the images listbox.
Parameters:
Name Type Description icon
Object The SVG icon.
- Source:
- mapspace/controls/streetpanel.js
-
setVertexCoordinate(index, coord)
-
Sets a new coordinate for the given vertex. It is needed to update images after that with
setVertexImages
.Parameters:
Name Type Description index
number Vertex index.
coord
Mapspace.Coordinate Coordinate.
- Source:
- mapspace/controls/streetpanel.js
-
setVertexImages(index, nearImages, maxDistance)
-
Sets the list of images for a vertex.
Parameters:
Name Type Description index
number Vertex index.
nearImages
Array.<Mapspace.street.Image> Array of Street images for the vertex.
maxDistance
number Maximum distance that a ray must be shown.
- Source:
- mapspace/controls/streetpanel.js
-
setVertexSelectedIndex(index)
-
Selects the given vertex.
Parameters:
Name Type Description index
number Index of the selected vertex. If index = -1 current selected vertex is not changed but all listboxes are updated.
- Source:
- mapspace/controls/streetpanel.js
-
updateButtons()
-
Updates the buttons in tools section.
- Source:
- mapspace/controls/streetpanel.js
-
updateControl(element)
-
Updates the control.
Parameters:
Name Type Description element
HTMLElement The element of the control.
- Source:
- mapspace/controls/streetpanel.js
-
updateImagesListBox()
-
Updates the images list box.
- Source:
- mapspace/controls/streetpanel.js
-
updateInteractiveTools(tool)
-
Updates the control using the given interactive tool name. If it is not one interactive tool contained in the control then the control deselects the current interactive tool without triggering any event. If null deselects all.
Parameters:
Name Type Argument Description tool
Mapspace.InteractiveToolNames <nullable>
The current interactive tool or null if no interactive tool is currently active.
- Source:
- mapspace/controls/streetpanel.js
-
updateSize()
-
Updates the size of internal components.
- Source:
- mapspace/controls/streetpanel.js
-
updateValidStatusDropdown()
-
Updates the status dropdown.
- Source:
- mapspace/controls/streetpanel.js