public void AddObject(Region path, string layer, ToolTipInfo toolTipInfo, System.Drawing.Graphics g) { lock (m_QuadTree) { RectangleF rf = path.GetBounds(g); Envelope env = new Envelope(rf.Left, rf.Right, rf.Bottom, rf.Top); m_QuadTree.Insert(env, new QuickInfoObject(path, layer, toolTipInfo, env)); } }
public void AddToolTipInfo(ToolTipInfo info) { if (info.Id != null && _Ids.ContainsKey(info.Id)) return; if (info.Id != null) _Ids[info.Id] = info.Id; ToolTips.Add(info); }
public QuickInfoObject(Region path, string layer, ToolTipInfo toolTipInfo, Envelope envelope) { m_Path = path; m_Layer = layer; m_ToolTipInfo = toolTipInfo; m_Envelope = envelope; }
private void RenderGeometry(System.Drawing.Graphics g, SharpMap.Map map, Geometry feature, SharpMap.Styles.VectorStyle style) { System.Drawing.Region gp = null; switch (feature.GetType().FullName) { case "SharpMap.Geometries.Polygon": if (style.EnableOutline) SharpMap.Rendering.VectorRenderer.DrawPolygon(g, (Polygon)feature, style.Fill, style.Outline, _ClippingEnabled, map); else SharpMap.Rendering.VectorRenderer.DrawPolygon(g, (Polygon)feature, style.Fill, null, _ClippingEnabled, map); break; case "SharpMap.Geometries.MultiPolygon": if (style.EnableOutline) SharpMap.Rendering.VectorRenderer.DrawMultiPolygon(g, (MultiPolygon)feature, style.Fill, style.Outline, _ClippingEnabled, map); else SharpMap.Rendering.VectorRenderer.DrawMultiPolygon(g, (MultiPolygon)feature, style.Fill, null, _ClippingEnabled, map); break; case "SharpMap.Geometries.LineString": gp = InteractiveRenderer.DrawLineString(g, (LineString)feature, style.Line, map); break; case "SharpMap.Geometries.MultiLineString": SharpMap.Rendering.VectorRenderer.DrawMultiLineString(g, (MultiLineString)feature, style.Line, map); break; case "SharpMap.Geometries.Point": gp = InteractiveRenderer.DrawPoint(g, (Point)feature, style.Symbol, style.SymbolScale, style.SymbolOffset, style.SymbolRotation, map); break; case "SharpMap.Geometries.MultiPoint": SharpMap.Rendering.VectorRenderer.DrawMultiPoint(g, (MultiPoint)feature, style.Symbol, style.SymbolScale, style.SymbolOffset, style.SymbolRotation, map); break; case "SharpMap.Geometries.GeometryCollection": foreach(SharpMap.Geometries.Geometry geom in (GeometryCollection)feature) RenderGeometry(g, map, geom, style); break; default: break; } if (gp != null && map is InteractiveMap && style is InteractiveStyle) { InteractiveMap imap = map as InteractiveMap; InteractiveStyle istyle = style as InteractiveStyle; ToolTipInfo info = new ToolTipInfo(); info.Bitmap = istyle.Symbol; info.Description = istyle.PopUpText; info.Id = istyle.PopUpId; string layerName = istyle.PopUpCategory; if (string.IsNullOrEmpty(istyle.PopUpCategory)) layerName = LayerName; imap.AddObject(gp, layerName, info, g); } }