@vtx/map 1.1.30 → 1.1.32

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.
@@ -398,6 +398,10 @@ var TMap = /*#__PURE__*/function (_React$Component) {
398
398
  t.state.gis["clearFrameSelect"] = function () {
399
399
  return t.clearFrameSelect();
400
400
  };
401
+
402
+ t.state.gis["clearFrameSelectById"] = function (id) {
403
+ return t.clearFrameSelectById(id);
404
+ };
401
405
  } // 框选
402
406
 
403
407
  }, {
@@ -417,7 +421,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
417
421
  var t = this;
418
422
  var params = {},
419
423
  type = geometryType || 'polygon',
420
- id = data.id || 'frameSelectFeature';
424
+ id = data.id || "frameSelectFeature_".concat(Math.random());
421
425
  params.color = parameter.color || 'red';
422
426
  params.lineColor = parameter.lineColor || 'red';
423
427
  params.lineOpacity = parameter.lineOpacity || 1;
@@ -431,7 +435,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
431
435
  id: id
432
436
  }
433
437
  });
434
- t.frameSelectProps = {
438
+ t.frameSelectProps[id] = {
435
439
  callback: callback,
436
440
  id: id,
437
441
  type: geometryType
@@ -441,8 +445,19 @@ var TMap = /*#__PURE__*/function (_React$Component) {
441
445
  }, {
442
446
  key: "clearFrameSelect",
443
447
  value: function clearFrameSelect() {
444
- this.removeGraphic(this.frameSelectProps.id, this.frameSelectProps.type);
448
+ for (var key in this.frameSelectProps) {
449
+ this.removeGraphic(this.frameSelectProps[key].id, this.frameSelectProps[key].type);
450
+ }
451
+
445
452
  this.frameSelectProps = {};
453
+ } // 清除框选ById
454
+
455
+ }, {
456
+ key: "clearFrameSelectById",
457
+ value: function clearFrameSelectById(id) {
458
+ var obj = this.frameSelectProps[id];
459
+ this.removeGraphic(obj.id, obj.type);
460
+ delete this.frameSelectProps[id];
446
461
  }
447
462
  }, {
448
463
  key: "setMapType",
@@ -2070,7 +2085,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2070
2085
  this.polygonTool = new T.PolygonTool(this.state.gis, paramgcr);
2071
2086
  this.polygonTool.open();
2072
2087
  this.polygonTool.addEventListener('draw', function (ob) {
2073
- var _t$frameSelectProps;
2088
+ var _t$frameSelectProps$b;
2074
2089
 
2075
2090
  var type = ob.type,
2076
2091
  target = ob.target,
@@ -2126,8 +2141,8 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2126
2141
  t.props.drawEnd(backobj);
2127
2142
  }
2128
2143
 
2129
- if (((_t$frameSelectProps = t.frameSelectProps) === null || _t$frameSelectProps === void 0 ? void 0 : _t$frameSelectProps.callback) instanceof Function) {
2130
- t.frameSelectProps.callback(backobj);
2144
+ if (((_t$frameSelectProps$b = t.frameSelectProps[backobj.id]) === null || _t$frameSelectProps$b === void 0 ? void 0 : _t$frameSelectProps$b.callback) instanceof Function) {
2145
+ t.frameSelectProps[backobj.id].callback(backobj);
2131
2146
  }
2132
2147
  });
2133
2148
  break;
@@ -2137,7 +2152,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2137
2152
  this.circleTool = new T.CircleTool(this.state.gis, paramgcr);
2138
2153
  this.circleTool.open();
2139
2154
  this.circleTool.addEventListener('drawend', function (ob) {
2140
- var _t$frameSelectProps2;
2155
+ var _t$frameSelectProps$b2;
2141
2156
 
2142
2157
  var type = ob.type,
2143
2158
  target = ob.target,
@@ -2187,8 +2202,8 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2187
2202
  t.props.drawEnd(backobj);
2188
2203
  }
2189
2204
 
2190
- if (((_t$frameSelectProps2 = t.frameSelectProps) === null || _t$frameSelectProps2 === void 0 ? void 0 : _t$frameSelectProps2.callback) instanceof Function) {
2191
- t.frameSelectProps.callback(backobj);
2205
+ if (((_t$frameSelectProps$b2 = t.frameSelectProps[backobj.id]) === null || _t$frameSelectProps$b2 === void 0 ? void 0 : _t$frameSelectProps$b2.callback) instanceof Function) {
2206
+ t.frameSelectProps[backobj.id].callback(backobj);
2192
2207
  }
2193
2208
  });
2194
2209
  break;
@@ -2198,7 +2213,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2198
2213
  this.rectangleTool = new T.RectangleTool(this.state.gis, paramgcr);
2199
2214
  this.rectangleTool.open();
2200
2215
  this.rectangleTool.addEventListener('draw', function (ob) {
2201
- var _t$frameSelectProps3;
2216
+ var _t$frameSelectProps$b3;
2202
2217
 
2203
2218
  var type = ob.type,
2204
2219
  target = ob.target,
@@ -2261,8 +2276,8 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2261
2276
  t.props.drawEnd(backobj);
2262
2277
  }
2263
2278
 
2264
- if (((_t$frameSelectProps3 = t.frameSelectProps) === null || _t$frameSelectProps3 === void 0 ? void 0 : _t$frameSelectProps3.callback) instanceof Function) {
2265
- t.frameSelectProps.callback(backobj);
2279
+ if (((_t$frameSelectProps$b3 = t.frameSelectProps[backobj.id]) === null || _t$frameSelectProps$b3 === void 0 ? void 0 : _t$frameSelectProps$b3.callback) instanceof Function) {
2280
+ t.frameSelectProps[backobj.id].callback(backobj);
2266
2281
  }
2267
2282
  });
2268
2283
  break;
@@ -3110,17 +3125,30 @@ var TMap = /*#__PURE__*/function (_React$Component) {
3110
3125
  ;
3111
3126
  } else {
3112
3127
  var list = result.pois.map(function (r) {
3113
- return {
3114
- id: r.hotPointID,
3115
- longitude: r.lonlat.split(' ')[0],
3116
- latitude: r.lonlat.split(' ')[1],
3128
+ var lnglat = {};
3129
+
3130
+ if (r.lonlat.indexOf(",") > -1) {
3131
+ lnglat = {
3132
+ longitude: r.lonlat.split(',')[0],
3133
+ latitude: r.lonlat.split(',')[1]
3134
+ };
3135
+ } else {
3136
+ lnglat = {
3137
+ longitude: r.lonlat.split(' ')[0],
3138
+ latitude: r.lonlat.split(' ')[1]
3139
+ };
3140
+ }
3141
+
3142
+ return _objectSpread(_objectSpread({
3143
+ id: r.hotPointID
3144
+ }, lnglat), {}, {
3117
3145
  canShowLabel: true,
3118
3146
  config: {
3119
3147
  labelContent: r.name,
3120
3148
  labelPixelY: 27
3121
3149
  },
3122
3150
  other: 'search'
3123
- };
3151
+ });
3124
3152
  });
3125
3153
  resolve(list);
3126
3154
  }