egovamap 0.27.0 → 0.28.1

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.
@@ -58,7 +58,7 @@ var egovaBI = function(globeMap, gisMap, mapType){
58
58
 
59
59
  function rgbToRgbArray(color) {
60
60
  if (!color || typeof color !== 'string' || (typeof color == 'string'&&color.indexOf('rgb') == -1) ) return color;
61
-
61
+
62
62
  var r, g, b, a;
63
63
  var rgbaAttr = color.match(/[\d.]+/g);
64
64
  if (rgbaAttr.length >= 3) {
@@ -359,7 +359,7 @@ var egovaBI = function(globeMap, gisMap, mapType){
359
359
  return Promise.resolve(undefined)
360
360
  }
361
361
  })
362
-
362
+
363
363
  }
364
364
  let queryParams = {
365
365
  layerID: options.usageID,
@@ -393,10 +393,10 @@ var egovaBI = function(globeMap, gisMap, mapType){
393
393
  if(errorSize>0){
394
394
  console.error(`${errorSize}个点格式错误,无法正常加载`);
395
395
  }
396
-
396
+
397
397
  drawData(layerName, dataCache, options);
398
398
  })
399
-
399
+
400
400
  }
401
401
  this.getLabel = function (attributes) {
402
402
  if (!attributes) return;
@@ -498,7 +498,7 @@ var egovaBI = function(globeMap, gisMap, mapType){
498
498
  if (features.length == 0) {
499
499
  callback && callback([]);
500
500
  return;
501
- }
501
+ }
502
502
  if (!features || !features.length) return;
503
503
  var symbolUrl = "";
504
504
  if (subUniqueCode.indexOf("http") > -1) {
@@ -640,7 +640,7 @@ var egovaBI = function(globeMap, gisMap, mapType){
640
640
  if (!globeMap) {
641
641
  return;
642
642
  }
643
-
643
+
644
644
  if (geomType == 2) {
645
645
  var infoJson = features.map((feature) => {
646
646
  var paths = feature.geometry.paths[0];
@@ -710,7 +710,7 @@ var egovaBI = function(globeMap, gisMap, mapType){
710
710
  globeMap.showPolygon(infoJson, drawWay, zoom, clear, options, layerName, drawParam.clickCallback);
711
711
  }
712
712
  }
713
-
713
+
714
714
  if (data) {
715
715
  showParts(data);
716
716
  } else {
@@ -1111,7 +1111,7 @@ var egovaBI = function(globeMap, gisMap, mapType){
1111
1111
  options.eventSetting.mouseMoveCallback
1112
1112
  );
1113
1113
  }
1114
-
1114
+
1115
1115
  }
1116
1116
  }
1117
1117
  if(dataLoadCb){
@@ -1164,7 +1164,7 @@ var egovaBI = function(globeMap, gisMap, mapType){
1164
1164
  console.log("complete");
1165
1165
  }
1166
1166
  }
1167
-
1167
+
1168
1168
  }
1169
1169
  }
1170
1170
  }
@@ -1225,7 +1225,7 @@ var egovaBI = function(globeMap, gisMap, mapType){
1225
1225
  options.layerTag,
1226
1226
  options.callback
1227
1227
  );
1228
- }
1228
+ }
1229
1229
  }
1230
1230
 
1231
1231
  // 主逻辑
@@ -1275,13 +1275,25 @@ var egovaBI = function(globeMap, gisMap, mapType){
1275
1275
  }
1276
1276
  return list;
1277
1277
  }
1278
-
1278
+
1279
1279
  //设置地下模式悟空
1280
1280
  this.SetTerrainAlpha = function(alpha) {
1281
1281
  if (globeMap != null) {
1282
1282
  globeMap.onUndergroundModel(alpha);
1283
1283
  }
1284
1284
  };
1285
+
1286
+ // 新版通用接口
1287
+ // 适配热力图,具体参数转换等逻辑在引擎层面实现,确保
1288
+ this.heatMap = function (options, cb) {
1289
+ let mapInstance
1290
+ if (globeMap != null && mapType == 'globe') {
1291
+ mapInstance = globeMap;
1292
+ } else if (gisMap != null && mapType == 'map') {
1293
+ mapInstance = gisMap;
1294
+ }
1295
+ mapInstance.heatMap(options, cb);
1296
+ }
1285
1297
  }
1286
1298
 
1287
1299
 
@@ -713,6 +713,14 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig,con
713
713
  return;
714
714
  scene.fire(msgPrefix + ":showMapLayers", { args : [ layerTag, showLevel, mode, styles,layerDefs] }, parentScene, false);
715
715
  }
716
+ /**
717
+ * 刷新地图图层
718
+ */
719
+ that.refreshMapLayers = function() {
720
+ if (scene) {
721
+ scene.fire(msgPrefix + ":refreshMapLayers", {args: []}, parentScene, false);
722
+ }
723
+ }
716
724
  /* 显示车辆人员轨迹 */
