Simultaneous flashing of multiple feature codes (Arcengine)

Source: Internet
Author: User

<summary>
Constructs based on query criteria
</summary>
<param name= "where" > Query conditions </param>
public void Filterlayer (string where)
{
Ifeaturelayer Flyr = (ifeaturelayer) axmapcontrol1.get_layer (0);
Ifeatureclass fcls = Flyr. Featureclass;

Iqueryfilter queryfilter = new Queryfilterclass ();
Queryfilter.whereclause = where;

Zoom to select result set and Highlight
Zoomtoselectedfeature (Flyr, queryfilter);

Flashing the selected map spot
Ifeaturecursor featurecursor = fcls. Search (QueryFilter, true);
Flashpolygons (Featurecursor);
}

<summary>
Zoom to select result set and Highlight
</summary>
<param name= "Pfeaturelyr" ></param>
<param name= "Pqueryfilter" ></param>
private void Zoomtoselectedfeature (Ifeaturelayer pfeaturelyr, Iqueryfilter pqueryfilter)
{
#region highlight the query to a feature collection

Symbol Edge Color
Irgbcolor Plinecolor = new RgbColor ();
plinecolor.red = 255;
Ilinesymbol ILSYMBL = new Simplelinesymbolclass ();
Ilsymbl.color = Plinecolor;
Ilsymbl.width = 5;

Define the symbol for the selected feature to be red
Isimplefillsymbol Ipsimplefillsymbol = new Simplefillsymbol ();
Ipsimplefillsymbol.outline = ILSYMBL;
RgbColor Pfillcolor = new RgbColor ();
Pfillcolor.green = 60;
Ipsimplefillsymbol.color = Pfillcolor;
Ipsimplefillsymbol.style = esrisimplefillstyle.esrisfsforwarddiagonal;

Select a feature set
Ifeatureselection pftselection = Pfeaturelyr as ifeatureselection;
Pftselection.setselectionsymbol = true;
Pftselection.selectionsymbol = (isymbol) Ipsimplefillsymbol;
Pftselection.selectfeatures (Pqueryfilter, esriselectionresultenum.esriselectionresultnew, false);

#endregion

Iselectionset pselectionset = Pftselection.selectionset;
Center Display selected features
Ienumgeometry Penumgeom = new Enumfeaturegeometry ();
Ienumgeometrybind penumgeombind = Penumgeom as Ienumgeometrybind;
Penumgeombind.bindgeometrysource (null, pselectionset);
Igeometryfactory pgeomfactory = new Geometryenvironmentclass ();
Igeometry Pgeom = Pgeomfactory.creategeometryfromenumerator (PENUMGEOM);

AxMapControl1.ActiveView.Extent = Pgeom.envelope;
AxMapControl1.ActiveView.Refresh ();
}

<summary>
Flashing the selected map spot
</summary>
<param name= "Featurecursor" ></param>
private void Flashpolygons (Ifeaturecursor featurecursor)
{
IArray Geoarray = new Arrayclass ();
IFeature feature = null;
while ((feature = Featurecursor.nextfeature ()) = null)
{
feature is a circular outer pointer, so you must use Shapecopy
Geoarray.add (feature. Shapecopy);
}

Flashing feature collection by ihookactions
Hookhelperclass m_phookhelper = new Hookhelperclass ();
M_phookhelper.hook = Axmapcontrol1.object;
Ihookactions hookactions = (ihookactions) m_phookhelper;

Hookactions.doactiononmultiple (Geoarray, Esrihookactions.esrihookactionspan);
Hookactions.doactiononmultiple (Geoarray, esrihookactions.esrihookactionsgraphic);
Hookactions.doactiononmultiple (Geoarray, esrihookactions.esrihookactionszoom);
Application.doevents ();
M_pHookHelper.ActiveView.ScreenDisplay.UpdateWindow ();

Hookactions.doactiononmultiple (Geoarray, Esrihookactions.esrihookactionsflash);
}
}

From:http://www.cnblogs.com/feilong3540717/archive/2011/07/27/2118651.html

Simultaneous flashing of multiple feature codes (Arcengine)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.