Exemplo n.º 1
0
            public override bool OnPointCreated(NMapPointLabel pointLabel, NMapFeature mapFeature)
            {
                if (mapFeature.GetAttributeValue("CAPITAL").Equals("Y"))
                {
                    pointLabel.ShapeType       = PointShape.Custom;
                    pointLabel.CustomShapeName = "Star";
                }

                return(true);
            }
Exemplo n.º 2
0
            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));
            }
Exemplo n.º 3
0
            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);
            }
Exemplo n.º 4
0
            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);
            }
Exemplo n.º 5
0
            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);
            }
Exemplo n.º 6
0
            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);
            }
Exemplo n.º 7
0
 public override bool OnMultiPolygonCreated(NDiagramElement element, NMapFeature mapFeature)
 {
     return(OnPolygonCreated(element, mapFeature));
 }
Exemplo n.º 8
0
            public override bool OnPolygonLabelCreated(NMapPolygonLabel polygonLabel, NMapFeature mapFeature)
            {
                NStyleableElement master = (NStyleableElement)polygonLabel.MasterElement;
                Color             color  = master.ComposeFillStyle().GetPrimaryColor().ToColor();

                if (color.R < 128)
                {
                    // Make the text of dark shape labels white
                    polygonLabel.StyleSheetName = WhiteTextStyleSheetName;
                }

                return(true);
            }