717
725
  that.showObjectTrace = function (objectID, symbolType, dateTime, queryCondition, hideControlPanel, symbolPic, optimizeParams, infoCallback, updatePositionCallback, closeCallback, traceDigCallback) {
718
726
  if (scene == null)
@@ -19,7 +19,7 @@ function setCookie(name, value) {
19
19
 
20
20
  function checkGisServerURL(url, callback) {
21
21
  if(!url) return;
22
-
22
+
23
23
  var cookieUrl = getCookie("gisUrl");
24
24
  var gisProxyList = url.split(";");
25
25
  cookieUrl && gisProxyList.push(cookieUrl);
@@ -287,7 +287,7 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig, co
287
287
  }
288
288
  that.loadGISLibrary = function (gisServerURL) {
289
289
  var t = (new Date()).getTime();
290
- if(gisServerURL !== _egovagisviewerUrl && _egovagisviewerUrl){
290
+ if(gisServerURL !== _egovagisviewerUrl && _egovagisviewerUrl){
291
291
  //如果第二次的GIS地址与上次不一致则删除上一次的,不考虑同一页面多个地图,地图GIS地址不一致的情况。(页面中始终只存在一个引用egovaviewer.js)
292
292
  var curScript = document.querySelector('script[egoavagisviewer="' + _egovagisviewerUrl +'"]');
293
293
  var curLink = document.querySelector('link[egoavagisviewer="' + _egovagisviewerUrl +'"]');
@@ -570,7 +570,7 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig, co
570
570
  var cb = function (type, data) {
571
571
  if (callback && type == 'locateFeatureByIDsCallback'){
572
572
  callback(data);
573
- }
573
+ }
574
574
  if (mouseMoveCallback && type != 'locateFeatureByIDsCallback'){
575
575
  mouseMoveCallback(type, data);
576
576
  }
@@ -791,7 +791,7 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig, co
791
791
  return;
792
792
  }
793
793
  }
794
-
794
+
795
795
  var cb = function (type, data) {
796
796
  if (clickCallback && type == 'showRecListDistributionCallback')
797
797
  clickCallback(data);
@@ -1385,7 +1385,7 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig, co
1385
1385
  params.push(cb);
1386
1386
  that.callMap.apply(that, params);
1387
1387
  }
1388
-
1388
+
1389
1389
  that.stopEdit = function() {
1390
1390
  if (scene == null)
1391
1391
  return;
@@ -1440,7 +1440,7 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig, co
1440
1440
  };
1441
1441
  that.callMap('drawGeometry', type, style, clear, cb, options);
1442
1442
  }
1443
-
1443
+
1444
1444
  /* 热力图*/
1445
1445
  that.addHeatMap = function (data, option) {
1446
1446
  that.callMap('addHeatMap', data, option);
@@ -1609,7 +1609,7 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig, co
1609
1609
  'yFieldName': yFieldName
1610
1610
  };
1611
1611
  if(params) queryParam = MapUtils.deepClones(true, {}, queryParam, params);
1612
-
1612
+
1613
1613
  var cb = function (type, data) {
1614
1614
  if (callback && type == 'queryObjectInfoCallback') {
1615
1615
  callback(data);
@@ -1867,7 +1867,7 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig, co
1867
1867
  that.clearLayerSelectStyle = function (id, options) {
1868
1868
  that.callMap('clearLayerSelectStyle', id, options);
1869
1869
  }
1870
-
1870
+
1871
1871
  that.getLayersByLayerGroup = function (layerGroupName, callback) {
1872
1872
  that.callMap('getLayersByLayerGroup', layerGroupName, callback);
1873
1873
  }
@@ -1922,6 +1922,11 @@ var EGovaGISMap = function ($container, pScene, prefix, gisParams, mapConfig, co
1922
1922
  that.zoomOut = function () {
1923
1923
  that.callMap('zoomOut');
1924
1924
  }
1925
+
1926
+ that.heatMap = function(options, cb) {
1927
+ that.callMap('agsToWKT', options, cb);
1928
+ }
1929
+
1925
1930
  that.init();
1926
1931
  }
1927
1932
 
@@ -2204,6 +2204,11 @@ var EGovaGlobeMap = function ($container, pScene, prefix, mapConfig, context, ca
2204
2204
  return;
2205
2205
  scene.fire((msgPrefix + ":wmsLayerPick"), { args: [options, cb] }, parentScene, false);
2206
2206
  };
2207
+ that.heatMap = function (options, cb) {
2208
+ if (scene == null)
2209
+ return;
2210
+ scene.fire((msgPrefix + ":heatMap"), { args: [options, cb] }, parentScene, false);
2211
+ }
2207
2212
  that.init();
2208
2213
  };
2209
2214
 
@@ -1957,6 +1957,15 @@ var EGovaMap = function (containerID, callback, mapConfig, mapType, mapParam, co
1957
1957
 
1958
1958
  }
1959
1959
 
1960
+ /**
1961
+ * 刷新地图
1962
+ */
1963
+ that.refreshMapLayers = function () {
1964
+ if (scene && gisMap != null) {
1965
+ gisMap.refreshMapLayers.apply(this);
1966
+ }
1967
+ }
1968
+
1960
1969
  /* 案卷定位 */
1961
1970
  that.eventLocate = that.recLocate = function (eventID, defaultMapRange) {
1962
1971
  if (scene == null)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "egovamap",
3
- "version": "0.27.0",
3
+ "version": "0.28.1",
4
4
  "description": "eUrbanGIS SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {