Skip to content

Commit 9af9517

Browse files
author
潘卓然ParnDeedlit
committed
Merge branch 'dev' of github.com:MapGIS/WebClient-JavaScript into dev
2 parents ac0a645 + fd7644a commit 9af9517

File tree

5 files changed

+66
-13
lines changed

5 files changed

+66
-13
lines changed

src/openlayers/layer/tileMapLayer.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,19 +215,19 @@ Zondy.Source.TileLayerSource = TileLayerSource;
215215
* @param {String} [opt_options.ip = ''] 服务器ip地址,本地为“127.0.0.1”或“localhost”。
216216
* @param {String} [opt_options.port = ''] 服务器端口号,默认为6163
217217
* @param {String} [opt_options.domain = ''] 服务器域名,注意:传入ip、port和传入domain两种方式二选一,代理服务器不提供端口号时可采用传入domain的方式。例如:domain:`http://www.sgic.net.cn/CoCloud3`。
218-
* @param {ol.ProjectionLike} [opt_options.projection = ''] 必选项,瓦片地图投影信息,通过如下方法获得
218+
* @param {ol.ProjectionLike} [opt_options.projection = ''] 可选项,瓦片地图投影信息,通过如下方法获得
219219
* //projectionExtent为图层左下角到右上角坐标范围
220220
* var projectionExtent = [114.12567815477894, 30.457571584721734, 114.47583026053915, 30.708389893334449];
221221
* var projection = new ol.proj.Projection({
222222
units: ol.proj.Units.DEGREES,
223223
extent: projectionExtent
224224
});
225-
* @param {Boolean} [opt_options.isAutoConfig = 'true'] 可选项,是否自动配置,默认为true
225+
* @param {Boolean} [opt_options.isAutoConfig = 'true'] 可选项,是否自动配置瓦片服务参数,默认为true,注意:该参数为true时调用GetMapInfoService,获取瓦片的范围、分辨率等参数,为false时需要手动添加这些参数,且参数列表中必须指定projection,否则瓦片无法正常显示
226226
* @param {Boolean} [opt_options.cache = 'false'] 可选项,瓦片地图是否为地图文档发布动态裁图方式,默认为false
227227
* @param {String} [opt_options.token = ''] 可选项,服务访问控制,如果在 MapGIS Server Manager 服务管理中开启token,须设置此项,其key值可在设置处获取。
228228
* @param {Number} [opt_options.maxResolution = ''] 可选项,最大分辨率
229-
* @param {Number} [opt_options.minZoom = ''] 可选项,最小分辨率
230-
* @param {Number} [opt_options.maxZoom = ''] 可选项,最大分辨率
229+
* @param {Number} [opt_options.minZoom = ''] 可选项,最小缩放级别
230+
* @param {Number} [opt_options.maxZoom = ''] 可选项,最大缩放级别
231231
* @param {String} [opt_options.tileOriginType = 'leftTop'] 可选项,瓦片裁剪方式,是左上还是左下的方式,即是新瓦片裁剪的方式还是旧瓦片。一般无需设置此参数,直接由原点和中心点进行判断,只有在某些特殊的裁剪的瓦片中需要用到。例如若裁剪瓦片时以左下角为原点,方式却是新瓦片的方式则需要设置此参数为leftTop。
232232
* @param {Number} [opt_options.tileSize = '256'] 可选项,地图图片大小
233233
* @example1

