Draw object layer: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 4: | Line 4: | ||
<source lang="c#"> | <source lang="c#"> | ||
// Symbol service client and symbol processor is shared between different layers. | |||
SymbolPointServiceClient = new SymbolPointServiceClient(bindingFactory.NewFromConfigurationFile("SymbolPointService"), endpointAddressFactory.NewFromConfigurationFile("SymbolPointService"), 1000); | |||
_symbolRequestProcessor = new SymbolRequestProcessor(SymbolPointServiceClient); | |||
.... | |||
// There should be only one draw object system factory in the application. | |||
_drawObjectSystemFactory = new DrawObjectSystemFactory(_symbolRequestProcessor); | |||
// Common draw object resources, may be used throughout the application. | |||
_drawObjectCommon = _drawObjectSystemFactory.CommonResources; | |||
// Connect to GeoObject service, if necessary. | |||
_drawObjectCommon.GeoObjectClientStores.ConnectToService(new Uri("http://localhost:5097")); | |||
// Create a draw object layer with an in-memory store. | |||
var storeInfo = new StoreInfo() { Id = "InMemory", IsInProcessStore = true }; | |||
_drawObjectLayer = _drawObjectSystemFactory.CreateLayer(GeoControlViewModel, storeInfo); | |||
</source> | </source> |
Revision as of 14:39, 2 April 2025
This page details the setup of the Maria DrawObjectLayer.
Example
// Symbol service client and symbol processor is shared between different layers.
SymbolPointServiceClient = new SymbolPointServiceClient(bindingFactory.NewFromConfigurationFile("SymbolPointService"), endpointAddressFactory.NewFromConfigurationFile("SymbolPointService"), 1000);
_symbolRequestProcessor = new SymbolRequestProcessor(SymbolPointServiceClient);
....
// There should be only one draw object system factory in the application.
_drawObjectSystemFactory = new DrawObjectSystemFactory(_symbolRequestProcessor);
// Common draw object resources, may be used throughout the application.
_drawObjectCommon = _drawObjectSystemFactory.CommonResources;
// Connect to GeoObject service, if necessary.
_drawObjectCommon.GeoObjectClientStores.ConnectToService(new Uri("http://localhost:5097"));
// Create a draw object layer with an in-memory store.
var storeInfo = new StoreInfo() { Id = "InMemory", IsInProcessStore = true };
_drawObjectLayer = _drawObjectSystemFactory.CreateLayer(GeoControlViewModel, storeInfo);