new VectorLayersCacheManager( [opt_options])
Parameters:
| Name | Type | Argument | Description | 
|---|---|---|---|
opt_options | 
            
            Object | 
                
                    <optional> | 
            
            
            Options.  | 
        
- Source:
 - mapspace/vectorlayerscache.js
 
Extends
- ol.Object
 
Methods
- 
    
addItem(item, parent)
 - 
    
    
Adds a layer or a layer group to the list of vector layers. Triggers a change event if item is added.
Parameters:
Name Type Argument Description itemMapspace.LayerGroup | Mapspace.LayerGroupLayer Item object.
parentMapspace.LayerGroupLayer <nullable> 
Optional. Parent object. If not present the item is considered a root item.
- Source:
 - mapspace/vectorlayerscache.js
 
 - 
    
findItem(id, type, cloned)
 - 
    
    
Finds an item in current cache by ID.
Parameters:
Name Type Argument Description idnumber ID of item to search.
typeMapspace.LayerGroupItemType Type of item.
clonedboolean <nullable> 
Optional. If return a shallow copy or the reference. By default is false.
- Source:
 - mapspace/vectorlayerscache.js
 
Returns:
 - 
    
findItemByName(name, type, cloned)
 - 
    
    
Finds an item in current cache by name.
Parameters:
Name Type Argument Description namestring Name of item to search.
typeMapspace.LayerGroupItemType Type of item.
clonedboolean <nullable> 
Optional. If return a shallow copy or the reference. By default is false.
- Source:
 - mapspace/vectorlayerscache.js
 
Returns:
 - 
    
findRoot(id, type, cloned)
 - 
    
    
Finds the root group item of an item in current cache by ID.
Parameters:
Name Type Argument Description idnumber ID of item to search.
typeMapspace.LayerGroupItemType Type of item.
clonedboolean <nullable> 
Optional. If return a shallow copy or the reference. By default is false.
- Source:
 - mapspace/vectorlayerscache.js
 
Returns:
- Type
 - Mapspace.LayerGroup
 
 - 
    
getContent(cloned)
 - 
    
    
Returns the array with the content of vector layers or a copy of it.
Parameters:
Name Type Description clonedboolean If return a shallow copy or the reference.
- Source:
 - mapspace/vectorlayerscache.js
 
Returns:
- Type
 - Array.<(Mapspace.LayerGroupLayer|Mapspace.LayerGroup)>
 
 - 
    
getError()
 - 
    
    
Returns the last error after an update from the server.
- Source:
 - mapspace/vectorlayerscache.js
 
Returns:
- Type
 - Error
 
 - 
    
isEqual(info1, info2)
 - 
    
    
Compares two objects with layer information and returns if they are the same or not.
Parameters:
Name Type Description info1Array.<(Mapspace.LayerGroupLayer|Mapspace.LayerGroup)> First object to compare.
info2Array.<(Mapspace.LayerGroupLayer|Mapspace.LayerGroup)> Second object to compare.
- Source:
 - mapspace/vectorlayerscache.js
 
Returns:
- Type
 - boolean
 
 - 
    
removeItem(item, parent)
 - 
    
    
Removes a layer or a layer group from the list of vector layers. Trigger a event if item is removed.
Parameters:
Name Type Argument Description itemMapspace.LayerGroup | Mapspace.LayerGroupLayer Item object.
parentMapspace.LayerGroupLayer <nullable> 
Optional. Parent object. If not present the item is considered a root item.
- Source:
 - mapspace/vectorlayerscache.js
 
 - 
    
renameItem(id, type, name)
 - 
    
    
Renames a layer or layer group in the list of vector layers, if it is found. Triggers a change event if name is changed.
Parameters:
Name Type Description idnumber ID of item to search.
typeMapspace.LayerGroupItemType Type of item.
namestring New name.
- Source:
 - mapspace/vectorlayerscache.js
 
 - 
    
toString(info)
 - 
    
    
Returns a simple string representation of the array of layer information.
Parameters:
Name Type Argument Description infoArray.<(Mapspace.LayerGroupLayer|Mapspace.LayerGroup)> <nullable> 
Optional layer information to convert to string. If not present the current layer information in the cache is used.
- Source:
 - mapspace/vectorlayerscache.js
 
Returns:
- Type
 - string
 
 - 
    
update()
 - 
    
    
Returns a Promise that retrieves layer group information from Mapspace server and stores it. This information can be obtained through
getContent. Error can be obtained throughgetErrorif any error happened.- Source:
 - mapspace/vectorlayerscache.js
 
Returns:
A Promise that returns a clone of layer group information in the resolve function or an Error in the reject function.
- Type
 - Promise