Draw object layer: Difference between revisions

From Maria GDK Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:


<source lang="c#">
<source lang="c#">
            _drawObjectSystemFactory = new DrawObjectSystemFactory(_symbolRequestProcessor);
  // Symbol service client and symbol processor is shared between different layers.
            _drawObjectCommon = _drawObjectSystemFactory.CommonResources;
  SymbolPointServiceClient = new SymbolPointServiceClient(bindingFactory.NewFromConfigurationFile("SymbolPointService"), endpointAddressFactory.NewFromConfigurationFile("SymbolPointService"), 1000);
            _drawObjectCommon.GeoObjectClientStores.ConnectToService(new Uri("http://localhost:5097"));
  _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"));
              
              
            var storeInfo = new StoreInfo() { Id = "InMemory", IsInProcessStore = true };
  // Create a draw object layer with an in-memory store.
            _drawObjectLayer = _drawObjectSystemFactory.CreateLayer(GeoControlViewModel, storeInfo);
  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);