Exemplo n.º 1
0
        private object RequestResponder(OperationType type, object param = null)
        {
            switch (type)
            {
            case OperationType.SentStyleGalleryItem:
                m_pStyleGalleryItem = param as IStyleGalleryItem;
                return(null);

            case OperationType.GetViewIndex:
                return(Ctrl_Tab.SelectedIndex);

            case OperationType.GetSelectedLayer:
                return(m_selectedLayer);

            case OperationType.RefreshMapCtrl:
                Ctrl_Map.Refresh();
                return(null);

            case OperationType.UpdateTOCCtrl:
                Ctrl_TOC.Update();
                return(null);

            case OperationType.ClearSelection:
                Ctrl_Map.Map.ClearSelection();
                return(null);

            case OperationType.ModifyExtent:
                Ctrl_Map.Extent = param as IEnvelope;
                return(null);

            case OperationType.GetMap:
                return(Ctrl_Map.Map);

            case OperationType.GetScene:
                return(Ctrl_Scene.Scene);

            case OperationType.ZoomToSelection:
                ICommand curCmd = new ControlsZoomToSelectedCommandClass();
                curCmd.OnCreate(Ctrl_Map.Object);
                curCmd.OnClick();
                return(null);

            case OperationType.FormAttributeHighLightRow:
                if (m_FrmAttribute != null)
                {
                    m_FrmAttribute.HightLightSelection();
                }
                return(null);

            default:
                return(null);
            }
        }
Exemplo n.º 2
0
 private void ZoomToSelectedFeatures()
 {
     try
     {
         ICommand pZoomToSelectedFeaturesCommand = new ControlsZoomToSelectedCommandClass();
         pZoomToSelectedFeaturesCommand.OnCreate(m_MapControl.Object);
         pZoomToSelectedFeaturesCommand.OnClick();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 3
0
        //buffer查询并闪烁。
        public static void BufferSelectAndFlash(IMapControl4 mapCtrl, IGeometry baseGeo, esriSpatialRelEnum spatialRef, ILayer layer)
        {
            IFeatureLayer featureLayer = layer as IFeatureLayer;

            if (mapCtrl == null || featureLayer == null)
            {
                return;
            }
            IFeatureClass  fC      = featureLayer.FeatureClass;
            ISpatialFilter pFilter = new SpatialFilterClass();

            pFilter.Geometry      = baseGeo;
            pFilter.GeometryField = "SHAPE";
            pFilter.SpatialRel    = spatialRef;
            IFeatureCursor pFeatureCursor = fC.Search(pFilter, false);

            IArray   inArray = new ArrayClass();
            IFeature fe      = pFeatureCursor.NextFeature();

            mapCtrl.Map.ClearSelection();
            while (fe != null)
            {
                inArray.Add(fe);
                mapCtrl.Map.SelectFeature(layer, fe);
                fe = pFeatureCursor.NextFeature();
            }

            if (inArray == null)
            {
                return;
            }

            HookHelper m_hookHelper = new HookHelperClass();

            m_hookHelper.Hook = mapCtrl.Object;
            IHookActions hookAction = (IHookActions)m_hookHelper;

            ICommand cmd = new ControlsZoomToSelectedCommandClass();

            cmd.OnCreate(m_hookHelper.Hook);
            cmd.OnClick();
            Application.DoEvents();
            hookAction.DoActionOnMultiple(inArray, esriHookActions.esriHookActionsFlash);
        }
Exemplo n.º 4
0
 void IGMap.ZoomToSelected()
 {
     ICommand command = new ControlsZoomToSelectedCommandClass();
     command.OnCreate(this._hook);
     command.OnClick();
 }
Exemplo n.º 5
0
 private void ZoomToSelectedFeatures()
 {
     try
     {
         ICommand pZoomToSelectedFeaturesCommand = new ControlsZoomToSelectedCommandClass();
         pZoomToSelectedFeaturesCommand.OnCreate(m_MapControl.Object);
         pZoomToSelectedFeaturesCommand.OnClick();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
 private void zoomtofeature_Click(object sender, EventArgs e)
 {
     IMap imap = axMapControl1.Map;
     ICommand pCommand = new ControlsZoomToSelectedCommandClass();
     pCommand.OnCreate(axMapControl1.Object);
     pCommand.OnClick();
 }