egovamap 0.14.1 → 0.14.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -278,88 +278,185 @@ var egovaBI = function(globeMap, gisMap, mapType){
278
278
  args.highLightType,
279
279
  args.infoStyle,
280
280
  args.renderCanvas,
281
- options.clickCallback,
282
281
  args.tagName,
282
+ options.clickCallback,
283
+ options.mouseOverCallback,
283
284
  args.clusterOption,
284
285
  args.hasHover,
285
- options.mouseOverCallback,
286
- options.mouseOutCallback,
287
286
  layerName,
287
+ options.mouseOutCallback,
288
288
  options.option
289
289
  );
290
290
  });
291
291
  }
292
- }
293
- this.getLabel = function(attributes){
294
- if(!attributes) return;
295
- var label = [], field = {};
296
- for(var key in attributes){
297
- field = {};
298
- field[key] = attributes[key];
299
- label.push(field);
300
- }
301
- return label;
302
- }
303
- this.drawParts = function (options, data) {
304
- var self = this;
292
+ }
293
+ this.getLabel = function (attributes) {
294
+ if (!attributes) return;
295
+ var label = [], field = {};
296
+ for (var key in attributes) {
297
+ field = {};
298
+ field[key] = attributes[key];
299
+ label.push(field);
300
+ }
301
+ return label;
302
+ };
303
+ this.drawParts = function (options, data) {
304
+ var self = this;
305
305
  function showParts(data) {
306
- var drawParam = options.drawParam || [];
307
- drawParam.unshift(data);
306
+ var drawParam = options.drawParam || {};
307
+ var ctrOption = drawParam.clusterOption;
308
+ var clusterOption = {
309
+ level: ctrOption.level || 0,
310
+ style: {
311
+ "type": "simple-marker",
312
+ "style": "circle",
313
+ "color": ctrOption.color || [255, 0, 0, 0.6],
314
+ "size": ctrOption.size || 20,
315
+ "outline": { //if outline has been specified
316
+ "color": ctrOption.outlineColor || [255, 168, 0, 1],
317
+ "width": ctrOption.outlineWidth || 2
318
+ }
319
+ },
320
+ labelStyle: {
321
+ "type": "text",
322
+ "color": ctrOption.labelColor || [255, 255, 255, 1],
323
+ "text": "",
324
+ "zlevel": ctrOption.labelZlevel || 1,
325
+ "font": ctrOption.labelFont || {
326
+ "family": "Arial",
327
+ "size": 10
328
+ }
329
+ },
330
+ distance: ctrOption.distance || 50
331
+ };
332
+
333
+ var param = [data, true, false, null, null, false, drawParam.tagName, clusterOption, false, drawParam.callback, drawParam.layerName, drawParam.drawOptions];
308
334
  if (globeMap) {
309
- globeMap.showMultiObjectCurrentPosition(...drawParam);
335
+ globeMap.showMultiObjectCurrentPosition(...param);
310
336
  } else if (gisMap) {
311
- gisMap.showMultiObjectCurrentPosition(...drawParam);
337
+ gisMap.showMultiObjectCurrentPosition(...param);
312
338
  }
313
339
  }
314
340
 
315
- if(data) {
341
+ if (data) {
316
342
  showParts(data);
317
343
  } else {
318
344
  let queryFromGIS = () => {
319
- let queryParam = options.queryParam;
320
- var subTypeName = options.subTypeName;
345
+ let queryParam = options.queryParam;
346
+ var subTypeName = options.subTypeName;
321
347
  var subUniqueCode = options.subUniqueCode;
322
348
  let queryCallback = function (featureInfos) {
323
- var features = featureInfos[queryParam.phyLayerIDs];
324
- var symbolUrl = "";
325
- if(subUniqueCode.indexOf("http") > -1){
326
- symbolUrl = subUniqueCode;
327
- }else if(subUniqueCode.indexOf(".") > -1){
328
- symbolUrl = subUniqueCode;
329
- }else{
330
- symbolUrl = "".concat(subUniqueCode, ".png");
331
- }
332
- var dataList = features.map((function (feature) {
333
- return Object.assign({}, {x:feature.geometry.x,y:feature.geometry.y}, {
334
- attributes: feature.attributes,
335
- //label:self.getLabel(feature.attributes),
336
- symbolType: -1,
337
- symbolUrl: symbolUrl,
338
- });
339
- }));
349
+ var features = featureInfos[queryParam.phyLayerIDs];
350
+ var symbolUrl = "";
351
+ if (subUniqueCode.indexOf("http") > -1) {
352
+ symbolUrl = subUniqueCode;
353
+ } else if (subUniqueCode.indexOf(".") > -1) {
354
+ symbolUrl = subUniqueCode;
355
+ } else {
356
+ symbolUrl = "".concat(subUniqueCode, ".png");
357
+ }
358
+ var dataList = features.map((function (feature) {
359
+ return Object.assign({}, { x: feature.geometry.x, y: feature.geometry.y }, {
360
+ attributes: feature.attributes,
361
+ //label:self.getLabel(feature.attributes),
362
+ symbolType: -1,
363
+ symbolUrl: symbolUrl,
364
+ });
365
+ }));
340
366
  showParts(dataList);
341
367
  };
342
- if(gisMap) {
343
- gisMap.queryPhylayerFeatures(queryParam, queryCallback);
368
+ if (gisMap) {
369
+ gisMap.queryPhylayerFeatures(queryParam, queryCallback);
344
370
  }
345
371
  }
346
- queryFromGIS();
372
+ queryFromGIS();
347
373
  }
348
- }
349
-
350
-
351
-
352
- /*
353
- * @description:新的轨迹线接口
354
- * @method traceOperation
355
- * @param {Array} posArr 位置数组
356
- * @param {Object} options 配置项
357
- *
358
- * @return {Void} 无返回
359
- *
360
- * @author: Hetianhong
361
- * @date: 2021-09-09 14:49:49
362
- */
374
+ };
375
+
376
+ this.drawOtherParts = function (options, data) {
377
+ var self = this;
378
+ const geomType = options.geomType;
379
+ let queryParam = options.queryParam;
380
+ function showParts(data) {
381
+
382
+ }
383
+
384
+ if (data) {
385
+ showParts(data);
386
+ } else {
387
+ const layerID = queryParam.phyLayerIDs;
388
+ const keyField = null;
389
+ const keyValue = null;
390
+ const clearMap = queryParam.clearMap || true;
391
+ let inStyle = queryParam.style || {
392
+ color: "lightblue"
393
+ };
394
+ let inHStyle = queryParam.hStyle || {
395
+ color: "lightblue"
396
+ };
397
+ let style = null, hStyle = null;
398
+ if (geomType == 1) {
399
+ } else if (geomType == 2) {
400
+ style = {
401
+ type: "simple-line", // autocasts as new SimpleLineSymbol()
402
+ color: inStyle.color || "lightblue",
403
+ width: inStyle.width || "2px",
404
+ style: inStyle.style || "solid"
405
+ };
406
+ hStyle = {
407
+ type: "simple-line", // autocasts as new SimpleLineSymbol()
408
+ color: inHStyle.color || "lightblue",
409
+ width: inHStyle.width || "2px",
410
+ style: inHStyle.style || "solid"
411
+ };
412
+ } else if (geomType == 3) {
413
+ style = {
414
+ type: "simple-fill", // autocasts as new SimpleFillSymbol()
415
+ color: inStyle.color || [51, 51, 204, 0.9],
416
+ style: inStyle.style || "solid",
417
+ outline: { // autocasts as new SimpleLineSymbol()
418
+ color: inStyle.outlineColor || "white",
419
+ width: inStyle.outlineWidth || "1px"
420
+ }
421
+ };
422
+ hStyle = {
423
+ type: "simple-fill", // autocasts as new SimpleFillSymbol()
424
+ color: inHStyle.color || [51, 51, 204, 0.9],
425
+ style: inHStyle.style || "solid",
426
+ outline: { // autocasts as new SimpleLineSymbol()
427
+ color: inHStyle.outlineColor || "white",
428
+ width: inHStyle.outlineWidth || "1px"
429
+ }
430
+ };
431
+ }
432
+ const bZoom = queryParam.bZoom || true;
433
+ const randomColor = null;
434
+ const labelField = null;
435
+ const labelstyle = null;
436
+ const geometry = null;
437
+ const where = queryParam.where || "1=1";
438
+
439
+ let param = [layerID, keyField, keyValue, clearMap, style, hStyle, bZoom, randomColor, labelField, labelstyle, geometry, where];
440
+ if (globeMap) {
441
+ gisMap.locateFeatureByIDs(...param);
442
+ } else if (gisMap) {
443
+ gisMap.locateFeatureByIDs(...param);
444
+ }
445
+
446
+ }
447
+ };
448
+
449
+ /*
450
+ * @description:新的轨迹线接口
451
+ * @method traceOperation
452
+ * @param {Array} posArr 位置数组
453
+ * @param {Object} options 配置项
454
+ *
455
+ * @return {Void} 无返回
456
+ *
457
+ * @author: Hetianhong
458
+ * @date: 2021-09-09 14:49:49
459
+ */
363
460
  this.traceOperation = function (posArr, options) {
364
461
  globeMap.traceOperation(posArr, options);
365
462
  }
@@ -510,12 +510,12 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
510
510
  }
