Пример #1
0
        void SetLocation()
        {
            pointTable.Clear();
            pointTable.AddRow(GetRow(location.LongitudeM, location.LatitudeM));

            GeoResponse.CResult.CGeometry.CViewPort vp = location.ViewPort;
            Envelope expand;

            if (vp.NorthEast.Lat == 0 && vp.NorthEast.Long == 0 && vp.SouthWest.Lat == 0 && vp.SouthWest.Long == 0)
            {
                expand = new Envelope(-25000000, 25000000, -17000000, 17000000);
            }
            else
            {
                expand = new Envelope(vp.NorthEast.Long, vp.SouthWest.Long, vp.NorthEast.Lat, vp.SouthWest.Lat);
            }
            Coordinate p     = new Coordinate(location.LongitudeM, location.LatitudeM);
            Envelope   point = new Envelope(p, p);

            point.ExpandBy(mapBox1.Map.PixelSize * 40);
            if (!expand.Contains(point))
            {
                mapBox1.Map.ZoomToBox(expand);
                expand.ExpandToInclude(point);
                expand.ExpandBy(mapBox1.Map.PixelSize * 40);
            }
            mapBox1.Map.ZoomToBox(expand);
            mapBox1.Refresh();
        }
Пример #2
0
        private void BuildMap()
        {
            this.Cursor = Cursors.WaitCursor;
            lifelines.Clear();
            points.Clear();
            List <IDisplayFact> displayFacts = new List <IDisplayFact>();

            foreach (DataGridViewRow row in dgIndividuals.SelectedRows)
            {
                Individual ind = row.DataBoundItem as Individual;
                if (ind.AllGeocodedFacts.Count > 0)
                {
                    displayFacts.AddRange(ind.AllGeocodedFacts);
                    MapLifeLine line = new MapLifeLine(ind);
                    line.AddFeatureDataRow(lifelines);
                    points.AddFeatureDataRows(ind);
                }
            }
            dgFacts.DataSource = new SortableBindingList <IDisplayFact>(displayFacts);
            txtCount.Text      = dgIndividuals.SelectedRows.Count + " Individual(s) selected, " + dgFacts.RowCount + " Geolocated fact(s) displayed";

            Envelope expand = mh.GetExtents(lifelines);

            mapBox1.Map.ZoomToBox(expand);
            if (mapBox1.Map.Zoom < mapBox1.Map.MaximumZoom)
            {
                expand.ExpandBy(mapBox1.Map.PixelSize * 40);
                mapBox1.Map.ZoomToBox(expand);
            }
            RefreshMap();
            mapBox1.ActiveTool = SharpMap.Forms.MapBox.Tools.Pan;
            this.Cursor        = Cursors.Default;
        }
Пример #3
0
 private void InitAttributeRows(IList <IGeometry> geometries)
 {
     AttributesTable.Clear();
     foreach (IGeometry g in geometries)
     {
         FeatureDataRow r = AttributesTable.NewRow();
         r.Geometry = g;
         AttributesTable.AddRow(r);
     }
 }
Пример #4
0
        void BuildClusteredFeatureTable()
        {
            clusteredDataTable.Clear();
            foreach (MapCluster cluster in this.clusters)
            {
                FeatureDataRow row = clusteredDataTable.NewRow();
                row.Geometry    = cluster.Geometry;
                row["Features"] = cluster.Features;
                row["Count"]    = cluster.Features.Count;
                row["Label"]    = cluster.Features.Count >= minClusterSize?cluster.Features.Count.ToString() : string.Empty;

                row["Cluster"] = cluster.ClusterType;
                clusteredDataTable.AddRow(row);
            }
        }
Пример #5
0
 public void Clear()
 {
     FactLocations.Clear();
 }
Пример #6
0
 public virtual void Clear()
 {
     geometries.Clear();
     attributesTable.Clear();
 }
Пример #7
0
 void IFeatureProvider.SetTableSchema(FeatureDataTable table)
 {
     table.Clear();
 }