ESRI.ArcGIS.ADF.IMS
Union(Envelope,Envelope) Method
See Also  Example
ESRI.ArcGIS.ADF.IMS.Geometry Namespace > Envelope Class > Union Method : Union(Envelope,Envelope) Method




env1
env2
Static method that constructs an envelope that surrounds the extents of the input envelopes.

Syntax

Visual Basic (Declaration) 
Public Overloads Shared Function Union( _
   ByVal env1 As Envelope, _
   ByVal env2 As Envelope _
) As Envelope
Visual Basic (Usage)Copy Code
Dim env1 As Envelope
Dim env2 As Envelope
Dim value As Envelope
 
value = Envelope.Union(env1, env2)
C# 
public static Envelope Union( 
   Envelope env1,
   Envelope env2
)

Parameters

env1
env2

Return Value

Envelope that surrounds the two input envelopes.

Example

The following example unions the current map extent with a newly created envelope, and sets the map extent to the new envelope. The code assumes an existing MapView object.
C#Copy Code
ESRI.ArcGIS.ADF.IMS.Geometry.Envelope mapEnvelope = mapView.Extent; 

  

ESRI.ArcGIS.ADF.IMS.Geometry.Envelope envelope2 = new ESRI.ArcGIS.ADF.IMS.Geometry.Envelope(23, -26, 27, -18); 

  

ESRI.ArcGIS.ADF.IMS.Geometry.Envelope unionEnvelope = ESRI.ArcGIS.ADF.IMS.Geometry.Envelope.Union(mapEnvelope, envelope2); 

  

mapView.Extent = unionEnvelope; 

    
Visual BasicCopy Code
Dim mapEnvelope As ESRI.ArcGIS.ADF.IMS.Geometry.Envelope _

    = mapView.Extent



Dim envelope2 As New _

    ESRI.ArcGIS.ADF.IMS.Geometry.Envelope(23, -26, 27, -18)



Dim unionEnvelope As ESRI.ArcGIS.ADF.IMS.Geometry.Envelope _

    = ESRI.ArcGIS.ADF.IMS.Geometry.Envelope.Union(mapEnvelope, envelope2)



mapView.Extent = unionEnvelope

Remarks

This method constructs an envelope that surrounds the two input envelopes. The input envelopes do not need to overlap.

This is a static method, and therefore is used without first constructing an instance of Envelope.

See Also

© 2010 All Rights Reserved.