511
511
  }
512
512
  /* 显示多个自定义图标 */
513
- that.showMultiObjectCurrentPosition = function (jsonInfo, zoom, bClear, hStyleID, infoStyle, bCanvas, tagName, clusterOption, hasHover, layerID, clickCallback, mouseOverCallBack) {
513
+ that.showMultiObjectCurrentPosition = function (jsonInfo, zoom, bClear, hStyleID, infoStyle, bCanvas, tagName, clickCallback, mouseOverCallBack, clusterOption, hasHover, layerID, mouseOutCallback, options) {
514
514
  if (scene == null)
515
515
  return;
516
516
  // 移除监听
517
- that.removeEventBind("showMultiObjectCurrentPositionClick");
518
- that.removeEventBind("showMultiObjectCurrentPositionMouseover");
517
+ that.removeEventBind("showMultiObjectCurrentPositionClick"+tagName);
518
+ that.removeEventBind("showMultiObjectCurrentPositionMouseover"+tagName);
519
519
  var args =[];
520
520
  var FuncList = [];
521
521
  for(var i = 0;i<arguments.length;i++){
@@ -526,12 +526,12 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
526
526
  }
527
527
  }
528
528
  if (FuncList[0] instanceof Function) {
529
- that.bindEvent("showMultiObjectCurrentPositionClick", function(evt) {
529
+ that.bindEvent("showMultiObjectCurrentPositionClick"+tagName, function(evt) {
530
530
  FuncList[0](evt.args);
531
531
  });
532
532
  }
533
533
  if (FuncList[1] instanceof Function) {
534
- that.bindEvent("showMultiObjectCurrentPositionMouseover", function(evt) {
534
+ that.bindEvent("showMultiObjectCurrentPositionMouseover"+tagName, function(evt) {
535
535
  FuncList[1](evt.args);
536
536
  });
537
537
  }
@@ -928,7 +928,7 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
928
928
  scene.fire(msgPrefix + ":addChart", {args: [option, zoom,id,minZoom,maxZoom]}, parentScene);
929
929
  }
930
930
 
931
- that.drawGeometry = function(type, style, clear, callback) {
931
+ that.drawGeometry = function(type, style, clear, callback, option) {
932
932
  type = type || "point";
933
933
  style = style || {"type":"esriSLS","style":"esriSLSSolid","color":[255,0,0,255],"width":2};
934
934
  //移除监听
@@ -939,7 +939,7 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
939
939
  });
940
940
  }
941
941
 
942
- scene.fire(msgPrefix + ":drawGeometry", {args: [type, style, clear]}, parentScene);
942
+ scene.fire(msgPrefix + ":drawGeometry", {args: [type, style, clear, callback, option]}, parentScene);
943
943
  }
944
944
 
945
945
  /* 热力图*/
@@ -741,7 +741,7 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig, co
741
741
  that.callMap('getCellNameByPosXY', x, y, gridType, keyField, queryID, cb);
742
742
  }
743
743
  /* 根据图层字段定位显示 */
744
- that.locateFeatureByIDs = function (layerID, keyFiled, keyValue, clearMap, style, hStyle, bZoom, randomColor, labelfield, labelstyle, geometry, where, renderCanvas, singleSelected, options, extendProperty, layerTag, outFieldStr, animiteStep, callback, popupTemplate) {
744
+ that.locateFeatureByIDs = function (layerID, keyFiled, keyValue, clearMap, style, hStyle, bZoom, randomColor, labelfield, labelstyle, geometry, where, renderCanvas, singleSelected, options, extendProperty, layerTag, outFieldStr, animiteStep, index, clipGeom, callback, popupTemplate) {
745
745
  if (scene == null)
746
746
  return;
747
747
  if (bZoom == undefined)
@@ -755,7 +755,7 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig, co
755
755
  that.fireCallback(type, data);
756
756
  }
757
757
  };
758
- that.callMap('locateFeatureByIDs', layerID, keyValue, keyFiled, clearMap, style, hStyle, bZoom, randomColor, labelfield, labelstyle, geometry, where, renderCanvas, singleSelected, options, extendProperty, layerTag, outFieldStr, animiteStep, cb, popupTemplate);
758
+ that.callMap('locateFeatureByIDs', layerID, keyValue, keyFiled, clearMap, style, hStyle, bZoom, randomColor, labelfield, labelstyle, geometry, where, renderCanvas, singleSelected, options, extendProperty, layerTag, outFieldStr, animiteStep, index, clipGeom, cb, popupTemplate);
759
759
  }
