public void RemoveLayer(int i) { if (i < 0 || i >= this.GetLayerCount()) { return; } this.LayerSet.RemoveAt(i); // calculate extent dynamic(except i layer) this.MapExtent = new MG_MapExtent();// Empty extent for (int j = 0; j < this.GetLayerCount(); j++) { if (j != i) { if (this.MapExtent.Empty()) { this.MapExtent = this.LayerSet.GetAt(j).Extent; } else { this.MapExtent = calculateExtent(this.MapExtent, this.LayerSet.GetAt(j).Extent); } } } }
public void InitMapView(Rectangle rect, MG_MapExtent me) {// layerCount>0 => MapExtent!=Empty => MapView!=null if (!this.MapExtent.Empty()) { this.MapView = new MG_MapView(rect, me); } }
public MG_MapView(Rectangle rect, MG_MapExtent me) { this.Scale = 1.0; this.CurrentWindow = rect; this.CurrentExtent = me; this.Calculate(); }
public MG_MapExtent(MG_MapExtent ext) { this.MinX = ext.MinX; this.MinY = ext.MinY; this.MaxX = ext.MaxX; this.MaxY = ext.MaxY; }
private MG_MapExtent calculateExtent(MG_MapExtent e1, MG_MapExtent e2) { MG_MapExtent ext = new MG_MapExtent(); ext.MinX = min(e1.MinX, e2.MinX); ext.MinY = min(e1.MinY, e2.MinY); ext.MaxX = max(e1.MaxX, e2.MaxX); ext.MaxY = max(e1.MaxY, e2.MaxY); return(ext); }
public MG_Map() { mapCount++; this.MapName = "Map_" + mapCount.ToString(); this.MapPath = null; this.MapExtent = new MG_MapExtent(); this.LayerSet = new MG_LayerSet(); this.ZoomHistory = new MG_ZoomHistory(); this.CurrentZoomIndex = -1; this.MapView = null; }
public MG_GeometryType Type; // default NONE public MG_Layer() { layerCount++; this.LayerName = "Layer_" + layerCount.ToString(); this.LayerPath = null; this.IsVisible = true; this.FeatureSet = new MG_FeatureSet(); this.FieldSet = new MG_FieldSet(this.LayerName); this.Extent = new MG_MapExtent(); this.Type = MG_GeometryType.NONE; }
public void AddLayer(MG_Layer layer) { this.LayerSet.Add(layer); // calculate extent dynamic if (this.MapExtent.Empty()) { this.MapExtent = layer.Extent; } else { this.MapExtent = calculateExtent(this.MapExtent, layer.Extent); } }
public void SetMapExtent(MG_MapExtent mapExtent) {// zoom to layer : mapextent = layerextent this.MapExtent = mapExtent; }
public void Update(Rectangle rect, MG_MapExtent me) {// FullExtent ZoomToLayer this.CurrentWindow = rect; this.CurrentExtent = me; this.Calculate(); }