AGI STK Esri Display 11 Send comments on this topic.
StartMapEditing Method (IAgEsri3dRenderer)
See Also  Example
Option





Description

Call before starting to modify the map document.

Syntax

[Visual Basic .NET]
Public Function StartMapEditing( _
   ByVal Option As AgESTKesriCallOptions _
) As Boolean

[C#]
public bool StartMapEditing(
AgESTKesriCallOptions Option
);

[Managed C++]
public: bool StartMapEditing(
AgESTKesriCallOptions Option
);

[Java]
public bool startMapEditing(
AgESTKesriCallOptions Option
);

[Unmanaged C++]
public: HRESULT StartMapEditing(
AgESTKesriCallOptions Option,
VARIANT_BOOL * ReturnValue
);

Parameters

Option
Member Value Description
eEsri3dBlocking 1 The call to the method will block until the map is closed. Use for in-process calls.
eEsri3dNonBlocking 2 The call to the method will not block. Use for out-of-process calls. Loop until the call succeeds.

Return Type

Returns true if map can now be edited.

Remarks

You must call this method before making changes to the map document currently opened in the renderer. This puts the GIS thread on hold, making sure that the map document information is not being accessed by 2 threads at the same time.

When StopMapEditing is called, the renderer re-generates its caches, ensuring that the latest map information is being used.

How to call this function depends on how the library is being used:

  • If the library is being used embedded in a custom application, call the method passing the eEsri3dBlocking option. The function call will then block until the map document is ready to be edited, and then return.
  • If the library is being used to automate STK and is called from another process, it is recommended to use the eEsri3dNonBlocking option. The function will then return immediately, and must be called in a loop until it returns true.

Example

In process map modification.
[C#] Copy Code
// Popup AddDataCommand 
ICommand addDataCommand = new ESRI.ArcGIS.Controls.ControlsAddDataCommand(); 
AddDataCommandHook hook = new AddDataCommandHook(m_AxAgUiAxVOCntrl.Handle); 
addDataCommand.OnCreate(hook as object); 
addDataCommand.OnClick(); 
 
// Get the new map from the hook and load it into the GIS thread 
object obj = m_Renderer.Context.SaveObject(hook.MapDocument.ActiveView.FocusMap); 
IMap newMap = m_Renderer.Context.LoadObject(obj) as IMap; 
 
// Begin Map Editing Session 
m_Renderer.StartMapEditing(AgESTKesriCallOptions.eEsri3dBlocking); 
 
// Add new layers to current map 
IMap map = m_Renderer.MapDocument.ActiveView.FocusMap; 
map.AddLayers(newMap.get_Layers(nullfalse), false); 
 
// End Map Editing Session 
m_Renderer.StopMapEditing(false); 

See Also

© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1