VERIFIED SOLUTION i
X

How to save a Workspace using MapXtreme

UPDATED: October 18, 2017


Below are two methods for saving Workspaces for MapXtreme:

First method:
 
//Create a WorkSpacePersistence object
MapInfo.Persistence.WorkSpacePersistence wsp = new MapInfo.Persistence.WorkSpacePersistence();
//Call the save method and supply a file path/name
wsp.Save ("c:\\temp\\newwork.mws");

Second method:
 
// Create a named connection point to "D:\data\version2"
NamedConnectionInfo info = new NamedConnectionInfo("file", ConnectionMethod.FilePath, @"D:\data\version2");
Session.Current.Catalog.NamedConnections.Add("MyDataFolder", info);

// Create a map
Map map = Session.Current.MapFactory.CreateEmptyMap("MyMap", "MyMapAlias", new Size(400,400));
Table table = Session.Current.Catalog.OpenTable("MyDataFolder", "myTableAlias", @"Seamless\Lines - NYALBA\SeamCapDist.TAB");
map.Layers.Add(new FeatureLayer(table));

// Save the Session to a workspace file
WorkSpacePersistence w = new WorkSpacePersistence();
w.Save(@"c:\workspace\mySeamless.mws");

Environment Details

Product Feature: General

Operating System: Windows 7
 

Downloads

  • No Downloads