Maptitude GISDK Help

Views, Layers, and Joined Views

Every map layer has a corresponding view that contains the tabular information that go with the map layer. For example, when you use the File-Open command in Maptitude to open the geographic file named ccstatel.cdf, the GISDK creates a layer named "States" and a view named "States." The view name is always the same as the layer name.

 

Not every view has a corresponding map layer, however. When you use the File-Open command in Maptitude to open a dBASE file named customer.dbf (a file containing customer information but no geographic data), GISDK creates a view named "Customer," but does not create a layer.

 

A map layer can have two or more views associated with it. For example, here is a common Maptitude operation:

This sequence of steps results in three different views: States, Sales, and States+Sales. Two of these contain data that are associated with the state layer (States and States+Sales). When you make a thematic map on states, or label the state layer, you can choose fields from either of these views. The fields in these two views are known as mappable fields, because they can be used to affect the way states are displayed on a map.

 

Once you create a joined view, Maptitude requires that the component views be present. As a result, when you close a view that is part of a joined view (by calling CloseView()), the view remains active in the system, but becomes hidden. When a view is hidden, it can never be set as the current layer, and it is not included in the list of views returned by GetViewNames() or GetViews().

 

Maptitude drops a view out of the system automatically when it is no longer used in any window. For example, if you close an editor that contains a view, and the view is neither in use in another editor nor linked to any other map layer, the view is closed automatically. Similarly, when a layer is dropped from a map or when a map is closed, each view corresponding to a layer is closed automatically (unless that view is still displayed in an editor window).

 

Here is an example that illustrates some of the above concepts.

 

// Open two tables...

sales_vw1 = OpenTable("Sales", "DBASE", "c:\\dbffiles\\sales95.dbf", )

sales_vw2 = OpenTable("Sales", "DBASE", "c:\\dbffiles\\sales94.dbf", )

 

// Join the views together

joined_vw = JoinViews("Sales1+2", sales_vw1 + ".ID", sales_vw2 + ".ID", )

 

// The first list of views will have three entries - Sales1, Sales2, and Sales1+2

list1 = GetViewNames()

 

// Now, close the first view

CloseView(sales_vw1)

 

// The second list of views will have two entries - Sales2, and Sales1+2

list2 = GetViewNames()

 

// Display the two remaining views in editors...

ed1 = CreateEditor("Editor Number 1", sales_vw2+ "|", ed_options)

ed2 = CreateEditor("Editor Number 2", joined_vw+ "|", ed_options)

 

// Now close the editor for the joined view...

// WARNING! - The view is closed automatically...

CloseEditor(ed2)

 

// Now the joined view is gone...

on not found do

     // Here's a trap for the error that will occur in a moment or two...

     ShowMessage("I told you the joined view was gone!")

     goto no_problem

     end

 

// This statement will cause an error     // NotFound

SetView(joined_vw)

no_problem:

on error default

 

// The other view is still displayed in an editor, so we can't close the view...

on error do

     // Here's a trap for the error that will occur in a moment or two...

     ShowMessage("You can't close the view while an editor is showing it!")

     goto still_no_problem

     end

 

// This statement will cause an error

CloseView(sales_vw2)

still_no_problem:

on error default

 

For more information, see:

Creating Joined Views

Types of Joined Views

Mappable Views

Performance of a Joined View

Permanent Joined Views

 

 

©2025 Caliper Corporation www.caliper.com