Пример #1
0
        /// <summary>
        /// 创建单条云图数据
        /// </summary>
        /// <param name="singleData">单条云图数据</param>
        /// <returns>创建单条数据结果对象</returns>
        public CloudDataResult CreateData(SingleDataParam singleData)
        {
            if (singleData == null)
            {
                throw new ArgumentNullException("singleData");
            }
            Dictionary <string, string> postData = singleData.GenerateParams();
            CloudDataResult             result   = WebRequestHelper.FormPostHttp <CloudDataResult>("https://yuntuapi.amap.com/datamanage/data/create",
                                                                                                   postData);

            return(result);
        }
Пример #2
0
        /// <summary>
        /// 删除单条或批量的云图数据
        /// </summary>
        /// <param name="delData">删除的云图数据</param>
        /// <returns>删除云图数据结果对象</returns>
        public DelDataResult DeleteData(DelDataParam delData)
        {
            if (delData == null)
            {
                throw new ArgumentNullException("delData");
            }
            Dictionary <string, string> postData = delData.GenerateParams();
            DelDataResult result = WebRequestHelper.FormPostHttp <DelDataResult>("https://yuntuapi.amap.com/datamanage/data/delete",
                                                                                 postData);

            return(result);
        }
Пример #3
0
        /// <summary>
        /// 创建云图表,返回原字符串
        /// </summary>
        /// <param name="name">云图表名称</param>
        /// <param name="key">高德Key</param>
        /// <param name="secret">高德密钥</param>
        /// <returns>创建云图表结果字符串</returns>
        public string CreateTableOriginal(string name, string key = null, string secret = null)
        {
            if (string.IsNullOrWhiteSpace(key))
            {
                key = GaoDeConfig.AppKey;
            }
            if (string.IsNullOrWhiteSpace(secret))
            {
                secret = GaoDeConfig.SignSecret;
            }
            string queryString = QueryHelper.QueryStringSort("key=" + key + "&name=" + name);
            string result      = WebRequestHelper.FormPostHttp("https://yuntuapi.amap.com/datamanage/table/create", new Dictionary <string, string>
            {
                { "key", key },
                { "name", name },
                { "sig", EncryptHelper.HashMD5(queryString + secret) }
            });

            return(result);
        }