Constructor
new CommonTools()
Methods
(static) fetchJson()
fetch json Get请求封装
Returns:
Promise
(static) fetchJsonPost()
fetch json Post请求封装
Returns:
Promise
(static) getUrlSuffix(url)
获得url中文件的后缀,譬如'Arch Link Model/bim.bin',返回'.bin',返回的都是小写字母
Parameters:
Name | Type | Description |
---|---|---|
url |
* |
(static) isEmptyObject(object)
判断对象是否是{}无属性的空对象
Parameters:
Name | Type | Description |
---|---|---|
object |
* |
(static) mergeArray(a1, a2)
合并数组 ,Array.prototype.push.apply有长度限制.Array.concat性能低下,还是for靠谱
Parameters:
Name | Type | Description |
---|---|---|
a1 |
* | 主数组 |
a2 |
* | 被合并数组 |
(static) mousecaptureToGeoJosn(url)
bimi-map-mousecapture.json 鼠标捕捉经纬度坐标文件转为等值线边界的geojson数据
Parameters:
Name | Type | Description |
---|---|---|
url |
* |
Returns:
Promise
(static) randomInt(max, min)
产生范围内随机整数
Parameters:
Name | Type | Description |
---|---|---|
max |
* | |
min |
* |
Returns:
Number
(static) readGZip(zip, callback)
gz转json对象
Parameters:
Name | Type | Description |
---|---|---|
zip |
* | |
callback |
* |
(static) removeArrayDuplicates(array)
去除Array中的重复元素
Parameters:
Name | Type | Description |
---|---|---|
array |
* |
(static) removeItemFromArray(array, item)
从Array中删除一个指定的元素
Parameters:
Name | Type | Description |
---|---|---|
array |
* | |
item |
* |
(static) subUrl(url)
截取掉http url最后一个分段
Parameters:
Name | Type | Description |
---|---|---|
url |
* |