public override bool OnPointCreated(NMapPointLabel pointLabel, NMapFeature mapFeature) { string name = mapFeature.GetAttributeValue("NAME").ToString(); Cities.Add(new NCityInfo(name, pointLabel.PinPoint)); if (mapFeature.GetAttributeValue("CAPITAL").Equals("Y")) { pointLabel.ShapeType = PointShape.Custom; pointLabel.CustomShapeName = "Star"; } return(true); }
public override bool OnPolygonCreated(NDiagramElement element, NMapFeature mapFeature) { NShape shape = element as NShape; if (shape == null) { return(true); } string name = mapFeature.GetAttributeValue("CNTRY_NAME").ToString(); decimal sales = (decimal)mapFeature.GetAttributeValue("Sales"); NInteractivityStyle interactivityStyle = new NInteractivityStyle(String.Format("Sales value in {0}: {1:N0} million dollars", name, sales)); shape.Style.InteractivityStyle = interactivityStyle; return(true); }
public override bool OnPointCreated(NMapPointLabel pointLabel, NMapFeature mapFeature) { if (mapFeature.GetAttributeValue("CAPITAL").Equals("Y")) { pointLabel.ShapeType = PointShape.Custom; pointLabel.CustomShapeName = "Star"; } return(true); }
public override bool OnPolygonCreated(NDiagramElement element, NMapFeature mapFeature) { NShape shape = element as NShape; if (shape == null) { return(true); } string name = mapFeature.GetAttributeValue("CNTRY_NAME").ToString(); int population = Int32.Parse(mapFeature.GetAttributeValue("POP_CNTRY").ToString()); NInteractivityStyle interactivityStyle = new NInteractivityStyle(String.Format("{0}'{1} population: {2:N0}", name, name.EndsWith("s") ? String.Empty : "s", population)); NStyle.SetInteractivityStyle(shape, interactivityStyle); return(true); }
public override bool OnPolygonCreated(NDiagramElement element, NMapFeature mapFeature) { NShape shape = element as NShape; if (shape != null) { NInteractivityStyle iStyle = new NInteractivityStyle(true, null, mapFeature.GetAttributeValue(m_sTooltipColumnName).ToString()); NStyle.SetInteractivityStyle(shape, iStyle); } return(base.OnPolygonCreated(element, mapFeature)); }
public override bool OnPolygonCreated(NDiagramElement element, NMapFeature mapFeature) { NShape shape = element as NShape; if (shape == null) { return(true); } string name = mapFeature.GetAttributeValue("CNTRY_NAME").ToString(); float population = Single.Parse(mapFeature.GetAttributeValue("POP_CNTRY").ToString()); float landArea = Single.Parse(mapFeature.GetAttributeValue("SQKM").ToString()); // add a tooltip to the shape NInteractivityStyle interactivityStyle = new NInteractivityStyle( string.Format("{1}{0}======================{0}Land Area: {2:N} km2{0}Population: {3:N0} people{0}Pop. Density: {4:N} people/km2", Environment.NewLine, name, landArea, population, population / landArea)); shape.Style.InteractivityStyle = interactivityStyle; return(true); }