Save MWS statement - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

This statement allows you to save the current workspace as an XML-based MWS file for use with MapXtreme applications. These MWS files can be shared across platforms in ways that workspaces cannot. You can issue this statement from the MapBasic window in MapInfo Pro.

Syntax

Save MWS Window ( window_id [ , window_id ... ] ) 
	Default default_window_id As filespec

window_id is an integer window identifier for a Map window.

default_window_id is an integer window identifier for the Map window to be recorded in the MWS as the default map.

Description

MapInfo Pro enables you to save the maps in your workspace to an XML format for use with MapXtreme applications. When saving a workspace to MWS format, only the map windows and legends are saved. All other windows are discarded as MapXtreme applications cannot read that information. Once your workspace is saved in this format, it can be opened with the Workspace Manager utility that is included in the MapXtreme installation or with an application developed using MapXtreme. The file is valid XML so can also be viewed using any XML viewer or editor. MWS files created with MapInfo Pro 7.8 or later can be validated using schemas supplied with MapXtreme.

Note: You will not be able to read files saved in MWS format in MapInfo Pro 7.8 or later.

In MapInfo Pro, you can set the visibility of a modifier theme without regard to its reference feature layer, so you can turn the visibility of the main reference layer off but still display the theme. In MapXtreme, the modifier themes (Dot Density, Ranges, Individual Value) are only drawn if the reference feature layer is visible. To ensure that modifiers marked as visible in MapInfo Pro display in tools like Workspace Manager, we force the visibility of the reference feature layer so that its modifier themes display.

It is important to note that many MapBasic statements and functions do not translate to MWS format. The sections below show what aspects of our maps can and cannot be saved into an MWS file. For detailed listing of the compatibilities between MapBasic and MISQL see the MapInfo Pro User Guide.

What is Saved in the MWS

The following information is included in the MWS workspace file:

  • Tab files' name and alias;
  • Coordinate system information;
  • Map center and zoom settings;
  • Layer list with implied order;
  • Map size as pixel width and height;
  • Map resize method;
  • Style overrides;
  • Raster layer overrides;
  • Automatic labels;
  • Custom labels;
  • Queries referenced by map windows;
  • Individual value themes;
  • Dot density themes;
  • Graduated symbol themes;
  • Bar themes;
  • Range themes;
  • Pie themes;
  • Grid themes as MapXtreme grid layers with a style override;
  • Themes and label expressions based upon a single attribute column;
  • Zoom-ranged overrides.

What is Not Saved to the MWS

The following information is not saved in the MWS workspace file:

  • Any non-map windows (browsers, charts, redistricters, 3D map windows, Prism maps);
  • Distance, area, or XY and military grid units;
  • Snap mode, autoscroll, and smart pan settings;
  • Printer setup information;
  • Any table that is based on a query that is not referenced by a window;
  • Any theme that is based upon computed columns, or based on an expression that cannot be translated from MapBasic syntax to MI SQL syntax;
  • Labels based on expressions that cannot be translated from MapBasic syntax to MI SQL syntax;
  • Queries with "sub-select" statements;
  • Layers based on queries that includes "sub-select" statements;
    Note: A "sub-select" statement is any Select statement nested inside another Select statement.
  • Export options;
  • Hot links for labels and objects;
  • Group layers;
  • Whether object nodes, centroids or line direction is displayed.

See Also:

Save Workspace statement