${iServerJava6R_ServerType_ServerStyle_Tile}

${iServerJava6R_ServerType_ServerStyle_Description}

        void service_ProcessCompleted(object sender, GenerateSpatialDataArgs e)
        {
            ThemeUniqueItem item1 = new ThemeUniqueItem();
            ServerStyle style1 = new ServerStyle();
            style1.FillForeColor = Color.FromArgb(255, 242, 48, 48);
            style1.LineColor = Color.FromArgb(255, 242, 48, 48);
            item1.Unique = "拥堵";
            item1.Style = style1;

            ThemeUniqueItem item2 = new ThemeUniqueItem();
            ServerStyle style2 = new ServerStyle();
            style2.FillForeColor = Color.FromArgb(255, 255, 159, 25);
            style2.LineColor = Color.FromArgb(255, 255, 159, 25);
            item2.Unique = "缓行";
            item2.Style = style2;

            ThemeUniqueItem item3 = new ThemeUniqueItem();
            ServerStyle style3 = new ServerStyle();
            style3.FillForeColor = Color.FromArgb(255, 91, 195, 69);
            style3.LineColor = Color.FromArgb(255, 91, 195, 69);
            item3.Unique = "畅通";
            item3.Style = style3;

            ThemeUnique themeUnique = new ThemeUnique();
            themeUnique.UniqueExpression = "TrafficStatus";
            themeUnique.Items = new List<ThemeUniqueItem>() { item1,item2,item3};

            ThemeParameters param = new ThemeParameters();
            param.DatasetName = "generateSpatialData";
            param.DataSourceName = "Changchun";
            param.Themes=new List<Theme>(){themeUnique};

            ThemeService themeService = new ThemeService(_mapUrl);
            themeService.ProcessCompleted += new EventHandler<ThemeEventArgs>(themeService_ProcessCompleted);
            themeService.ProcessAsync(param);
        }
コード例 #2
0
        internal static string ToJson(ServerStyle result)
        {
            if (result == null)
            {
                return null;
            }

            string json = "{";
            List<string> list = new List<string>();

            list.Add(string.Format(CultureInfo.InvariantCulture, "\"fillBackOpaque\":{0}", result.FillBackOpaque.ToString().ToLower()));
            list.Add(string.Format(CultureInfo.InvariantCulture, "\"lineWidth\":{0}", result.LineWidth.ToString(CultureInfo.InvariantCulture)));
            list.Add(string.Format(CultureInfo.InvariantCulture, "\"fillBackColor\":{0}", ServerColor.ToJson(result.FillBackColor.ToServerColor())));
            list.Add(string.Format(CultureInfo.InvariantCulture, "\"fillForeColor\":{0}", ServerColor.ToJson(result.FillForeColor.ToServerColor())));
            list.Add(string.Format(CultureInfo.InvariantCulture, "\"markerAngle\":{0}", result.MarkerAngle.ToString(CultureInfo.InvariantCulture)));
            list.Add(string.Format(CultureInfo.InvariantCulture, "\"markerSize\":{0}", result.MarkerSize.ToString(CultureInfo.InvariantCulture)));
            list.Add(string.Format(CultureInfo.InvariantCulture, "\"fillGradientOffsetRatioX\":{0}", result.FillGradientOffsetRatioX.ToString(CultureInfo.InvariantCulture)));
            list.Add(string.Format(CultureInfo.InvariantCulture, "\"fillGradientOffsetRatioY\":{0}", result.FillGradientOffsetRatioY.ToString(CultureInfo.InvariantCulture)));
            list.Add(string.Format(CultureInfo.InvariantCulture, "\"lineColor\":{0}", ServerColor.ToJson(result.LineColor.ToServerColor())));
            list.Add(string.Format(CultureInfo.InvariantCulture, "\"fillOpaqueRate\":{0}", result.FillOpaqueRate));
            list.Add(string.Format(CultureInfo.InvariantCulture, "\"fillGradientMode\":\"{0}\"", result.FillGradientMode));
            list.Add(string.Format(CultureInfo.InvariantCulture, "\"fillSymbolID\":{0}", result.FillSymbolID));
            list.Add(string.Format(CultureInfo.InvariantCulture, "\"fillGradientAngle\":{0}", result.FillGradientAngle.ToString(CultureInfo.InvariantCulture)));
            list.Add(string.Format(CultureInfo.InvariantCulture, "\"markerSymbolID\":{0}", result.MarkerSymbolID));
            list.Add(string.Format(CultureInfo.InvariantCulture, "\"lineSymbolID\":{0}", result.LineSymbolID));

            json += string.Join(",", list.ToArray());
            json += "}";
            return json;
        }
コード例 #3
0
 /// <summary>${iServerJava6R_ThemeDotDensity_constructor_D}</summary>
 public ThemeDotDensity()
 {
     Style = new ServerStyle { MarkerSize = 2 };
     Type = ThemeType.DOTDENSITY;
 }
コード例 #4
0
 /// <summary>${iServer6_SetLayerStyleParameters_constructor_D}</summary>
 public SetLayerStyleParameters()
 {
     Style = new ServerStyle();
     HoldTime = 10;
 }