Exemplo n.º 1
0
 private void LoadFindTextAutoCompleteData(EGIS.ShapeFileLib.ShapeFile shapeFile, bool clearExisting)
 {
     if(clearExisting) this.tsTxtFind.AutoCompleteCustomSource.Clear();
     if (shapeFile == null || shapeFile.RenderSettings == null) return;
     if (shapeFile.RenderSettings.FieldIndex >= 0 && shapeFile.RenderSettings.IsSelectable)
     {
         string[] records = shapeFile.GetRecords(shapeFile.RenderSettings.FieldIndex);
         this.tsTxtFind.AutoCompleteCustomSource.AddRange(records);
     }
 }
Exemplo n.º 2
0
 private void sfMap1_TooltipDisplayed(object sender, EGIS.Controls.SFMap.TooltipEventArgs e)
 {
     if (e.ShapeFileIndex >= 0 && e.RecordIndex >= 0)
     {
         if(recordAttributesForm.Visible)
         {
             string[] names = sfMap1[e.ShapeFileIndex].GetAttributeFieldNames();
             string[] values = sfMap1[e.ShapeFileIndex].GetAttributeFieldValues(e.RecordIndex);
             recordAttributesForm.SetRecordData(e.ShapeFileIndex, sfMap1[e.ShapeFileIndex].Name,e.RecordIndex,names, values); 
         }
         //PointD ptd = sfMap1.PixelCoordToGisPoint(e.MousePosition);
         //int recIndex = sfMap1[e.ShapeFileIndex].GetShapeIndexContainingPoint(new PointF((float)ptd.X, (float)ptd.Y), 0.00001F);
         //Console.Out.WriteLine("rec: " + recIndex);
     }
     else
     {
         recordAttributesForm.SetRecordData(-1, "", -1, null, null);
     }
 }
Exemplo n.º 3
0
 private void LoadFindTextAutoCompleteData(EGIS.ShapeFileLib.ShapeFile shapeFile)
 {
     LoadFindTextAutoCompleteData(shapeFile, true);
 }
Exemplo n.º 4
0
        protected static void LoadOptimalRenderSettings(EGIS.ShapeFileLib.ShapeFile sf)
        {
            RectangleF r = sf.Extent;
            if (r.Top > 90 || r.Bottom < -90)
            {
                //assume UTM
                sf.RenderSettings.PenWidthScale = 15;
            }
            else
            {
                PointF pt = new PointF(r.Left + r.Width/2, r.Top + r.Height/2);
                EGIS.ShapeFileLib.UtmCoordinate utm1 = EGIS.ShapeFileLib.ConversionFunctions.LLToUtm(EGIS.ShapeFileLib.ConversionFunctions.RefEllipse, pt.Y, pt.X);
                EGIS.ShapeFileLib.UtmCoordinate utm2 = utm1;
                utm2.Northing += 15;
                EGIS.ShapeFileLib.LatLongCoordinate ll = EGIS.ShapeFileLib.ConversionFunctions.UtmToLL(EGIS.ShapeFileLib.ConversionFunctions.RefEllipse, utm2);
                sf.RenderSettings.PenWidthScale = (float)Math.Abs(ll.Latitude - pt.Y);

            }
        }
Exemplo n.º 5
0
 /// <summary>
 /// Moves the spcified ShapeFile "down" in the ShapeFile layers
 /// </summary>
 /// <param name="shapeFile"></param>
 /// <remarks>
 /// When ShapeFiles are added to the map the order that they are added determines the order that
 /// they will be rendered. This means that the first ShapeFile layer that is rendered may potentially 
 /// be covered or patially covered by subsequent shapefiles.
 /// By calling the MoveShapeFileUp and MoveShapeFileDown methods you can control the order that the 
 /// ShapeFile layers will be rendered.
 /// </remarks>
 /// <seealso cref="MoveShapeFileUp"/>
 public void MoveShapeFileDown(EGIS.ShapeFileLib.ShapeFile shapeFile)
 {
     int index = myShapefiles.IndexOf(shapeFile);
     if (index == myShapefiles.Count-1) return;
     myShapefiles.RemoveAt(index);
     myShapefiles.Insert(index + 1, shapeFile);
     dirtyScreenBuf = true;
     Invalidate();
     OnShapeFilesChanged();
 }
Exemplo n.º 6
0
 /// <summary>
 /// Removes the specifed ShapeFile from the SFMap control
 /// </summary>
 /// <param name="shapeFile"></param>
 public void RemoveShapeFile(EGIS.ShapeFileLib.ShapeFile shapeFile)
 {            
     if(myShapefiles.Remove(shapeFile))
     {
         OnShapeFilesChanged();
         dirtyScreenBuf = true;
         Invalidate();
     }
 }
Exemplo n.º 7
0
 /// <summary>
 /// Applies custom render settings to the specified layer
 /// </summary>
 /// <remarks>
 /// <para>
 /// The ICustomRenderSettings object is stored in the session settings, meaning that the custom render settings are 
 /// applied per user's session.
 /// </para>
 /// <para>If Custom Render Settings are used then it is usualy neccessary to set CacheOnClient to False
 /// </para>
 /// 
 /// </remarks>
 /// <param name="layerIndex">The zero-based index of the layer to apply the custom render settings</param>
 /// <param name="settings">An ICustomRenderSettings object to set on the specified shapefile</param>        
 /// <seealso cref="EGIS.ShapeFileLib.ICustomRenderSettings"/>
 /// <seealso cref="EGIS.Web.Controls.QuantileCustomRenderSettings"/>
 /// <seealso cref="CacheOnClient"/>
 public void SetCustomRenderSettings(int layerIndex, EGIS.ShapeFileLib.ICustomRenderSettings settings)
 {
     if (customRenderSettingsList == null)
     {
         customRenderSettingsList = new List<SessionCustomRenderSettingsEntry>();
     }
     customRenderSettingsList.Add(new SessionCustomRenderSettingsEntry(layerIndex, settings));
 }
Exemplo n.º 8
0
 public SessionCustomRenderSettingsEntry(int layerIndex, EGIS.ShapeFileLib.ICustomRenderSettings renderSettings)
 {
     LayerIndex = layerIndex;
     CustomRenderSettings = renderSettings;
 }