C# Class Mapsui.Providers.MemoryProvider

Datasource for storing a limited set of geometries.

The MemoryProvider doesn’t utilize performance optimizations of spatial indexing, and thus is primarily meant for rendering a limited set of Geometries.

A common use of the MemoryProvider is for highlighting a set of selected features.

The following example gets data within a BoundingBox of another datasource and adds it to the map. List<Geometry> geometries = myMap.Layers[0].DataSource.GetGeometriesInView(myBox); VectorLayer laySelected = new VectorLayer("Selected Features"); laySelected.DataSource = new MemoryProvider(geometries); laySelected.Style.Outline = new Pen(Color.Magenta, 3f); laySelected.Style.EnableOutline = true; myMap.Layers.Add(laySelected); Adding points of interest to the map. This is useful for vehicle tracking etc. List<Mapsui.Geometries.Geometry> geometries = new List<Mapsui.Geometries.Geometry>(); //Add two points geometries.Add(new Mapsui.Geometries.Point(23.345,64.325)); geometries.Add(new Mapsui.Geometries.Point(23.879,64.194)); Mapsui.Layers.VectorLayer layerVehicles = new Mapsui.Layers.VectorLayer("Vechicles"); layerVehicles.DataSource = new Mapsui.Data.Providers.MemoryProvider(geometries); layerVehicles.Style.Symbol = Bitmap.FromFile(@"C:\data\car.gif"); myMap.Layers.Add(layerVehicles);
Inheritance: IProvider
Exibir arquivo Open project: pauldendulk/Mapsui Class Usage Examples

Public Methods

Method Description
Clear ( ) : void
Find ( object value ) : IFeature
Find ( object value, string primaryKey ) : IFeature
GetExtents ( ) : BoundingBox

Boundingbox of dataset

GetFeaturesInView ( BoundingBox box, double resolution ) : IEnumerable
MemoryProvider ( ) : System
MemoryProvider ( Geometry geometry ) : System

Initializes a new instance of the MemoryProvider

MemoryProvider ( IEnumerable features ) : System

Initializes a new instance of the MemoryProvider

MemoryProvider ( IEnumerable geometries ) : System

Initializes a new instance of the MemoryProvider

MemoryProvider ( IFeature feature ) : System

Initializes a new instance of the MemoryProvider

MemoryProvider ( IFeatures features ) : System

Initializes a new instance of the MemoryProvider

MemoryProvider ( byte wellKnownBinaryGeometry ) : System

Initializes a new instance of the MemoryProvider

MemoryProvider ( string wellKnownTextGeometry ) : System

Initializes a new instance of the MemoryProvider

Method Details

Clear() public method

public Clear ( ) : void
return void

Find() public method

public Find ( object value ) : IFeature
value object
return IFeature

Find() public method

public Find ( object value, string primaryKey ) : IFeature
value object
primaryKey string
return IFeature

GetExtents() public method

Boundingbox of dataset
public GetExtents ( ) : BoundingBox
return BoundingBox

GetFeaturesInView() public method

public GetFeaturesInView ( BoundingBox box, double resolution ) : IEnumerable
box BoundingBox
resolution double
return IEnumerable

MemoryProvider() public method

public MemoryProvider ( ) : System
return System

MemoryProvider() public method

Initializes a new instance of the MemoryProvider
public MemoryProvider ( Geometry geometry ) : System
geometry Geometry Geometry to be in this datasource
return System

MemoryProvider() public method

Initializes a new instance of the MemoryProvider
public MemoryProvider ( IEnumerable features ) : System
features IEnumerable Features to be included in this datasource
return System

MemoryProvider() public method

Initializes a new instance of the MemoryProvider
public MemoryProvider ( IEnumerable geometries ) : System
geometries IEnumerable Set of geometries that this datasource should contain
return System

MemoryProvider() public method

Initializes a new instance of the MemoryProvider
public MemoryProvider ( IFeature feature ) : System
feature IFeature Feature to be in this datasource
return System

MemoryProvider() public method

Initializes a new instance of the MemoryProvider
public MemoryProvider ( IFeatures features ) : System
features IFeatures Features to be included in this datasource
return System

MemoryProvider() public method

Initializes a new instance of the MemoryProvider
public MemoryProvider ( byte wellKnownBinaryGeometry ) : System
wellKnownBinaryGeometry byte as Well-known Binary to be included in this datasource
return System

MemoryProvider() public method

Initializes a new instance of the MemoryProvider
public MemoryProvider ( string wellKnownTextGeometry ) : System
wellKnownTextGeometry string as Well-known Text to be included in this datasource
return System