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); }
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); }
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); }