760
760
  /* 显示案件分布 */
761
761
  that.showRecListDistribution = function (infoJson, zoom, clickCallback, labelInfo, isShowLegend, symbolUrl) {
@@ -857,7 +857,7 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig, co
857
857
  }
858
858
 
859
859
  /* 显示多个自定义图标 */
860
- that.showMultiObjectCurrentPosition = function (jsonInfo, zoom, bClear, hStyleID, infoStyle, bCanvas, clickCallback, tagName, clusterOption, hasHover, mouseOverCallback, mouseOutCallback, layerName, options) {
860
+ that.showMultiObjectCurrentPosition = function (jsonInfo, zoom, bClear, hStyleID, infoStyle, bCanvas, tagName, clickCallback, mouseOverCallback, clusterOption, hasHover, layerName, mouseOutCallback, options) {
861
861
  if (scene == null)
862
862
  return;
863
863
 
@@ -930,7 +930,7 @@ var EGovaMap = function (containerID, callback, mapConfig, mapType, mapParam, co
930
930
  };
931
931
 
932
932
  /* 根据图层字段定位显示 */
933
- that.locateFeatureByIDs = function (layerID, keyField, keyValue, clearMap, style, hStyle, bZoom, randomColor, labelfield, labelstyle, geometry, where, renderCanvas, singleSelected, options, extendProperty, layerTag, successFunc,outFieldStr,animiteStep,index,clipGeom) {
933
+ that.locateFeatureByIDs = function (layerID, keyField, keyValue, clearMap, style, hStyle, bZoom, randomColor, labelfield, labelstyle, geometry, where, renderCanvas, singleSelected, options, extendProperty, layerTag, successFunc, outFieldStr, animiteStep, index, clipGeom, callback, popupTemplate) {
934
934
  if (scene == null)
935
935
  return;
936
936
 
@@ -939,7 +939,7 @@ var EGovaMap = function (containerID, callback, mapConfig, mapType, mapParam, co
939
939
  }
940
940
 
941
941
  if (gisMap != null) {
942
- gisMap.locateFeatureByIDs.apply(this, [layerID, keyField, keyValue, clearMap, style, hStyle, bZoom, randomColor, labelfield, labelstyle, geometry, where, renderCanvas, singleSelected, options, extendProperty, layerTag,outFieldStr,animiteStep,index,clipGeom]);
942
+ gisMap.locateFeatureByIDs.apply(this, [layerID, keyField, keyValue, clearMap, style, hStyle, bZoom, randomColor, labelfield, labelstyle, geometry, where, renderCanvas, singleSelected, options, extendProperty, layerTag, outFieldStr, animiteStep, index, clipGeom, callback, popupTemplate]);
943
943
  }
944
944
  if (globeMap != null && gisMap != null) {
945
945
  //三维先调用queryFeature查询要素再用locateFeatureByCoords显示
@@ -1664,7 +1664,7 @@ var EGovaMap = function (containerID, callback, mapConfig, mapType, mapParam, co
1664
1664
  };
1665
1665
 
1666
1666
  /* 显示多个自定义图标 */
1667
- that.showMultiObjectCurrentPosition = function (jsonInfo, zoom, bClear, hStyleID, infoStyle, bCanvas, tagName, clickCallback, mouseOverCallBack, clusterOption, hasHover, layerID) {
1667
+ that.showMultiObjectCurrentPosition = function (jsonInfo, zoom, bClear, hStyleID, infoStyle, bCanvas, tagName, clickCallback, mouseOverCallBack, clusterOption, hasHover, layerID, mouseOutCallback, options) {
1668
1668
  if (scene == null)
1669
1669
  return;
1670
1670
  if (gisMap != null && that.synchroSetting === true) {
@@ -3620,7 +3620,7 @@ var EGovaMap = function (containerID, callback, mapConfig, mapType, mapParam, co
3620
3620
  /**
3621
3621
  * 获取区域信息
3622
3622
  * @param {String} params: {
3623
- * regionType: 1,
3623
+ * regionType: 1, // 区域类型:1:市 | 2:区 | 3:街道 | 4:社区
3624
3624
  * seniorId: -1
3625
3625
  * }
3626
3626
  * @callback 回调函数
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "egovamap",
3
- "version": "0.14.1",
3
+ "version": "0.14.5",
4
4
  "description": "eUrbanGIS SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {