Example #1
0
        public Panel OptionPage(IMapDocument document)
        {
            _doc = document;

            if (!IsAvailable(document))
            {
                return(null);
            }

            IGUIApplication app      = document.Application as IGUIApplication;
            Identify        identify = ToolIdentify;

            if (identify == null)
            {
                return(null);
            }

            _dlg = new OptionPageIdentify(_doc, identify);
            return(_dlg.OptionPanel);
        }
Example #2
0
        internal void LoadGeometry(IMap map, ISnapSchema schema, IEnvelope envelope)
        {
            _snapGeometries.Clear();

            IGUIApplication guiApp = (_doc != null) ? _doc.Application as IGUIApplication : null;

            if (map == null || schema == null || envelope == null ||
                map.Display == null || map.Display.mapScale >= schema.MaxScale)
            {
                return;
            }

            foreach (ISnapLayer sLayer in schema)
            {
                if (sLayer == null || sLayer.FeatureLayer == null ||
                    sLayer.FeatureLayer.FeatureClass == null ||
                    _doc == null || _doc.FocusMap == null || _doc.FocusMap.Display == null)
                {
                    continue;
                }

                if (sLayer.FeatureLayer.MinimumScale >= 1 && sLayer.FeatureLayer.MinimumScale > _doc.FocusMap.Display.mapScale)
                {
                    continue;
                }
                if (sLayer.FeatureLayer.MaximumScale >= 1 && sLayer.FeatureLayer.MaximumScale < _doc.FocusMap.Display.mapScale)
                {
                    continue;
                }

                SpatialFilter filter = new SpatialFilter();
                filter.FeatureSpatialReference = map.Display.SpatialReference;
                filter.FilterSpatialReference  = map.Display.SpatialReference;
                filter.Geometry        = envelope;
                filter.SpatialRelation = spatialRelation.SpatialRelationIntersects;
                filter.AddField(sLayer.FeatureLayer.FeatureClass.ShapeFieldName);

                if (guiApp != null)
                {
                    guiApp.StatusBar.Text = "Query Snaplayer: " + sLayer.FeatureLayer.Title;
                    guiApp.StatusBar.Refresh();
                }

                List <IGeometry> geometries = new List <IGeometry>();
                using (IFeatureCursor cursor = sLayer.FeatureLayer.FeatureClass.GetFeatures(filter))
                {
                    IFeature feature;
                    while ((feature = cursor.NextFeature) != null)
                    {
                        if (feature.Shape != null)
                        {
                            geometries.Add(feature.Shape);
                        }
                    }
                }
                _snapGeometries.Add(sLayer, geometries);
            }
            if (guiApp != null)
            {
                guiApp.StatusBar.Text = null;
                guiApp.StatusBar.Refresh();
            }
        }
Example #3
0
 public ToolbarPersist(IGUIApplication app)
 {
     _app = app;
 }
Example #4
0
 public ToolbarsPersist(IGUIApplication application)
 {
     _application = application;
 }
 public ExplorerMapApplication(IGUIApplication application, PreviewControl control, object mapView)
     : this(application, control)
 {
     //_mapView = mapView;
 }
 public ExplorerMapApplication(IGUIApplication application, PreviewControl control)
 {
     _application = application;
     _control     = control;
 }