src/service/ArcGis/Circle.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import {
2+
Zondy, extend
3+
} from "../common";
4+
import {ArcGisGeometry} from "./Geometry";
5+
import * as T from '@turf/turf'
6+
import * as H from '@turf/helpers'
7+
8+
/**
9+
* @class module:ArcGis.ArcGisCircle
10+
* @description ArcGis服务
11+
* @author 基础平台-杨琨
12+
* @param options - {Object} 必选项,构造圆对象参数。
13+
* @param {String} [options.center] 可选项。圆的中心点坐标,默认[0, 0]。
14+
* @param {String} [options.radius] 可选项。圆的半径,默认1000。
15+
* @param {String} [options.radiusUnit] 可选项。圆的半径单位,默认米,可选值["feet"|"kilometers"|"meters"|"miles"|"nautical-miles"|"yards"]。
16+
* @param {String} [options.numberOfPoints] 可选项。构成圆弧的插值数量,默认60。
17+
* @param {String} [options.geodesic] 可选项。启用自定义坐标系,默认false。
18+
* @param {ArcGisSpatialReference} [options.spatialReference] 可选项。多边形的空间坐标系,默认4326。
19+
*/
20+
class ArcGisCircle extends ArcGisGeometry{
21+
constructor(options) {
22+
super(options);
23+
this.center = [0, 0];
24+
this.radius = 1000;
25+
this.radiusUnit = "meters";
26+
this.numberOfPoints = 60;
27+
this.geodesic = false;
28+
this.type = "circle";
29+
30+
extend(this,options);
31+
let opts = {steps: this.numberOfPoints, units: this.radiusUnit};
32+
let circle = T.circle(this.center, this.radius, opts);
33+
this.rings = circle.geometry.coordinates;
34+
}
35+
}
36+
37+
export {ArcGisCircle};
38+
Zondy.Service.ArcGisCircle = ArcGisCircle;

src/service/ArcGis/QueryTask.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
1-
import {Zondy} from '../common/Base';
1+
import {Zondy} from '../common';
22
import {
3-
getPromise,getPromiseP,formatQuery,formatEdits,extend
3+
formatQuery,extend
44
} from '../common';
5+
import {ArcGisServiceBase} from "./ServiceBase";
56

67
class ArcGisQueryTask {
78
constructor(options) {
8-
this.options = {
9-
url: null,
10-
gdbVersion: null
11-
}
12-
extend(this.options,options);
9+
this.url = null;
10+
this.gdbVersion = null;
11+
extend(this,options);
1312
}
1413
}
1514

16-
ArcGisQueryTask.prototype.execute = function (query, requestOptions) {}
15+
ArcGisQueryTask.prototype.execute = function () {}
16+
ArcGisQueryTask.prototype.queryByLayer = function (layerId, queryParams) {
17+
queryParams.outFields = queryParams.outFields || "*";
18+
let url = this.url + "/" + layerId + "/query?f=json";
19+
let service = new ArcGisServiceBase();
20+
url = formatQuery(queryParams,url,["geometry"],null);
21+
return service.getPromise(url);
22+
}
1723
ArcGisQueryTask.prototype.executeAttachmentQuery = function () {}
1824
ArcGisQueryTask.prototype.executeForCount = function () {}
1925
ArcGisQueryTask.prototype.executeForExtent = function () {}

src/service/ArcGis/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { ArcGisMultipoint } from './Multipoint';
1616
import { ArcGisPolyline } from './Polyline';
1717
import { ArcGisGraphic } from './Graphic';
1818
import { ArcGisExtent } from './Extent';
19+
import {ArcGisCircle} from "./Circle";
1920

2021
export {
2122
ArcGisFeatureLayer,
@@ -30,6 +31,7 @@ export {
3031
ArcGisMultipoint,
3132
ArcGisPolyline,
3233
ArcGisPolygon,
34+
ArcGisCircle,
3335
ArcGisGraphic,
3436
ArcGisExtent
3537
};
@@ -47,6 +49,7 @@ const ArcGis = {
4749
ArcGisMultipoint,
4850
ArcGisPolyline,
4951
ArcGisPolygon,
52+
ArcGisCircle,
5053
ArcGisGraphic,
5154
ArcGisExtent
5255
};

src/service/common/Util.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1057,11 +1057,17 @@ var formatQuery = function (query,url,paramArr,formatObj) {
10571057
if(param.type === "polyline"){
10581058
geometry["paths"] = query[key]["paths"];
10591059
}
1060+
if(param.type === "circle"){
1061+
param.type = "polygon";
1062+
geometry["rings"] = query[key]["rings"];
1063+
}
10601064
geometry["spatialReference"] = query[key]["spatialReference"];
10611065
param = geometry;
10621066
url += "&geometryType=esriGeometry" + query[key]["type"].charAt(0).toUpperCase() + query[key]["type"].slice(1);
1067+
param = encodeURI(JSON.stringify(param));
1068+
}else {
1069+
param = JSON.stringify(param);
10631070
}
1064-
param = JSON.stringify(param);
10651071
}
10661072
if(formatObj && formatObj.hasOwnProperty(key)){
10671073
keyStr = formatObj[key];

0 commit comments

Comments
 (0)