AGI Ui Core 11 Send comments on this topic.
MapID Property (IAgUiWindowMapObject)
See Also  Example





Description

A unique identifier associated with the window that can be used with Connect to control the 2D map.

Property type

Read-only property

Syntax

[Visual Basic .NET]
Public Property MapID() As Integer

[C#]
public int MapID {get;}

[Managed C++]
public: __property int get_MapID();

[Unmanaged C++]
public: HRESULT get_MapID(
long * pRetVal
);

[Java]
public int getMapID();

Example

Enumerate all 2D (Map) windows and print their map identifiers.
[C#] Copy Code
foreach (IAgUiWindow window in application.Windows) 

    object oSvc = window.GetServiceByType(AgEWindowService.eWindowService2DWindow); 
    IAgUiWindowMapObject mapObject = oSvc as IAgUiWindowMapObject; 
    if (mapObject != null
    { 
        Console.WriteLine("Window Title: {0}, scene ID: {1}", window.Caption, mapObject.MapID); 
    } 

 

Enumerate all 2D (Map) windows and print their map identifiers.
[C#] Copy Code
foreach (IAgUiWindow window in application.Windows) 

    object oSvc = window.GetServiceByName("Map"); 
    IAgUiWindowMapObject mapObject = oSvc as IAgUiWindowMapObject; 
    if (mapObject != null
    { 
        Console.WriteLine("Window Title: {0}, scene ID: {1}", window.Caption, mapObject.MapID); 
    } 

 

Enumerate all 2D (Map) windows and print their map identifiers.
[Visual Basic .NET] Copy Code
For Each window As IAgUiWindow In application.Windows
    Dim oSvc As Object = window.GetServiceByType(AgEWindowService.eWindowService2DWindow)
    Dim mapObject As IAgUiWindowMapObject = TryCast(oSvc, IAgUiWindowMapObject)
    If mapObject IsNot Nothing Then
        Console.WriteLine("Window Title: {0}, scene ID: {1}", window.Caption, mapObject.MapID)
    End If
Next

Enumerate all 2D (Map) windows and print their map identifiers.
[Visual Basic .NET] Copy Code
For Each window As IAgUiWindow In application.Windows
    Dim oSvc As Object = window.GetServiceByName("Map")
    Dim mapObject As IAgUiWindowMapObject = TryCast(oSvc, IAgUiWindowMapObject)
    If mapObject IsNot Nothing Then
        Console.WriteLine("Window Title: {0}, scene ID: {1}", window.Caption, mapObject.MapID)
    End If
Next

See Also

© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1