new Proxy( [opt_options])
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
opt_options |
Mapspace.source.ProxyOptions |
<optional> |
Options. |
- Source:
- mapspace/source/sourceproxy.js
Extends
- ol.Object
Methods
-
addInMemorySource( [layout])
-
Returns the ID of a new
Mapspace.source.Vector
created in-memory. The source is defined with 'EPSG:4326' projection and an empty collection of features.A in-memory source is different from a source generated through a source definition. It has name and localFileFormat set as undefined. Apart from that can be used as any other source.
Parameters:
Name Type Argument Description layout
ol.geom.GeometryLayout <optional>
The optional layout of the geometries. If no provided then the default of a
Mapspace.source.Vector
is used.- Source:
- mapspace/source/sourceproxy.js
Returns:
The ID of new source.
- Type
- string
-
addSources(sourcedef, projection)
-
Returns a promise that uses a source definition for reading a file, convert it to
Mapspace.source.Vector
objects and transform them to a given projection.This promise never rejects. The resolve function always returns an array of objects. The objects contains a value key with the ID of a source, or an error key with a error message. Returns only one object if the source definition has one single file, or several if it is a ZIP file.
ZIP files inside ZIP files are not supported and ignored as explained in
Mapspace.format.local.ZIP
reader.Parameters:
Name Type Description sourcedef
Mapspace.source.SourceDefinition The source definition.
projection
string Projection EPSG code.
- Source:
- mapspace/source/sourceproxy.js
Returns:
A Promise that returns an array of objects for the resolve function, and that has no reject function. The objects returned have a property named value with the ID of the source added if adding the source was a success or a property named error with the error message if adding the source was unsuccessful.
- Type
- Promise
-
getSource(id)
-
Gets an existing
Mapspace.source.Vector
for a given source definition.Parameters:
Name Type Description id
string The ID of the source.
- Source:
- mapspace/source/sourceproxy.js
Returns:
-
removeSource(id)
-
Decreases the references to an existing
Mapspace.source.Vector
and if references are zero then removes the source.Parameters:
Name Type Description id
string The ID of the source.
- Source:
- mapspace/source/sourceproxy.js