示例#1
0
        public static bool DeleteLayer(string url, MangoLayer layer)
        {
            Dictionary <string, string> param = new Dictionary <string, string>();

            param["id"] = layer.id.ToString();

            string content = Post(url, param);

            Console.WriteLine(content);
            ApiResult result = JsonConvert.DeserializeObject <ApiResult>(content);

            return(result.success);
        }
示例#2
0
        public static bool UpdateMapLayers(string url, MangoLayer layer)
        {
            var param = new Dictionary <string, string> {
                { "id", layer.id.ToString() },
                { "name", layer.name },
                { "mapId", layer.mapId.ToString() },
                { "color", layer.color },
                { "labelEnabled", layer.labelEnabled.ToString() },
                { "labelColor", layer.labelColor },
                { "labelFont", layer.labelFont },
                { "labelFontSize", layer.labelFontSize.ToString() },
                { "filenamePrefix", layer.filenamePrefix },
                { "renderMode", layer.renderMode.ToString() },
                { "textureFilename", layer.textureFilename },
                { "type", layer.type.ToString() },
            };
            string content = Post(url, param);

            Console.WriteLine(content);

            return(true);
        }
示例#3
0
        public static bool InsertMapLayers(string url, MangoLayer layer)
        {
            var param = new Dictionary <string, string> {
                { "name", layer.name },
                { "mapId", layer.mapId.ToString() },
                { "color", layer.color },
                { "labelEnabled", layer.labelEnabled.ToString() },
                { "labelColor", layer.labelColor },
                { "labelFont", layer.labelFont },
                { "labelFontSize", layer.labelFontSize.ToString() },
                { "filenamePrefix", layer.filenamePrefix },
                { "renderMode", layer.renderMode.ToString() },
                { "textureFilename", layer.textureFilename },
                { "type", layer.type.ToString() },
            };
            string    content = Post(url, param);
            ApiResult result  = JsonConvert.DeserializeObject <ApiResult>(content);

            if (result.success)
            {
                layer.id = int.Parse(result.msg);
            }
            return(result.success);
        }