The Object visualizer gives access to the legato map client. It is possible to visualize GeoJSON objects with styles and set the visible area of the map via a bounding box or a center point with a minimum and maximum scale.
Inherits from: | WPS.Control |
WPS. | The Object visualizer gives access to the legato map client. |
Functions | |
initialize | Basic constructor |
destroy | WPS.Control |
setBoundingBox | Sets the map extent to the bounding box with given coordinates. |
setCenterAndScale | Sets the map extent based on the center point with given coordinates and the scale. |
visualize | Shows the given objects with styles and map tips on the map. |
lwpsc: | XML based configuration for a WPS.Control.ObjectVisualizer. |
setBoundingBox : function( left, bottom, right, top )
Sets the map extent to the bounding box with given coordinates.
left | {Number} Minimum horizontal coordinate. |
bottom | {Number} Minimum vertical coordinate. |
right | {Number} Maximum horizontal coordinate. |
top | {Number} Maximum vertical coordinate. |
setCenterAndScale : function( x, y, scale )
Sets the map extent based on the center point with given coordinates and the scale.
x | {Number} Horizontal coordinate of the center point. |
y | {Number} Vertical coordinate of the center point. |
scale | {Number} Denominator value of scale. If null, the minimum possible scale will be used. |
visualize : function( layerName, objects )
Shows the given objects with styles and map tips on the map. All the given objects will be in the same layer. After adding the objects, the map client zooms to the newly added objects.
layerName | {String} The name of the layer where the given geometry objects should be added. If this parameter is null, then a new layer will be created and its name will be generated automatically. Otherwise, the method looks for the layer with the given name. If the layer is found, then the objects will be in that layer. Otherwise, a new layer with the given name is created. |
objects | {Array} An array of geometry objects to add. The following keys are supported: |
XML based configuration for a WPS.Control.ObjectVisualizer.
<lwpsc:ObjectVisualizer> <map> <lb:Reference target="map" /> </map> </lwpsc:ObjectVisualizer>
Basic constructor
initialize : function( options )
WPS.Control
destroy : function()
Sets the map extent to the bounding box with given coordinates.
setBoundingBox : function( left, bottom, right, top )
Sets the map extent based on the center point with given coordinates and the scale.
setCenterAndScale : function( x, y, scale )
Shows the given objects with styles and map tips on the map.
visualize : function( layerName, objects )