@vtx/map 1.2.30 → 6.0.0-beta.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.
- package/README.md +44 -44
- package/lib/VtxMap/AMap/AMap.js +359 -355
- package/lib/VtxMap/BMap/Map.js +331 -330
- package/lib/VtxMap/BMap/Map1.js +1712 -0
- package/lib/VtxMap/GMap/Map.js +432 -427
- package/lib/VtxMap/Map.js +31 -27
- package/lib/VtxMap/MapToolFunction.js +6 -7
- package/lib/VtxMap/OMap/Map.js +410 -405
- package/lib/VtxMap/OMap/Map.less +70 -70
- package/lib/VtxMap/OlMap/Map.js +450 -440
- package/lib/VtxMap/OlMap/Map.less +230 -230
- package/lib/VtxMap/TMap/TMap.js +321 -318
- package/lib/VtxMap/index.js +10 -11
- package/lib/VtxMap/mapPlayer.js +15 -16
- package/lib/VtxMap/optimizingPointMap.js +35 -33
- package/lib/VtxMap/style/index.js +1 -2
- package/lib/VtxMap/zoomMap.js +24 -23
- package/lib/VtxModal/VtxModal.js +94 -82
- package/lib/VtxModal/VtxModal.less +83 -52
- package/lib/VtxModal/draggableModal.js +35 -33
- package/lib/VtxModal/index.js +6 -7
- package/lib/VtxModal/style/index.js +1 -15
- package/lib/VtxSearchCheckMap/VtxSearchCheckMap.js +265 -244
- package/lib/VtxSearchCheckMap/VtxSearchCheckMap.less +69 -43
- package/lib/VtxSearchCheckMap/index.js +4 -9
- package/lib/VtxSearchCheckMap/mapping.js +1 -2
- package/lib/VtxSearchCheckMap/style/index.js +5 -11
- package/lib/VtxSearchMap/VtxSearchMap.js +326 -288
- package/lib/VtxSearchMap/VtxSearchMap.less +74 -47
- package/lib/VtxSearchMap/VtxSearchMapAntd3.less +1 -1
- package/lib/VtxSearchMap/index.js +4 -9
- package/lib/VtxSearchMap/mapping.js +1 -2
- package/lib/VtxSearchMap/style/index.js +1 -28
- package/lib/default.js +44 -24
- package/lib/index.js +30 -31
- package/lib/utils/util.js +3 -4
- package/package.json +19 -27
- package/lib/VtxMap/AMap/AMap.css +0 -27
- package/lib/VtxMap/AMap/AMap.js.map +0 -1
- package/lib/VtxMap/BMap/Map.css +0 -26
- package/lib/VtxMap/BMap/Map.js.map +0 -1
- package/lib/VtxMap/GMap/Map.css +0 -88
- package/lib/VtxMap/GMap/Map.js.map +0 -1
- package/lib/VtxMap/Map.css +0 -7
- package/lib/VtxMap/Map.js.map +0 -1
- package/lib/VtxMap/MapToolFunction.js.map +0 -1
- package/lib/VtxMap/OMap/Map.css +0 -76
- package/lib/VtxMap/OMap/Map.js.map +0 -1
- package/lib/VtxMap/OlMap/Map.css +0 -229
- package/lib/VtxMap/OlMap/Map.js.map +0 -1
- package/lib/VtxMap/TMap/TMap.css +0 -31
- package/lib/VtxMap/TMap/TMap.js.map +0 -1
- package/lib/VtxMap/index.js.map +0 -1
- package/lib/VtxMap/mapPlayer.js.map +0 -1
- package/lib/VtxMap/optimizingPointMap.js.map +0 -1
- package/lib/VtxMap/style/css.js +0 -10
- package/lib/VtxMap/style/css.js.map +0 -1
- package/lib/VtxMap/style/index.js.map +0 -1
- package/lib/VtxMap/zoomMap.js.map +0 -1
- package/lib/VtxModal/VtxModal.css +0 -62
- package/lib/VtxModal/VtxModal.js.map +0 -1
- package/lib/VtxModal/VtxModalAntd3.css +0 -62
- package/lib/VtxModal/VtxModalAntd3.less +0 -67
- package/lib/VtxModal/draggableModal.js.map +0 -1
- package/lib/VtxModal/index.js.map +0 -1
- package/lib/VtxModal/style/css.js +0 -15
- package/lib/VtxModal/style/css.js.map +0 -1
- package/lib/VtxModal/style/index.js.map +0 -1
- package/lib/VtxSearchCheckMap/VtxSearchCheckMap.css +0 -182
- package/lib/VtxSearchCheckMap/VtxSearchCheckMap.js.map +0 -1
- package/lib/VtxSearchCheckMap/VtxSearchCheckMapAntd3.css +0 -0
- package/lib/VtxSearchCheckMap/VtxSearchCheckMapAntd3.less +0 -1
- package/lib/VtxSearchCheckMap/index.js.map +0 -1
- package/lib/VtxSearchCheckMap/mapping.js.map +0 -1
- package/lib/VtxSearchCheckMap/style/css.js +0 -28
- package/lib/VtxSearchCheckMap/style/css.js.map +0 -1
- package/lib/VtxSearchCheckMap/style/index.js.map +0 -1
- package/lib/VtxSearchMap/VtxSearchMap.css +0 -202
- package/lib/VtxSearchMap/VtxSearchMap.js.map +0 -1
- package/lib/VtxSearchMap/VtxSearchMapAntd3.css +0 -0
- package/lib/VtxSearchMap/index.js.map +0 -1
- package/lib/VtxSearchMap/mapping.js.map +0 -1
- package/lib/VtxSearchMap/style/css.js +0 -28
- package/lib/VtxSearchMap/style/css.js.map +0 -1
- package/lib/VtxSearchMap/style/index.js.map +0 -1
- package/lib/default.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/utils/util.js.map +0 -1
package/lib/VtxMap/GMap/Map.js
CHANGED
|
@@ -3,47 +3,52 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _MapToolFunction = require("../MapToolFunction");
|
|
9
9
|
var _immutable = _interopRequireDefault(require("immutable"));
|
|
10
|
-
var _default2 =
|
|
11
|
-
|
|
12
|
-
function
|
|
10
|
+
var _default2 = _interopRequireWildcard(require("../../default"));
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
13
16
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
14
17
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
18
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
|
-
function _defineProperty(
|
|
17
|
-
function _toConsumableArray(
|
|
19
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
20
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
18
21
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
19
|
-
function _unsupportedIterableToArray(
|
|
20
|
-
function _iterableToArray(
|
|
21
|
-
function _arrayWithoutHoles(
|
|
22
|
-
function _arrayLikeToArray(
|
|
23
|
-
function _classCallCheck(
|
|
24
|
-
function _defineProperties(
|
|
25
|
-
function _createClass(
|
|
26
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i
|
|
22
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
23
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
24
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
25
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
26
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
27
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
28
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
29
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
27
30
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
28
|
-
function
|
|
29
|
-
function
|
|
30
|
-
function
|
|
31
|
-
function
|
|
32
|
-
function
|
|
33
|
-
function
|
|
34
|
-
function
|
|
35
|
-
var Set = _immutable
|
|
31
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
32
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
33
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
34
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
35
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
36
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
37
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } //公共地址配置
|
|
38
|
+
var Set = _immutable.default.Set;
|
|
36
39
|
var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
40
|
+
_inherits(ArcgisMap, _React$Component);
|
|
41
|
+
var _super = _createSuper(ArcgisMap);
|
|
37
42
|
function ArcgisMap(props) {
|
|
38
43
|
var _this;
|
|
39
44
|
_classCallCheck(this, ArcgisMap);
|
|
40
|
-
_this =
|
|
45
|
+
_this = _super.call(this, props);
|
|
41
46
|
_this.grwkid = 4326; //wkid 坐标系对应,全局使用.
|
|
42
47
|
_this.wkid = (isNaN(parseInt(props.wkid)) ? props.wkid : parseInt(props.wkid)) || 4326; //wkid 坐标系对应,全局使用.
|
|
43
|
-
_this.wkidStr = isNaN(parseInt(props.wkid)) ?
|
|
48
|
+
_this.wkidStr = isNaN(parseInt(props.wkid)) ? "wkt" : "wkid";
|
|
44
49
|
_this.zIndexGraphics = []; //需要放在最后的图元,zoom和pan时刷新dom到最后
|
|
45
|
-
_this.htmlPointsId =
|
|
46
|
-
_this.pointCollectionId =
|
|
50
|
+
_this.htmlPointsId = "vtx_gmap_html_points"; //html点位容器id class管理
|
|
51
|
+
_this.pointCollectionId = "vtx_gmap_html_pointCollection"; //海量点canvas点位容器id class管理
|
|
47
52
|
_this.Label = {}; //所有label 集合
|
|
48
53
|
_this.labelLayer = {
|
|
49
54
|
x: 0,
|
|
@@ -59,9 +64,9 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
59
64
|
_this.drawParam = {}; //缓存 绘制的数据
|
|
60
65
|
_this.editToolbar = null; //编辑对象
|
|
61
66
|
_this.editToolbarC = null; //编辑对象
|
|
62
|
-
_this.editId =
|
|
67
|
+
_this.editId = ""; //当前编辑的图元id
|
|
63
68
|
_this.canMoveLabel = false; //编辑点时,label跟着移动开关
|
|
64
|
-
//当前鼠标的经纬度,便捷含label点时刷新
|
|
69
|
+
//当前鼠标的经纬度,便捷含label点时刷新
|
|
65
70
|
//x,y鼠标坐标 px,py鼠标与点中心偏移坐标 isCount是否计算偏移
|
|
66
71
|
_this.mouseNowPosition = {
|
|
67
72
|
x: 0,
|
|
@@ -104,7 +109,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
104
109
|
circleIds: [],
|
|
105
110
|
//地图上圆的ids
|
|
106
111
|
// editId: '',//当前编辑的图元id
|
|
107
|
-
editGraphic:
|
|
112
|
+
editGraphic: "",
|
|
108
113
|
//当前编辑完后图元所有数据
|
|
109
114
|
boundaryInfo: [],
|
|
110
115
|
//当前画出的边界线的id和区域名
|
|
@@ -121,47 +126,48 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
121
126
|
return _this;
|
|
122
127
|
}
|
|
123
128
|
//加载地图信息
|
|
124
|
-
|
|
125
|
-
return _createClass(ArcgisMap, [{
|
|
129
|
+
_createClass(ArcgisMap, [{
|
|
126
130
|
key: "loadMapJs",
|
|
127
131
|
value: function loadMapJs() {
|
|
128
132
|
this.loadMapComplete = new Promise(function (resolve, reject) {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
133
|
+
(0, _default2.ensurejQuery)().then(function () {
|
|
134
|
+
if (window.GMap) {
|
|
135
|
+
resolve(window.GMap);
|
|
136
|
+
} else {
|
|
137
|
+
//加载 js
|
|
138
|
+
// $.getScript('http://222.92.212.126:25048/gis/html/js/arcgis_js_api/library/3.9/3.9/init.js',()=>{
|
|
139
|
+
$.getScript("".concat(_default2.default.arcgisServerURL, "/html/js/arcgis_js_api/library/3.9/3.9/init.js"), function () {
|
|
140
|
+
var Heatmap = new Promise(function (resolve, reject) {
|
|
141
|
+
$.getScript("".concat(_default2.default.mapServerURL, "/gisheatmap.js"), function () {
|
|
142
|
+
resolve();
|
|
143
|
+
});
|
|
138
144
|
});
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
145
|
+
var PointCollection = new Promise(function (resolve, reject) {
|
|
146
|
+
$.getScript("".concat(_default2.default.mapServerURL, "/GPointCollection.js"), function () {
|
|
147
|
+
resolve();
|
|
148
|
+
});
|
|
143
149
|
});
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
+
Promise.all([Heatmap, PointCollection]).then(function () {
|
|
151
|
+
//require是关键字 这边用window区别
|
|
152
|
+
window.require(["esri/map", "esri/layers/ArcGISTiledMapServiceLayer", "dojo/on", "esri/geometry/Point", "esri/symbols/SimpleMarkerSymbol", "esri/Color", "esri/graphic", "esri/domUtils", "esri/toolbars/edit", "esri/symbols/PictureMarkerSymbol", "esri/symbols/TextSymbol", "esri/symbols/SimpleLineSymbol", "esri/toolbars/draw", "esri/layers/WMTSLayer", "esri/geometry/Extent", "esri/layers/WMTSLayerInfo", "esri/geometry/Polyline", "esri/symbols/SimpleFillSymbol", "esri/geometry/Circle", "esri/layers/TileInfo", "esri/SpatialReference", "esri/dijit/BasemapToggle"], function (Map) {
|
|
153
|
+
window.GMap = Map;
|
|
154
|
+
resolve(window.GMap);
|
|
155
|
+
});
|
|
150
156
|
});
|
|
151
157
|
});
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
}
|
|
158
|
+
//加载 css
|
|
159
|
+
$("<link>").attr({
|
|
160
|
+
rel: "stylesheet",
|
|
161
|
+
type: "text/css",
|
|
162
|
+
href: "".concat(_default2.default.arcgisServerURL, "/html/js/arcgis_js_api/library/3.9/3.9/js/dojo/dijit/themes/tundra/tundra.css")
|
|
163
|
+
}).appendTo("head");
|
|
164
|
+
$("<link>").attr({
|
|
165
|
+
rel: "stylesheet",
|
|
166
|
+
type: "text/css",
|
|
167
|
+
href: "".concat(_default2.default.arcgisServerURL, "/html/js/arcgis_js_api/library/3.9/3.9/js/esri/css/esri.css")
|
|
168
|
+
}).appendTo("head");
|
|
169
|
+
}
|
|
170
|
+
});
|
|
165
171
|
});
|
|
166
172
|
}
|
|
167
173
|
//初始化地图数据
|
|
@@ -248,7 +254,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
248
254
|
//渲染優化
|
|
249
255
|
if (!(tl.y < -50 || tl.x < -50 || tl.y > t.state.gis.height || tl.x > t.state.gis.width)) {
|
|
250
256
|
t.Label[i].html.css({
|
|
251
|
-
position:
|
|
257
|
+
position: "absolute",
|
|
252
258
|
top: tl.y + t.Label[i].offset.y - t.labelLayer.y,
|
|
253
259
|
left: tl.x + t.Label[i].offset.x - t.labelLayer.x
|
|
254
260
|
});
|
|
@@ -285,10 +291,10 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
285
291
|
}
|
|
286
292
|
t.rangingTool.line.paths.push([].concat(lnlt));
|
|
287
293
|
//处理距离展示
|
|
288
|
-
var distext = t.rangingTool.distance > 0 ? t.rangingTool.distance > 1000 ? "\u603B\u957F:".concat(Math.round(t.rangingTool.distance / 10) / 100, "\u516C\u91CC") : "\u603B\u957F:".concat(t.rangingTool.distance, "\u7C73") :
|
|
294
|
+
var distext = t.rangingTool.distance > 0 ? t.rangingTool.distance > 1000 ? "\u603B\u957F:".concat(Math.round(t.rangingTool.distance / 10) / 100, "\u516C\u91CC") : "\u603B\u957F:".concat(t.rangingTool.distance, "\u7C73") : "起点";
|
|
289
295
|
//加点
|
|
290
296
|
var point = {
|
|
291
|
-
id: t.rangingTool.points.length +
|
|
297
|
+
id: t.rangingTool.points.length + "vtx_g_rang_p" + Math.random(),
|
|
292
298
|
longitude: lnlt[0],
|
|
293
299
|
latitude: lnlt[1],
|
|
294
300
|
markerContent: "\n <div style='z-index:1;'>\n <div class='vtx-g-rangingPoint'></div>\n <div class='vtx-g-rangingDistance'>".concat(distext, "</div>\n </div>\n "),
|
|
@@ -306,12 +312,12 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
306
312
|
if (t.rangingTool.line.paths.length == 2) {
|
|
307
313
|
//加线
|
|
308
314
|
t.rangingTool.line = {
|
|
309
|
-
id:
|
|
315
|
+
id: "vtx_g_rang_line" + Math.random(),
|
|
310
316
|
paths: _toConsumableArray(t.rangingTool.line.paths),
|
|
311
317
|
config: {
|
|
312
|
-
color:
|
|
318
|
+
color: "#ff0000",
|
|
313
319
|
lineWidth: 2,
|
|
314
|
-
lineType:
|
|
320
|
+
lineType: "solid"
|
|
315
321
|
}
|
|
316
322
|
};
|
|
317
323
|
t.addLine([t.rangingTool.line]);
|
|
@@ -321,13 +327,13 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
321
327
|
})]);
|
|
322
328
|
}
|
|
323
329
|
//双击 测距结束
|
|
324
|
-
if (status ==
|
|
330
|
+
if (status == "dbl") {
|
|
325
331
|
//开启双击缩放功能
|
|
326
332
|
t.state.gis.enableDoubleClickZoom();
|
|
327
333
|
var rangkey = new Date().getTime() + Math.random();
|
|
328
334
|
//加结束点
|
|
329
335
|
var end = {
|
|
330
|
-
id:
|
|
336
|
+
id: "vtx_g_rang_end" + Math.random(),
|
|
331
337
|
longitude: lnlt[0],
|
|
332
338
|
latitude: lnlt[1],
|
|
333
339
|
markerContent: "\n <div>\n <div class='vtx-g-rang-exit'>x</div>\n </div>\n ",
|
|
@@ -341,9 +347,9 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
341
347
|
};
|
|
342
348
|
//用addpoint方法加点
|
|
343
349
|
t.addPoint([end]);
|
|
344
|
-
//删除提示框
|
|
345
|
-
t.removeGraphic(
|
|
346
|
-
t.removeGraphic(
|
|
350
|
+
//删除提示框
|
|
351
|
+
t.removeGraphic("vtx-g-rang-showRangTool", "point");
|
|
352
|
+
t.removeGraphic("vtx-g-rang-showRangTool-line", "line");
|
|
347
353
|
//缓存当前这一条测距数据
|
|
348
354
|
t.rangingTools[rangkey] = _objectSpread({}, t.rangingTool);
|
|
349
355
|
//回调测距参数
|
|
@@ -367,11 +373,11 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
367
373
|
}
|
|
368
374
|
};
|
|
369
375
|
//地图鼠标移入事件
|
|
370
|
-
t.state.gis.on(
|
|
376
|
+
t.state.gis.on("mouse-over", function (e) {
|
|
371
377
|
//鼠标移出地图时,删除测距显示点
|
|
372
378
|
if (t.rangingTool.isRanging) {
|
|
373
379
|
var rp = {
|
|
374
|
-
id:
|
|
380
|
+
id: "vtx-g-rang-showRangTool",
|
|
375
381
|
longitude: e.mapPoint.x,
|
|
376
382
|
latitude: e.mapPoint.y,
|
|
377
383
|
markerContent: "\n <div class='vtx-g-rang-showRangTool'>\u5355\u51FB\u786E\u5B9A\u8D77\u70B9</div>\n ",
|
|
@@ -384,18 +390,18 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
384
390
|
}
|
|
385
391
|
});
|
|
386
392
|
//地图鼠标移出事件
|
|
387
|
-
t.state.gis.on(
|
|
393
|
+
t.state.gis.on("mouse-out", function (e) {
|
|
388
394
|
//鼠标移出地图时,删除测距显示点
|
|
389
395
|
if (t.rangingTool.isRanging) {
|
|
390
|
-
t.removeGraphic(
|
|
396
|
+
t.removeGraphic("vtx-g-rang-showRangTool", "point");
|
|
391
397
|
}
|
|
392
398
|
});
|
|
393
399
|
//地图鼠标移动事件
|
|
394
|
-
t.state.gis.on(
|
|
400
|
+
t.state.gis.on("mouse-move", function (e) {
|
|
395
401
|
//鼠标移动地图时,删除测距显示点
|
|
396
402
|
if (t.rangingTool.isRanging) {
|
|
397
403
|
//获取测距提示点位
|
|
398
|
-
var rp = _objectSpread({}, t.GM.getGraphicParam(
|
|
404
|
+
var rp = _objectSpread({}, t.GM.getGraphicParam("vtx-g-rang-showRangTool").attributes);
|
|
399
405
|
//删除多余数据,避免other层级太多
|
|
400
406
|
delete rp.other;
|
|
401
407
|
var rcontent = rp.markerContent;
|
|
@@ -407,16 +413,16 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
407
413
|
rcontent = "\n <div class='vtx-g-rang-showRangTool'>\n <div>".concat(distext, "</div>\n <div>\u5355\u51FB\u786E\u5B9A\u5730\u70B9,\u53CC\u51FB\u7ED3\u675F</div>\n </div>\n ");
|
|
408
414
|
//测距移动的线
|
|
409
415
|
var sl = {
|
|
410
|
-
id:
|
|
416
|
+
id: "vtx-g-rang-showRangTool-line",
|
|
411
417
|
paths: [[t.rangingTool.points[t.rangingTool.points.length - 1].longitude, t.rangingTool.points[t.rangingTool.points.length - 1].latitude], [e.mapPoint.x, e.mapPoint.y]],
|
|
412
418
|
config: {
|
|
413
|
-
color:
|
|
419
|
+
color: "#ff0000",
|
|
414
420
|
lineWidth: 2,
|
|
415
|
-
lineType:
|
|
421
|
+
lineType: "solid",
|
|
416
422
|
pellucidity: 0.5
|
|
417
423
|
}
|
|
418
424
|
};
|
|
419
|
-
if (!t.GM.getGraphic(
|
|
425
|
+
if (!t.GM.getGraphic("vtx-g-rang-showRangTool-line")) {
|
|
420
426
|
t.addLine([sl]);
|
|
421
427
|
} else {
|
|
422
428
|
t.updateLine([sl]);
|
|
@@ -438,12 +444,12 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
438
444
|
}
|
|
439
445
|
});
|
|
440
446
|
//地图双击事件
|
|
441
|
-
t.state.gis.on(
|
|
447
|
+
t.state.gis.on("dbl-click", function (e) {
|
|
442
448
|
/*测距功能*/
|
|
443
|
-
rangingToolFun(e,
|
|
449
|
+
rangingToolFun(e, "dbl");
|
|
444
450
|
});
|
|
445
451
|
//地图点击事件
|
|
446
|
-
t.state.gis.on(
|
|
452
|
+
t.state.gis.on("click", function (e) {
|
|
447
453
|
var t = _this2;
|
|
448
454
|
/*测距功能*/
|
|
449
455
|
rangingToolFun(e);
|
|
@@ -451,15 +457,15 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
451
457
|
t.clickMap(e);
|
|
452
458
|
});
|
|
453
459
|
//鼠标拖拽开始事件
|
|
454
|
-
t.state.gis.on(
|
|
460
|
+
t.state.gis.on("mouse-drag-start", function (e) {
|
|
455
461
|
t.dragMapStart(e);
|
|
456
462
|
});
|
|
457
463
|
//鼠标拖拽结束事件
|
|
458
|
-
t.state.gis.on(
|
|
464
|
+
t.state.gis.on("mouse-drag-end", function (e) {
|
|
459
465
|
t.dragMapEnd(e);
|
|
460
466
|
});
|
|
461
467
|
//1.地图移动事件
|
|
462
|
-
t.state.gis.on(
|
|
468
|
+
t.state.gis.on("pan", function (e) {
|
|
463
469
|
//切换html图层位置
|
|
464
470
|
$("#".concat(t.htmlPointsId)).css({
|
|
465
471
|
top: t.labelLayer.y + e.delta.y,
|
|
@@ -474,11 +480,11 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
474
480
|
}
|
|
475
481
|
});
|
|
476
482
|
//地图拖动开始
|
|
477
|
-
t.state.gis.on(
|
|
483
|
+
t.state.gis.on("pan-start", function (e) {
|
|
478
484
|
t.moveStart(e);
|
|
479
485
|
});
|
|
480
486
|
//地图拖动结束
|
|
481
|
-
t.state.gis.on(
|
|
487
|
+
t.state.gis.on("pan-end", function (e) {
|
|
482
488
|
t.moveEnd(e);
|
|
483
489
|
//聚合点位id存在,则执行聚合运算
|
|
484
490
|
if (t.clusterMarkers.length > 0) {
|
|
@@ -494,8 +500,8 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
494
500
|
}
|
|
495
501
|
//记录html图层位置
|
|
496
502
|
t.labelLayer = {
|
|
497
|
-
x: eval($("#".concat(t.htmlPointsId)).css(
|
|
498
|
-
y: eval($("#".concat(t.htmlPointsId)).css(
|
|
503
|
+
x: eval($("#".concat(t.htmlPointsId)).css("left").replace("px", "")),
|
|
504
|
+
y: eval($("#".concat(t.htmlPointsId)).css("top").replace("px", ""))
|
|
499
505
|
};
|
|
500
506
|
//html点位 根据地图移动和zoom计算位置
|
|
501
507
|
changeLabel();
|
|
@@ -513,22 +519,22 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
513
519
|
}
|
|
514
520
|
});
|
|
515
521
|
// 地图zoom开始
|
|
516
|
-
t.state.gis.on(
|
|
522
|
+
t.state.gis.on("zoom-start", function (e) {
|
|
517
523
|
t.zoomStart(e);
|
|
518
524
|
//隐藏label根节点
|
|
519
525
|
$("#".concat(t.htmlPointsId)).css({
|
|
520
|
-
display:
|
|
526
|
+
display: "none"
|
|
521
527
|
});
|
|
522
528
|
//海量点dom
|
|
523
529
|
$("#".concat(t.pointCollectionId)).css({
|
|
524
|
-
display:
|
|
530
|
+
display: "none"
|
|
525
531
|
});
|
|
526
532
|
if (t.heatmap && !t.isHideHeatMap) {
|
|
527
533
|
t.heatmap.hide();
|
|
528
534
|
}
|
|
529
535
|
});
|
|
530
536
|
// 地图zoom结束
|
|
531
|
-
t.state.gis.on(
|
|
537
|
+
t.state.gis.on("zoom-end", function (e) {
|
|
532
538
|
t.zoomEnd(e);
|
|
533
539
|
//聚合点位id存在,则执行聚合运算
|
|
534
540
|
if (t.clusterMarkers.length > 0) {
|
|
@@ -536,11 +542,11 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
536
542
|
}
|
|
537
543
|
//显示label根节点
|
|
538
544
|
$("#".concat(t.htmlPointsId)).css({
|
|
539
|
-
display:
|
|
545
|
+
display: "inline-block"
|
|
540
546
|
});
|
|
541
547
|
//海量点dom
|
|
542
548
|
$("#".concat(t.pointCollectionId)).css({
|
|
543
|
-
display:
|
|
549
|
+
display: "inline-block"
|
|
544
550
|
});
|
|
545
551
|
//刷新label点位位置
|
|
546
552
|
changeLabel();
|
|
@@ -597,33 +603,33 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
597
603
|
});
|
|
598
604
|
//2.图元事件
|
|
599
605
|
//图元点击事件
|
|
600
|
-
t.state.gis.graphics.on(
|
|
606
|
+
t.state.gis.graphics.on("click", function (e) {
|
|
601
607
|
if (!e.graphic.attributes) {
|
|
602
608
|
return;
|
|
603
609
|
}
|
|
604
610
|
var gid = e.graphic.attributes.id;
|
|
605
611
|
//聚合点位不执行 图元事件
|
|
606
|
-
if (gid ==
|
|
612
|
+
if (gid == "vtx-clusterPoint") {
|
|
607
613
|
t.setVisiblePoints({
|
|
608
614
|
fitView: e.graphic.attributes.ids
|
|
609
615
|
});
|
|
610
616
|
return false;
|
|
611
617
|
}
|
|
612
618
|
t.clickGraphic(gid, e);
|
|
613
|
-
if (_typeof(e.graphic.attributes) ==
|
|
619
|
+
if (_typeof(e.graphic.attributes) == "object") {
|
|
614
620
|
//点击图元的id
|
|
615
621
|
//判断是否点击的测距关闭点位
|
|
616
|
-
if (gid && gid.indexOf(
|
|
622
|
+
if (gid && gid.indexOf("vtx_g_rang_end") > -1) {
|
|
617
623
|
var index = t.GM.getGraphicParam(gid).attributes.index;
|
|
618
624
|
var ls = t.rangingTools[index].line,
|
|
619
625
|
ps = t.rangingTools[index].points;
|
|
620
626
|
//删除测距线
|
|
621
|
-
t.removeGraphic(ls.id,
|
|
627
|
+
t.removeGraphic(ls.id, "line");
|
|
622
628
|
//删除关闭点
|
|
623
|
-
t.removeGraphic(gid,
|
|
629
|
+
t.removeGraphic(gid, "point");
|
|
624
630
|
//删除中间点
|
|
625
631
|
for (var i = 0; i < ps.length; i++) {
|
|
626
|
-
t.removeGraphic(ps[i].id,
|
|
632
|
+
t.removeGraphic(ps[i].id, "point");
|
|
627
633
|
}
|
|
628
634
|
//清除测距数据缓存
|
|
629
635
|
delete t.rangingTools[index];
|
|
@@ -631,25 +637,25 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
631
637
|
}
|
|
632
638
|
});
|
|
633
639
|
//图元鼠标移入事件
|
|
634
|
-
t.state.gis.graphics.on(
|
|
640
|
+
t.state.gis.graphics.on("mouse-over", function (e) {
|
|
635
641
|
if (!e.graphic.attributes) {
|
|
636
642
|
return;
|
|
637
643
|
}
|
|
638
644
|
var gid = e.graphic.attributes.id;
|
|
639
645
|
//聚合点位不执行 图元事件
|
|
640
|
-
if (gid ==
|
|
646
|
+
if (gid == "vtx-clusterPoint") {
|
|
641
647
|
return false;
|
|
642
648
|
}
|
|
643
649
|
t.mouseOverGraphic(gid, e);
|
|
644
650
|
});
|
|
645
651
|
//图元鼠标移除事件
|
|
646
|
-
t.state.gis.graphics.on(
|
|
652
|
+
t.state.gis.graphics.on("mouse-out", function (e) {
|
|
647
653
|
if (!e.graphic.attributes) {
|
|
648
654
|
return;
|
|
649
655
|
}
|
|
650
656
|
var gid = e.graphic.attributes.id;
|
|
651
657
|
//聚合点位不执行 图元事件
|
|
652
|
-
if (gid ==
|
|
658
|
+
if (gid == "vtx-clusterPoint") {
|
|
653
659
|
return false;
|
|
654
660
|
}
|
|
655
661
|
t.mouseOutGraphic(gid, e);
|
|
@@ -658,7 +664,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
658
664
|
//graphics对象存在 直接处理数据,不存在 通过load事件等待
|
|
659
665
|
if (t.state.gis.graphics) {
|
|
660
666
|
$("#".concat(t.props.mapId, "_gc")).css({
|
|
661
|
-
|
|
667
|
+
"z-index": 1
|
|
662
668
|
});
|
|
663
669
|
//添加自定义图元 图层
|
|
664
670
|
$("#".concat(t.props.mapId, "_layers")).append("<div id=".concat(t.htmlPointsId, " class='vtx_gmap_html_points' ></div>"));
|
|
@@ -666,7 +672,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
666
672
|
$("#".concat(t.props.mapId, "_layers")).append("<div id=".concat(t.pointCollectionId, " class='vtx_gmap_html_pointCollection' ></div>"));
|
|
667
673
|
//隐藏比例尺控制 (便于后期控制显示)
|
|
668
674
|
$("#".concat(t.props.mapId, "_zoom_slider")).css({
|
|
669
|
-
display:
|
|
675
|
+
display: "none"
|
|
670
676
|
});
|
|
671
677
|
//事件监听
|
|
672
678
|
event();
|
|
@@ -674,9 +680,9 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
674
680
|
//处理数据
|
|
675
681
|
initData();
|
|
676
682
|
}
|
|
677
|
-
t.state.gis.on(
|
|
683
|
+
t.state.gis.on("load", function () {
|
|
678
684
|
$("#".concat(t.props.mapId, "_gc")).css({
|
|
679
|
-
|
|
685
|
+
"z-index": 1
|
|
680
686
|
});
|
|
681
687
|
//添加自定义图元 图层
|
|
682
688
|
$("#".concat(t.props.mapId, "_layers")).append("<div id=".concat(t.htmlPointsId, " class='vtx_gmap_html_points' ></div>"));
|
|
@@ -684,7 +690,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
684
690
|
$("#".concat(t.props.mapId, "_layers")).append("<div id=".concat(t.pointCollectionId, " class='vtx_gmap_html_pointCollection' ></div>"));
|
|
685
691
|
//隐藏比例尺控制 (便于后期控制显示)
|
|
686
692
|
$("#".concat(t.props.mapId, "_zoom_slider")).css({
|
|
687
|
-
display:
|
|
693
|
+
display: "none"
|
|
688
694
|
});
|
|
689
695
|
//事件监听
|
|
690
696
|
event();
|
|
@@ -729,7 +735,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
729
735
|
logo: false,
|
|
730
736
|
isKeyboardNavigation: false,
|
|
731
737
|
showAttribution: true,
|
|
732
|
-
backgroundColor:
|
|
738
|
+
backgroundColor: "#f1f1f1",
|
|
733
739
|
extent: new esri.geometry.Extent(_objectSpread(_objectSpread({}, fullExtent), {}, {
|
|
734
740
|
spatialReference: _defineProperty({}, t.wkidStr, t.wkid)
|
|
735
741
|
}))
|
|
@@ -756,26 +762,26 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
756
762
|
var url = services[im].url;
|
|
757
763
|
//从新加载图层
|
|
758
764
|
switch (services[im].type) {
|
|
759
|
-
case
|
|
765
|
+
case "gis":
|
|
760
766
|
for (var i = 0; i < url.length; i++) {
|
|
761
|
-
var basemap = new esri.layers[services[im].gisServer ||
|
|
767
|
+
var basemap = new esri.layers[services[im].gisServer || "ArcGISTiledMapServiceLayer"](url[i]);
|
|
762
768
|
servs.push(basemap);
|
|
763
769
|
}
|
|
764
770
|
break;
|
|
765
|
-
case
|
|
771
|
+
case "wmts":
|
|
766
772
|
for (var _i = 0; _i < url.length; _i++) {
|
|
767
773
|
var tileInfo = new esri.layers.TileInfo({
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
774
|
+
dpi: 96,
|
|
775
|
+
format: services[im].format || "format/png",
|
|
776
|
+
compressionQuality: 0,
|
|
777
|
+
spatialReference: new esri.SpatialReference(_defineProperty({}, t.wkidStr, t.wkid || 4326)),
|
|
778
|
+
rows: 256,
|
|
779
|
+
cols: 256,
|
|
780
|
+
origin: mapServer.origin || {
|
|
775
781
|
x: -180,
|
|
776
782
|
y: 90
|
|
777
783
|
},
|
|
778
|
-
|
|
784
|
+
lods: mapServer.lods || []
|
|
779
785
|
});
|
|
780
786
|
var tileExtent = new esri.geometry.Extent(mapServer.fullExtent.xmin, mapServer.fullExtent.ymin, mapServer.fullExtent.xmax, mapServer.fullExtent.ymax, new esri.SpatialReference(_defineProperty({}, t.wkidStr, t.wkid)));
|
|
781
787
|
var inTileExtent = new esri.geometry.Extent(mapServer.initialExtent.xmin, mapServer.initialExtent.ymin, mapServer.initialExtent.xmax, mapServer.initialExtent.ymax, new esri.SpatialReference(_defineProperty({}, t.wkidStr, t.wkid)));
|
|
@@ -791,7 +797,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
791
797
|
var resourceInfo = {
|
|
792
798
|
version: "1.0.0",
|
|
793
799
|
layerInfos: [layerInfo],
|
|
794
|
-
copyright:
|
|
800
|
+
copyright: ""
|
|
795
801
|
};
|
|
796
802
|
var options = {
|
|
797
803
|
serviceMode: "KVP",
|
|
@@ -799,38 +805,38 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
799
805
|
layerInfo: layerInfo
|
|
800
806
|
};
|
|
801
807
|
var wmtsLayer = new esri.layers.WMTSLayer(url[_i], options);
|
|
802
|
-
wmtsLayer.UrlTemplate = wmtsLayer.UrlTemplate.replace(wmtsLayer.UrlTemplate.substring(wmtsLayer.UrlTemplate.indexOf(
|
|
803
|
-
wmtsLayer.UrlTemplate = wmtsLayer.UrlTemplate.replace(
|
|
804
|
-
wmtsLayer.UrlTemplate = wmtsLayer.UrlTemplate.replace(
|
|
805
|
-
wmtsLayer.UrlTemplate = wmtsLayer.UrlTemplate.replace(
|
|
806
|
-
wmtsLayer.UrlTemplate = wmtsLayer.UrlTemplate.replace(
|
|
807
|
-
wmtsLayer.UrlTemplate = wmtsLayer.UrlTemplate.replace(
|
|
808
|
-
wmtsLayer.UrlTemplate = wmtsLayer.UrlTemplate.replace(
|
|
809
|
-
wmtsLayer.UrlTemplate = wmtsLayer.UrlTemplate.replace(
|
|
810
|
-
wmtsLayer.UrlTemplate = wmtsLayer.UrlTemplate.replace(
|
|
811
|
-
wmtsLayer.UrlTemplate = wmtsLayer.UrlTemplate.replace(
|
|
812
|
-
wmtsLayer.UrlTemplate = wmtsLayer.UrlTemplate.replace(
|
|
808
|
+
wmtsLayer.UrlTemplate = wmtsLayer.UrlTemplate.replace(wmtsLayer.UrlTemplate.substring(wmtsLayer.UrlTemplate.indexOf("&FORMAT"), wmtsLayer.UrlTemplate.indexOf("&TILEMATRIXSET")), "&FORMAT=".concat(services[im].format || "format/png"));
|
|
809
|
+
wmtsLayer.UrlTemplate = wmtsLayer.UrlTemplate.replace("SERVICE", "service");
|
|
810
|
+
wmtsLayer.UrlTemplate = wmtsLayer.UrlTemplate.replace("&VERSION", "&version");
|
|
811
|
+
wmtsLayer.UrlTemplate = wmtsLayer.UrlTemplate.replace("&REQUEST", "&request");
|
|
812
|
+
wmtsLayer.UrlTemplate = wmtsLayer.UrlTemplate.replace("&LAYER", "&layer");
|
|
813
|
+
wmtsLayer.UrlTemplate = wmtsLayer.UrlTemplate.replace("&STYLE", "&format");
|
|
814
|
+
wmtsLayer.UrlTemplate = wmtsLayer.UrlTemplate.replace("&FORMAT", "&style");
|
|
815
|
+
wmtsLayer.UrlTemplate = wmtsLayer.UrlTemplate.replace("&TILEMATRIXSET", "&tileMatrixSet");
|
|
816
|
+
wmtsLayer.UrlTemplate = wmtsLayer.UrlTemplate.replace("&TILEMATRIX", "&tileMatrix");
|
|
817
|
+
wmtsLayer.UrlTemplate = wmtsLayer.UrlTemplate.replace("&TILEROW", "&tileRow");
|
|
818
|
+
wmtsLayer.UrlTemplate = wmtsLayer.UrlTemplate.replace("&TILECOL", "&tileCol");
|
|
813
819
|
servs.push(wmtsLayer);
|
|
814
820
|
}
|
|
815
821
|
break;
|
|
816
822
|
}
|
|
817
823
|
}
|
|
818
824
|
if (services.length <= 0) {
|
|
819
|
-
console.warn(
|
|
825
|
+
console.warn("!warning 图层服务必选,或图层类型暂不支持,默认天地图浙江地理wmts图层服务!");
|
|
820
826
|
for (var _im = 0; _im < _MapToolFunction.defaultWmtsMapLayers.services.length; _im++) {
|
|
821
827
|
var _url = _MapToolFunction.defaultWmtsMapLayers.services[_im].url;
|
|
822
828
|
var dtileInfo = new esri.layers.TileInfo({
|
|
823
|
-
|
|
829
|
+
dpi: 96,
|
|
824
830
|
// "format": "tiles",
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
831
|
+
compressionQuality: 0,
|
|
832
|
+
spatialReference: new esri.SpatialReference(_defineProperty({}, t.wkidStr, t.wkid || 4326)),
|
|
833
|
+
rows: 256,
|
|
834
|
+
cols: 256,
|
|
835
|
+
origin: _MapToolFunction.defaultWmtsMapLayers.origin || {
|
|
830
836
|
x: -180,
|
|
831
837
|
y: 90
|
|
832
838
|
},
|
|
833
|
-
|
|
839
|
+
lods: _MapToolFunction.defaultWmtsMapLayers.lods || []
|
|
834
840
|
});
|
|
835
841
|
var dtileExtent = new esri.geometry.Extent(_MapToolFunction.defaultWmtsMapLayers.fullExtent.xmin, _MapToolFunction.defaultWmtsMapLayers.fullExtent.ymin, _MapToolFunction.defaultWmtsMapLayers.fullExtent.xmax, _MapToolFunction.defaultWmtsMapLayers.fullExtent.ymax, new esri.SpatialReference(_defineProperty({}, t.wkidStr, t.wkid)));
|
|
836
842
|
var dinTileExtent = new esri.geometry.Extent(_MapToolFunction.defaultWmtsMapLayers.initialExtent.xmin, _MapToolFunction.defaultWmtsMapLayers.initialExtent.ymin, _MapToolFunction.defaultWmtsMapLayers.initialExtent.xmax, _MapToolFunction.defaultWmtsMapLayers.initialExtent.ymax, new esri.SpatialReference(_defineProperty({}, t.wkidStr, t.wkid)));
|
|
@@ -847,7 +853,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
847
853
|
var dresourceInfo = {
|
|
848
854
|
version: "1.0.0",
|
|
849
855
|
layerInfos: [dlayerInfo],
|
|
850
|
-
copyright:
|
|
856
|
+
copyright: ""
|
|
851
857
|
};
|
|
852
858
|
var doptions = {
|
|
853
859
|
serviceMode: "KVP",
|
|
@@ -855,17 +861,17 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
855
861
|
layerInfo: dlayerInfo
|
|
856
862
|
};
|
|
857
863
|
var _wmtsLayer = new esri.layers.WMTSLayer(_url[_i2], doptions);
|
|
858
|
-
_wmtsLayer.UrlTemplate = _wmtsLayer.UrlTemplate.replace(_wmtsLayer.UrlTemplate.substr(_wmtsLayer.UrlTemplate.indexOf(
|
|
859
|
-
_wmtsLayer.UrlTemplate = _wmtsLayer.UrlTemplate.replace(
|
|
860
|
-
_wmtsLayer.UrlTemplate = _wmtsLayer.UrlTemplate.replace(
|
|
861
|
-
_wmtsLayer.UrlTemplate = _wmtsLayer.UrlTemplate.replace(
|
|
862
|
-
_wmtsLayer.UrlTemplate = _wmtsLayer.UrlTemplate.replace(
|
|
863
|
-
_wmtsLayer.UrlTemplate = _wmtsLayer.UrlTemplate.replace(
|
|
864
|
-
_wmtsLayer.UrlTemplate = _wmtsLayer.UrlTemplate.replace(
|
|
865
|
-
_wmtsLayer.UrlTemplate = _wmtsLayer.UrlTemplate.replace(
|
|
866
|
-
_wmtsLayer.UrlTemplate = _wmtsLayer.UrlTemplate.replace(
|
|
867
|
-
_wmtsLayer.UrlTemplate = _wmtsLayer.UrlTemplate.replace(
|
|
868
|
-
_wmtsLayer.UrlTemplate = _wmtsLayer.UrlTemplate.replace(
|
|
864
|
+
_wmtsLayer.UrlTemplate = _wmtsLayer.UrlTemplate.replace(_wmtsLayer.UrlTemplate.substr(_wmtsLayer.UrlTemplate.indexOf("&FORMAT="), _wmtsLayer.UrlTemplate.substr(_wmtsLayer.UrlTemplate.indexOf("&FORMAT=") + 1).indexOf("&") + 1), "&FORMAT=".concat(_MapToolFunction.defaultWmtsMapLayers.services[_im].format || "format/png"));
|
|
865
|
+
_wmtsLayer.UrlTemplate = _wmtsLayer.UrlTemplate.replace("SERVICE", "service");
|
|
866
|
+
_wmtsLayer.UrlTemplate = _wmtsLayer.UrlTemplate.replace("&VERSION", "&version");
|
|
867
|
+
_wmtsLayer.UrlTemplate = _wmtsLayer.UrlTemplate.replace("&REQUEST", "&request");
|
|
868
|
+
_wmtsLayer.UrlTemplate = _wmtsLayer.UrlTemplate.replace("&LAYER", "&layer");
|
|
869
|
+
_wmtsLayer.UrlTemplate = _wmtsLayer.UrlTemplate.replace("&STYLE", "&format");
|
|
870
|
+
_wmtsLayer.UrlTemplate = _wmtsLayer.UrlTemplate.replace("&FORMAT", "&style");
|
|
871
|
+
_wmtsLayer.UrlTemplate = _wmtsLayer.UrlTemplate.replace("&TILEMATRIXSET", "&tileMatrixSet");
|
|
872
|
+
_wmtsLayer.UrlTemplate = _wmtsLayer.UrlTemplate.replace("&TILEMATRIX", "&tileMatrix");
|
|
873
|
+
_wmtsLayer.UrlTemplate = _wmtsLayer.UrlTemplate.replace("&TILEROW", "&tileRow");
|
|
874
|
+
_wmtsLayer.UrlTemplate = _wmtsLayer.UrlTemplate.replace("&TILECOL", "&tileCol");
|
|
869
875
|
servs.push(_wmtsLayer);
|
|
870
876
|
}
|
|
871
877
|
}
|
|
@@ -882,7 +888,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
882
888
|
var t = this;
|
|
883
889
|
var psids = _toConsumableArray(t.state.pointIds);
|
|
884
890
|
//添加绘制点
|
|
885
|
-
if (type && type !==
|
|
891
|
+
if (type && type !== "defined") {
|
|
886
892
|
psids = _toConsumableArray(t.state.drawIds[type]);
|
|
887
893
|
}
|
|
888
894
|
mapPoints.map(function (item, index) {
|
|
@@ -899,7 +905,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
899
905
|
var cg = {
|
|
900
906
|
width: 30,
|
|
901
907
|
height: 30,
|
|
902
|
-
labelContent:
|
|
908
|
+
labelContent: "",
|
|
903
909
|
labelPixelX: 0,
|
|
904
910
|
labelPixelY: 34,
|
|
905
911
|
BAnimationType: 3,
|
|
@@ -934,7 +940,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
934
940
|
if (item.markerContent) {
|
|
935
941
|
//html点位
|
|
936
942
|
//添加透明点(便于事件处理)
|
|
937
|
-
var markerSymbol = new esri.symbol.PictureMarkerSymbol("".concat(_default2
|
|
943
|
+
var markerSymbol = new esri.symbol.PictureMarkerSymbol("".concat(_default2.default.mapServerURL, "/images/touming.png"), cg.width, cg.height);
|
|
938
944
|
//设置偏移点的位置到左上角(原来在中心)
|
|
939
945
|
markerSymbol.setOffset(cg.markerContentX + cg.width / 2, -(cg.markerContentY + cg.height / 2));
|
|
940
946
|
marker = new esri.Graphic(position, markerSymbol, {
|
|
@@ -951,7 +957,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
951
957
|
};
|
|
952
958
|
} else {
|
|
953
959
|
//图片点位
|
|
954
|
-
var _markerSymbol = new esri.symbol.PictureMarkerSymbol(item.url || "".concat(_default2
|
|
960
|
+
var _markerSymbol = new esri.symbol.PictureMarkerSymbol(item.url || "".concat(_default2.default.mapServerURL, "/images/defaultMarker.png"), cg.width, cg.height);
|
|
955
961
|
_markerSymbol.setAngle(cg.deg);
|
|
956
962
|
//设置偏移点的位置到左上角(原来在中心)
|
|
957
963
|
_markerSymbol.setOffset(cg.markerContentX + cg.width / 2, -(cg.markerContentY + cg.height / 2));
|
|
@@ -962,10 +968,10 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
962
968
|
//添加label
|
|
963
969
|
if (item.canShowLabel && cg.labelContent) {
|
|
964
970
|
//label默认样式
|
|
965
|
-
var labelClass =
|
|
971
|
+
var labelClass = "label-content";
|
|
966
972
|
//接受label自定义样式
|
|
967
973
|
if (item.labelClass) {
|
|
968
|
-
labelClass = item.labelClass.split(
|
|
974
|
+
labelClass = item.labelClass.split(",").join(" ");
|
|
969
975
|
}
|
|
970
976
|
//设置label的数据,用于label加点到地图
|
|
971
977
|
label = {
|
|
@@ -997,15 +1003,15 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
997
1003
|
attributes: _objectSpread(_objectSpread({}, item), {}, {
|
|
998
1004
|
other: item
|
|
999
1005
|
}),
|
|
1000
|
-
geometryType:
|
|
1006
|
+
geometryType: "point",
|
|
1001
1007
|
geometry: {
|
|
1002
|
-
type:
|
|
1008
|
+
type: "point",
|
|
1003
1009
|
x: item.longitude,
|
|
1004
1010
|
y: item.latitude
|
|
1005
1011
|
}
|
|
1006
1012
|
});
|
|
1007
1013
|
});
|
|
1008
|
-
if (type !==
|
|
1014
|
+
if (type !== "defined") {
|
|
1009
1015
|
//添加绘制点
|
|
1010
1016
|
if (type) {
|
|
1011
1017
|
t.state.drawIds = _objectSpread(_objectSpread({}, t.state.drawIds), {}, _defineProperty({}, type, psids));
|
|
@@ -1044,7 +1050,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1044
1050
|
var cg = {
|
|
1045
1051
|
width: 30,
|
|
1046
1052
|
height: 30,
|
|
1047
|
-
labelContent:
|
|
1053
|
+
labelContent: "",
|
|
1048
1054
|
labelPixelX: 0,
|
|
1049
1055
|
labelPixelY: 34,
|
|
1050
1056
|
BAnimationType: 3,
|
|
@@ -1078,7 +1084,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1078
1084
|
if (item.markerContent) {
|
|
1079
1085
|
//symbol 样式信息修改
|
|
1080
1086
|
if (gc.symbol) {
|
|
1081
|
-
gc.symbol.setUrl("".concat(_default2
|
|
1087
|
+
gc.symbol.setUrl("".concat(_default2.default.mapServerURL, "/images/touming.png"));
|
|
1082
1088
|
}
|
|
1083
1089
|
//设置markercontent的数据,用于label加点到地图
|
|
1084
1090
|
label = {
|
|
@@ -1092,16 +1098,16 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1092
1098
|
} else {
|
|
1093
1099
|
//symbol 样式信息修改
|
|
1094
1100
|
if (gc.symbol) {
|
|
1095
|
-
gc.symbol.setUrl(item.url || "".concat(_default2
|
|
1101
|
+
gc.symbol.setUrl(item.url || "".concat(_default2.default.mapServerURL, "/images/defaultMarker.png"));
|
|
1096
1102
|
}
|
|
1097
1103
|
gc.symbol.setAngle(cg.deg);
|
|
1098
1104
|
//添加label
|
|
1099
1105
|
if (item.canShowLabel && cg.labelContent) {
|
|
1100
1106
|
//label默认样式
|
|
1101
|
-
var labelClass =
|
|
1107
|
+
var labelClass = "label-content";
|
|
1102
1108
|
//接受label自定义样式
|
|
1103
1109
|
if (item.labelClass) {
|
|
1104
|
-
labelClass = item.labelClass.split(
|
|
1110
|
+
labelClass = item.labelClass.split(",").join(" ");
|
|
1105
1111
|
}
|
|
1106
1112
|
//设置label的数据,用于label加点到地图
|
|
1107
1113
|
label = {
|
|
@@ -1161,9 +1167,9 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1161
1167
|
attributes: _objectSpread(_objectSpread({}, item), {}, {
|
|
1162
1168
|
other: item
|
|
1163
1169
|
}),
|
|
1164
|
-
geometryType:
|
|
1170
|
+
geometryType: "point",
|
|
1165
1171
|
geometry: {
|
|
1166
|
-
type:
|
|
1172
|
+
type: "point",
|
|
1167
1173
|
x: item.longitude,
|
|
1168
1174
|
y: item.latitude
|
|
1169
1175
|
}
|
|
@@ -1182,7 +1188,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1182
1188
|
value: function addLine(mapLines, type) {
|
|
1183
1189
|
var t = this;
|
|
1184
1190
|
var lsids = _toConsumableArray(t.state.lineIds);
|
|
1185
|
-
if (type && type !==
|
|
1191
|
+
if (type && type !== "defined") {
|
|
1186
1192
|
lsids = _toConsumableArray(t.state.drawIds[type]);
|
|
1187
1193
|
}
|
|
1188
1194
|
//遍历添加线(图元)
|
|
@@ -1199,10 +1205,10 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1199
1205
|
}
|
|
1200
1206
|
//初始化默认参数
|
|
1201
1207
|
var cg = {
|
|
1202
|
-
color:
|
|
1208
|
+
color: "#277ffa",
|
|
1203
1209
|
pellucidity: 0.9,
|
|
1204
1210
|
lineWidth: 5,
|
|
1205
|
-
lineType:
|
|
1211
|
+
lineType: "solid",
|
|
1206
1212
|
isHidden: false
|
|
1207
1213
|
};
|
|
1208
1214
|
//合并参数
|
|
@@ -1219,10 +1225,10 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1219
1225
|
//线类型
|
|
1220
1226
|
var style = esri.symbol.SimpleLineSymbol.STYLE_SOLID;
|
|
1221
1227
|
switch (cg.lineType) {
|
|
1222
|
-
case
|
|
1228
|
+
case "solid":
|
|
1223
1229
|
style = esri.symbol.SimpleLineSymbol.STYLE_SOLID;
|
|
1224
1230
|
break;
|
|
1225
|
-
case
|
|
1231
|
+
case "dashed":
|
|
1226
1232
|
style = esri.symbol.SimpleLineSymbol.STYLE_DASH;
|
|
1227
1233
|
break;
|
|
1228
1234
|
}
|
|
@@ -1250,14 +1256,14 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1250
1256
|
paths: item.paths,
|
|
1251
1257
|
other: item
|
|
1252
1258
|
}),
|
|
1253
|
-
geometryType:
|
|
1259
|
+
geometryType: "polyline",
|
|
1254
1260
|
geometry: {
|
|
1255
|
-
type:
|
|
1261
|
+
type: "polyline",
|
|
1256
1262
|
paths: item.paths
|
|
1257
1263
|
}
|
|
1258
1264
|
});
|
|
1259
1265
|
});
|
|
1260
|
-
if (type !==
|
|
1266
|
+
if (type !== "defined") {
|
|
1261
1267
|
//添加绘制点
|
|
1262
1268
|
if (type) {
|
|
1263
1269
|
t.state.drawIds = _objectSpread(_objectSpread({}, t.state.drawIds), {}, _defineProperty({}, type, lsids));
|
|
@@ -1296,10 +1302,10 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1296
1302
|
var gc = t.GM.getGraphic(item.id);
|
|
1297
1303
|
//初始化默认参数
|
|
1298
1304
|
var cg = {
|
|
1299
|
-
color:
|
|
1305
|
+
color: "#277ffa",
|
|
1300
1306
|
pellucidity: 0.9,
|
|
1301
1307
|
lineWidth: 5,
|
|
1302
|
-
lineType:
|
|
1308
|
+
lineType: "solid",
|
|
1303
1309
|
//'solid' 'dashed'
|
|
1304
1310
|
isHidden: false
|
|
1305
1311
|
};
|
|
@@ -1326,10 +1332,10 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1326
1332
|
//设置线类型
|
|
1327
1333
|
var style = esri.symbol.SimpleLineSymbol.STYLE_SOLID;
|
|
1328
1334
|
switch (cg.lineType) {
|
|
1329
|
-
case
|
|
1335
|
+
case "solid":
|
|
1330
1336
|
style = esri.symbol.SimpleLineSymbol.STYLE_SOLID;
|
|
1331
1337
|
break;
|
|
1332
|
-
case
|
|
1338
|
+
case "dashed":
|
|
1333
1339
|
style = esri.symbol.SimpleLineSymbol.STYLE_DASH;
|
|
1334
1340
|
break;
|
|
1335
1341
|
}
|
|
@@ -1347,9 +1353,9 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1347
1353
|
paths: item.paths,
|
|
1348
1354
|
other: item
|
|
1349
1355
|
}),
|
|
1350
|
-
geometryType:
|
|
1356
|
+
geometryType: "polyline",
|
|
1351
1357
|
geometry: {
|
|
1352
|
-
type:
|
|
1358
|
+
type: "polyline",
|
|
1353
1359
|
paths: item.paths
|
|
1354
1360
|
}
|
|
1355
1361
|
});
|
|
@@ -1380,11 +1386,11 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1380
1386
|
}
|
|
1381
1387
|
//初始化参数
|
|
1382
1388
|
var cg = {
|
|
1383
|
-
lineType:
|
|
1389
|
+
lineType: "solid",
|
|
1384
1390
|
lineWidth: 5,
|
|
1385
|
-
lineColor:
|
|
1391
|
+
lineColor: "#277ffa",
|
|
1386
1392
|
lineOpacity: 1,
|
|
1387
|
-
color:
|
|
1393
|
+
color: "#fff",
|
|
1388
1394
|
pellucidity: 0.5
|
|
1389
1395
|
// isHidden: false //后期需要再加
|
|
1390
1396
|
};
|
|
@@ -1406,10 +1412,10 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1406
1412
|
//线类型
|
|
1407
1413
|
var lineStyle = esri.symbol.SimpleLineSymbol.STYLE_SOLID;
|
|
1408
1414
|
switch (cg.lineType) {
|
|
1409
|
-
case
|
|
1415
|
+
case "solid":
|
|
1410
1416
|
lineStyle = esri.symbol.SimpleLineSymbol.STYLE_SOLID;
|
|
1411
1417
|
break;
|
|
1412
|
-
case
|
|
1418
|
+
case "dashed":
|
|
1413
1419
|
lineStyle = esri.symbol.SimpleLineSymbol.STYLE_DASH;
|
|
1414
1420
|
break;
|
|
1415
1421
|
}
|
|
@@ -1440,9 +1446,9 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1440
1446
|
rings: item.rings,
|
|
1441
1447
|
other: item
|
|
1442
1448
|
}),
|
|
1443
|
-
geometryType:
|
|
1449
|
+
geometryType: "polygon",
|
|
1444
1450
|
geometry: {
|
|
1445
|
-
type:
|
|
1451
|
+
type: "polygon",
|
|
1446
1452
|
rings: item.rings
|
|
1447
1453
|
}
|
|
1448
1454
|
});
|
|
@@ -1484,11 +1490,11 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1484
1490
|
var gc = t.GM.getGraphic(item.id);
|
|
1485
1491
|
//初始化参数
|
|
1486
1492
|
var cg = {
|
|
1487
|
-
lineType:
|
|
1493
|
+
lineType: "solid",
|
|
1488
1494
|
lineWidth: 5,
|
|
1489
|
-
lineColor:
|
|
1495
|
+
lineColor: "#277ffa",
|
|
1490
1496
|
lineOpacity: 1,
|
|
1491
|
-
color:
|
|
1497
|
+
color: "#fff",
|
|
1492
1498
|
pellucidity: 0.5
|
|
1493
1499
|
// isHidden: false //后期需要再加
|
|
1494
1500
|
};
|
|
@@ -1515,10 +1521,10 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1515
1521
|
//线类型
|
|
1516
1522
|
var lineStyle = esri.symbol.SimpleLineSymbol.STYLE_SOLID;
|
|
1517
1523
|
switch (cg.lineType) {
|
|
1518
|
-
case
|
|
1524
|
+
case "solid":
|
|
1519
1525
|
lineStyle = esri.symbol.SimpleLineSymbol.STYLE_SOLID;
|
|
1520
1526
|
break;
|
|
1521
|
-
case
|
|
1527
|
+
case "dashed":
|
|
1522
1528
|
lineStyle = esri.symbol.SimpleLineSymbol.STYLE_DASH;
|
|
1523
1529
|
break;
|
|
1524
1530
|
}
|
|
@@ -1538,9 +1544,9 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1538
1544
|
rings: item.rings,
|
|
1539
1545
|
other: item
|
|
1540
1546
|
}),
|
|
1541
|
-
geometryType:
|
|
1547
|
+
geometryType: "polygon",
|
|
1542
1548
|
geometry: {
|
|
1543
|
-
type:
|
|
1549
|
+
type: "polygon",
|
|
1544
1550
|
rings: item.rings
|
|
1545
1551
|
}
|
|
1546
1552
|
});
|
|
@@ -1569,11 +1575,11 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1569
1575
|
return false;
|
|
1570
1576
|
}
|
|
1571
1577
|
var cg = {
|
|
1572
|
-
lineType:
|
|
1578
|
+
lineType: "solid",
|
|
1573
1579
|
lineWidth: 5,
|
|
1574
|
-
lineColor:
|
|
1580
|
+
lineColor: "#277ffa",
|
|
1575
1581
|
lineOpacity: 1,
|
|
1576
|
-
color:
|
|
1582
|
+
color: "#fff",
|
|
1577
1583
|
pellucidity: 0.5
|
|
1578
1584
|
// isHidden: false //后期需要在加
|
|
1579
1585
|
};
|
|
@@ -1589,10 +1595,10 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1589
1595
|
//线类型
|
|
1590
1596
|
var lineStyle = esri.symbol.SimpleLineSymbol.STYLE_SOLID;
|
|
1591
1597
|
switch (cg.lineType) {
|
|
1592
|
-
case
|
|
1598
|
+
case "solid":
|
|
1593
1599
|
lineStyle = esri.symbol.SimpleLineSymbol.STYLE_SOLID;
|
|
1594
1600
|
break;
|
|
1595
|
-
case
|
|
1601
|
+
case "dashed":
|
|
1596
1602
|
lineStyle = esri.symbol.SimpleLineSymbol.STYLE_DASH;
|
|
1597
1603
|
break;
|
|
1598
1604
|
}
|
|
@@ -1621,9 +1627,9 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1621
1627
|
attributes: _objectSpread(_objectSpread({}, item), {}, {
|
|
1622
1628
|
other: item
|
|
1623
1629
|
}),
|
|
1624
|
-
geometryType:
|
|
1630
|
+
geometryType: "circle",
|
|
1625
1631
|
geometry: {
|
|
1626
|
-
type:
|
|
1632
|
+
type: "circle",
|
|
1627
1633
|
x: parseFloat(item.longitude),
|
|
1628
1634
|
y: parseFloat(item.latitude),
|
|
1629
1635
|
radius: parseFloat(item.radius)
|
|
@@ -1667,11 +1673,11 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1667
1673
|
var gc = t.GM.getGraphic(item.id);
|
|
1668
1674
|
//获取原有的面属性,转换key值
|
|
1669
1675
|
var cg = {
|
|
1670
|
-
lineType:
|
|
1676
|
+
lineType: "solid",
|
|
1671
1677
|
lineWidth: 5,
|
|
1672
|
-
lineColor:
|
|
1678
|
+
lineColor: "#277ffa",
|
|
1673
1679
|
lineOpacity: 1,
|
|
1674
|
-
color:
|
|
1680
|
+
color: "#fff",
|
|
1675
1681
|
pellucidity: 0.5
|
|
1676
1682
|
// isHidden: false //后期需要在加
|
|
1677
1683
|
};
|
|
@@ -1687,10 +1693,10 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1687
1693
|
//线类型
|
|
1688
1694
|
var lineStyle = esri.symbol.SimpleLineSymbol.STYLE_SOLID;
|
|
1689
1695
|
switch (cg.lineType) {
|
|
1690
|
-
case
|
|
1696
|
+
case "solid":
|
|
1691
1697
|
lineStyle = esri.symbol.SimpleLineSymbol.STYLE_SOLID;
|
|
1692
1698
|
break;
|
|
1693
|
-
case
|
|
1699
|
+
case "dashed":
|
|
1694
1700
|
lineStyle = esri.symbol.SimpleLineSymbol.STYLE_DASH;
|
|
1695
1701
|
break;
|
|
1696
1702
|
}
|
|
@@ -1715,9 +1721,9 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1715
1721
|
attributes: _objectSpread(_objectSpread({}, item), {}, {
|
|
1716
1722
|
other: item
|
|
1717
1723
|
}),
|
|
1718
|
-
geometryType:
|
|
1724
|
+
geometryType: "circle",
|
|
1719
1725
|
geometry: {
|
|
1720
|
-
type:
|
|
1726
|
+
type: "circle",
|
|
1721
1727
|
x: parseFloat(item.longitude),
|
|
1722
1728
|
y: parseFloat(item.latitude),
|
|
1723
1729
|
radius: parseFloat(item.radius)
|
|
@@ -1881,7 +1887,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1881
1887
|
var t = this;
|
|
1882
1888
|
//编辑中的图元关闭其他事件返回
|
|
1883
1889
|
if (t.state.editId == id) return false;
|
|
1884
|
-
if (typeof t.props.mouseOverGraphic ===
|
|
1890
|
+
if (typeof t.props.mouseOverGraphic === "function") {
|
|
1885
1891
|
var obj = {
|
|
1886
1892
|
e: e,
|
|
1887
1893
|
id: id,
|
|
@@ -1918,7 +1924,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1918
1924
|
key: "clickMap",
|
|
1919
1925
|
value: function clickMap(e) {
|
|
1920
1926
|
var t = this;
|
|
1921
|
-
if (typeof t.props.clickMap ===
|
|
1927
|
+
if (typeof t.props.clickMap === "function") {
|
|
1922
1928
|
var obj = t.getMapExtent();
|
|
1923
1929
|
obj.e = e;
|
|
1924
1930
|
obj.clickLngLat = {
|
|
@@ -1937,7 +1943,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1937
1943
|
key: "dragMapStart",
|
|
1938
1944
|
value: function dragMapStart(e) {
|
|
1939
1945
|
var t = this;
|
|
1940
|
-
if (typeof t.props.dragMapStart ===
|
|
1946
|
+
if (typeof t.props.dragMapStart === "function") {
|
|
1941
1947
|
var obj = t.getMapExtent();
|
|
1942
1948
|
obj.e = e;
|
|
1943
1949
|
t.props.dragMapStart(obj);
|
|
@@ -1948,7 +1954,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1948
1954
|
key: "dragMapEnd",
|
|
1949
1955
|
value: function dragMapEnd(e) {
|
|
1950
1956
|
var t = this;
|
|
1951
|
-
if (typeof t.props.dragMapEnd ===
|
|
1957
|
+
if (typeof t.props.dragMapEnd === "function") {
|
|
1952
1958
|
var obj = t.getMapExtent();
|
|
1953
1959
|
obj.e = e;
|
|
1954
1960
|
t.props.dragMapEnd(obj);
|
|
@@ -1959,7 +1965,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1959
1965
|
key: "moveStart",
|
|
1960
1966
|
value: function moveStart(e) {
|
|
1961
1967
|
var t = this;
|
|
1962
|
-
if (typeof t.props.moveStart ===
|
|
1968
|
+
if (typeof t.props.moveStart === "function") {
|
|
1963
1969
|
var obj = t.getMapExtent();
|
|
1964
1970
|
obj.e = e;
|
|
1965
1971
|
t.props.moveStart(obj);
|
|
@@ -1970,7 +1976,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1970
1976
|
key: "moveEnd",
|
|
1971
1977
|
value: function moveEnd(e) {
|
|
1972
1978
|
var t = this;
|
|
1973
|
-
if (typeof t.props.moveEnd ===
|
|
1979
|
+
if (typeof t.props.moveEnd === "function") {
|
|
1974
1980
|
var obj = t.getMapExtent();
|
|
1975
1981
|
obj.e = e;
|
|
1976
1982
|
t.props.moveEnd(obj);
|
|
@@ -1981,7 +1987,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1981
1987
|
key: "zoomStart",
|
|
1982
1988
|
value: function zoomStart(e) {
|
|
1983
1989
|
var t = this;
|
|
1984
|
-
if (typeof t.props.zoomStart ===
|
|
1990
|
+
if (typeof t.props.zoomStart === "function") {
|
|
1985
1991
|
var obj = t.getMapExtent();
|
|
1986
1992
|
obj.e = e;
|
|
1987
1993
|
t.props.zoomStart(obj);
|
|
@@ -1992,7 +1998,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1992
1998
|
key: "zoomEnd",
|
|
1993
1999
|
value: function zoomEnd(e) {
|
|
1994
2000
|
var t = this;
|
|
1995
|
-
if (typeof t.props.zoomEnd ===
|
|
2001
|
+
if (typeof t.props.zoomEnd === "function") {
|
|
1996
2002
|
var obj = t.getMapExtent();
|
|
1997
2003
|
obj.e = e;
|
|
1998
2004
|
t.props.zoomEnd(obj);
|
|
@@ -2030,10 +2036,10 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2030
2036
|
}
|
|
2031
2037
|
//将制定图元展示在视野内 (强制改变地图中心位置)
|
|
2032
2038
|
/*
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2039
|
+
参数arg格式如下1,2
|
|
2040
|
+
1.string 格式如:'1,a,2,3,4'
|
|
2041
|
+
2.数组 ['1','2']
|
|
2042
|
+
*/
|
|
2037
2043
|
}, {
|
|
2038
2044
|
key: "setVisiblePoints",
|
|
2039
2045
|
value: function setVisiblePoints(mapVisiblePoints) {
|
|
@@ -2043,27 +2049,27 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2043
2049
|
var ary = []; //图元id集合
|
|
2044
2050
|
var obj = []; //经纬度集合
|
|
2045
2051
|
switch (mapVisiblePoints.fitView) {
|
|
2046
|
-
case
|
|
2052
|
+
case "point":
|
|
2047
2053
|
arg = this.state.pointIds;
|
|
2048
2054
|
break;
|
|
2049
|
-
case
|
|
2055
|
+
case "line":
|
|
2050
2056
|
arg = this.state.lineIds;
|
|
2051
2057
|
break;
|
|
2052
|
-
case
|
|
2058
|
+
case "polygon":
|
|
2053
2059
|
arg = this.state.polygonIds;
|
|
2054
2060
|
break;
|
|
2055
|
-
case
|
|
2061
|
+
case "circle":
|
|
2056
2062
|
arg = this.state.circleIds;
|
|
2057
2063
|
break;
|
|
2058
|
-
case
|
|
2064
|
+
case "all":
|
|
2059
2065
|
arg = this.state.pointIds.concat(this.state.lineIds).concat(this.state.polygonIds).concat(this.state.circleIds);
|
|
2060
2066
|
break;
|
|
2061
2067
|
default:
|
|
2062
2068
|
arg = mapVisiblePoints.fitView;
|
|
2063
2069
|
break;
|
|
2064
2070
|
}
|
|
2065
|
-
if (typeof arg ===
|
|
2066
|
-
ary = arg.split(
|
|
2071
|
+
if (typeof arg === "string") {
|
|
2072
|
+
ary = arg.split(",");
|
|
2067
2073
|
} else if (arg instanceof Array) {
|
|
2068
2074
|
ary = arg;
|
|
2069
2075
|
}
|
|
@@ -2073,14 +2079,14 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2073
2079
|
for (var i = 0; i < ary.length; i++) {
|
|
2074
2080
|
var g = t.GM.getGraphicParam(ary[i]);
|
|
2075
2081
|
switch (g.geometry.type) {
|
|
2076
|
-
case
|
|
2077
|
-
case
|
|
2082
|
+
case "point":
|
|
2083
|
+
case "circle":
|
|
2078
2084
|
obj.push([g.geometry.x, g.geometry.y]);
|
|
2079
2085
|
break;
|
|
2080
|
-
case
|
|
2086
|
+
case "polyline":
|
|
2081
2087
|
obj = [].concat(_toConsumableArray(obj), _toConsumableArray(g.geometry.paths));
|
|
2082
2088
|
break;
|
|
2083
|
-
case
|
|
2089
|
+
case "polygon":
|
|
2084
2090
|
obj = [].concat(_toConsumableArray(obj), _toConsumableArray(g.geometry.rings));
|
|
2085
2091
|
break;
|
|
2086
2092
|
}
|
|
@@ -2094,9 +2100,9 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2094
2100
|
var ext = new esri.geometry.Extent(_objectSpread(_objectSpread({}, _extent), {}, {
|
|
2095
2101
|
spatialReference: _defineProperty({}, t.wkidStr, t.wkid)
|
|
2096
2102
|
}));
|
|
2097
|
-
if (!type || type ==
|
|
2103
|
+
if (!type || type == "all" || type == "zoom") {
|
|
2098
2104
|
t.state.gis.setExtent(ext);
|
|
2099
|
-
} else if (type ==
|
|
2105
|
+
} else if (type == "center") {
|
|
2100
2106
|
t.state.gis.centerAt(ext.getCenter());
|
|
2101
2107
|
}
|
|
2102
2108
|
}
|
|
@@ -2150,7 +2156,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2150
2156
|
lng = 0,
|
|
2151
2157
|
lat = 0;
|
|
2152
2158
|
switch (gp.geometryType) {
|
|
2153
|
-
case
|
|
2159
|
+
case "point":
|
|
2154
2160
|
lng = gg.geometry.x;
|
|
2155
2161
|
lat = gg.geometry.y;
|
|
2156
2162
|
p = _objectSpread(_objectSpread({}, gp), {}, {
|
|
@@ -2169,7 +2175,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2169
2175
|
})
|
|
2170
2176
|
});
|
|
2171
2177
|
break;
|
|
2172
|
-
case
|
|
2178
|
+
case "polyline":
|
|
2173
2179
|
pts = gg.geometry.paths[0];
|
|
2174
2180
|
p = _objectSpread(_objectSpread({}, gp), {}, {
|
|
2175
2181
|
mapLayer: gg,
|
|
@@ -2184,7 +2190,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2184
2190
|
})
|
|
2185
2191
|
});
|
|
2186
2192
|
break;
|
|
2187
|
-
case
|
|
2193
|
+
case "polygon":
|
|
2188
2194
|
pts = gg.geometry.rings[0];
|
|
2189
2195
|
p = _objectSpread(_objectSpread({}, gp), {}, {
|
|
2190
2196
|
mapLayer: gg,
|
|
@@ -2200,7 +2206,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2200
2206
|
area: (0, _MapToolFunction.getPolygonArea)(pts)
|
|
2201
2207
|
});
|
|
2202
2208
|
break;
|
|
2203
|
-
case
|
|
2209
|
+
case "circle":
|
|
2204
2210
|
lng = gg.geometry.center.x;
|
|
2205
2211
|
lat = gg.geometry.center.y;
|
|
2206
2212
|
var radius = 0;
|
|
@@ -2297,19 +2303,19 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2297
2303
|
}
|
|
2298
2304
|
var ids = [];
|
|
2299
2305
|
switch (type) {
|
|
2300
|
-
case
|
|
2306
|
+
case "point":
|
|
2301
2307
|
ids = t.state.pointIds;
|
|
2302
2308
|
break;
|
|
2303
|
-
case
|
|
2309
|
+
case "line":
|
|
2304
2310
|
ids = t.state.lineIds;
|
|
2305
2311
|
break;
|
|
2306
|
-
case
|
|
2312
|
+
case "polygon":
|
|
2307
2313
|
ids = t.state.polygonIds;
|
|
2308
2314
|
break;
|
|
2309
|
-
case
|
|
2315
|
+
case "circle":
|
|
2310
2316
|
ids = t.state.circleIds;
|
|
2311
2317
|
break;
|
|
2312
|
-
case
|
|
2318
|
+
case "draw":
|
|
2313
2319
|
if (t.state.drawIds.point.indexOf(id) > -1) {
|
|
2314
2320
|
t.state.drawIds.point.splice(t.state.drawIds.point.indexOf(id), 1);
|
|
2315
2321
|
}
|
|
@@ -2342,7 +2348,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2342
2348
|
break;
|
|
2343
2349
|
}
|
|
2344
2350
|
if (id == t.state.editId) {
|
|
2345
|
-
t.state.editId =
|
|
2351
|
+
t.state.editId = "";
|
|
2346
2352
|
}
|
|
2347
2353
|
if (ids.indexOf(id) != -1) {
|
|
2348
2354
|
ids.splice(ids.indexOf(id), 1);
|
|
@@ -2374,19 +2380,19 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2374
2380
|
cs = _toConsumableArray(circleIds);
|
|
2375
2381
|
// 删除点
|
|
2376
2382
|
for (var i = 0; i < ps.length; i++) {
|
|
2377
|
-
t.removeGraphic(ps[i],
|
|
2383
|
+
t.removeGraphic(ps[i], "point");
|
|
2378
2384
|
}
|
|
2379
2385
|
// 删除线
|
|
2380
2386
|
for (var _i3 = 0; _i3 < ls.length; _i3++) {
|
|
2381
|
-
t.removeGraphic(ls[_i3],
|
|
2387
|
+
t.removeGraphic(ls[_i3], "line");
|
|
2382
2388
|
}
|
|
2383
2389
|
// 删除面
|
|
2384
2390
|
for (var _i4 = 0; _i4 < pgs.length; _i4++) {
|
|
2385
|
-
t.removeGraphic(pgs[_i4],
|
|
2391
|
+
t.removeGraphic(pgs[_i4], "polygon");
|
|
2386
2392
|
}
|
|
2387
2393
|
// 删除圆
|
|
2388
2394
|
for (var _i5 = 0; _i5 < cs.length; _i5++) {
|
|
2389
|
-
t.removeGraphic(cs[_i5],
|
|
2395
|
+
t.removeGraphic(cs[_i5], "circle");
|
|
2390
2396
|
}
|
|
2391
2397
|
//删除绘制的点
|
|
2392
2398
|
var point = drawIds.point,
|
|
@@ -2406,8 +2412,8 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2406
2412
|
for (var _i9 = 0; _i9 < circle.length; _i9++) {
|
|
2407
2413
|
t.removeGraphic(circle[_i9]);
|
|
2408
2414
|
}
|
|
2409
|
-
for (var
|
|
2410
|
-
t.removeGraphic(rectangle[
|
|
2415
|
+
for (var _i10 = 0; _i10 < rectangle.length; _i10++) {
|
|
2416
|
+
t.removeGraphic(rectangle[_i10]);
|
|
2411
2417
|
}
|
|
2412
2418
|
}
|
|
2413
2419
|
//展示比例尺
|
|
@@ -2415,7 +2421,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2415
2421
|
key: "showControl",
|
|
2416
2422
|
value: function showControl() {
|
|
2417
2423
|
var t = this,
|
|
2418
|
-
type =
|
|
2424
|
+
type = "",
|
|
2419
2425
|
location = {
|
|
2420
2426
|
top: 20,
|
|
2421
2427
|
left: 20
|
|
@@ -2427,7 +2433,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2427
2433
|
w = t.state.gis.width,
|
|
2428
2434
|
h = t.state.gis.height;
|
|
2429
2435
|
switch (t.props.showControl.location) {
|
|
2430
|
-
case
|
|
2436
|
+
case "tl":
|
|
2431
2437
|
location = {
|
|
2432
2438
|
top: 20,
|
|
2433
2439
|
left: 20
|
|
@@ -2443,7 +2449,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2443
2449
|
};
|
|
2444
2450
|
}
|
|
2445
2451
|
break;
|
|
2446
|
-
case
|
|
2452
|
+
case "bl":
|
|
2447
2453
|
location = {
|
|
2448
2454
|
top: h - 83,
|
|
2449
2455
|
left: 20
|
|
@@ -2459,7 +2465,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2459
2465
|
};
|
|
2460
2466
|
}
|
|
2461
2467
|
break;
|
|
2462
|
-
case
|
|
2468
|
+
case "tr":
|
|
2463
2469
|
location = {
|
|
2464
2470
|
top: 20,
|
|
2465
2471
|
left: w - 52
|
|
@@ -2475,7 +2481,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2475
2481
|
};
|
|
2476
2482
|
}
|
|
2477
2483
|
break;
|
|
2478
|
-
case
|
|
2484
|
+
case "br":
|
|
2479
2485
|
location = {
|
|
2480
2486
|
top: h - 83,
|
|
2481
2487
|
left: w - 52
|
|
@@ -2528,12 +2534,12 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2528
2534
|
$("#".concat(t.props.mapId, "_root")).append(sliderShow);
|
|
2529
2535
|
}
|
|
2530
2536
|
switch (t.props.showControl.type) {
|
|
2531
|
-
case
|
|
2532
|
-
case
|
|
2533
|
-
case
|
|
2534
|
-
case
|
|
2537
|
+
case "all":
|
|
2538
|
+
case "small":
|
|
2539
|
+
case "pan":
|
|
2540
|
+
case "zoom":
|
|
2535
2541
|
$("#".concat(t.props.mapId, "_zoom_slider")).css(_objectSpread(_objectSpread({}, location), {}, {
|
|
2536
|
-
display:
|
|
2542
|
+
display: "block"
|
|
2537
2543
|
}));
|
|
2538
2544
|
default:
|
|
2539
2545
|
$("#".concat(t.props.mapId, "_zoom_slider_show")).css(_objectSpread({}, ls));
|
|
@@ -2549,7 +2555,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2549
2555
|
t.editToolbar = new esri.toolbars.Edit(t.state.gis);
|
|
2550
2556
|
t.editToolbarC = new esri.toolbars.Edit(t.state.gis);
|
|
2551
2557
|
var changeLabel = function changeLabel(point, eid, gcparam) {
|
|
2552
|
-
var label =
|
|
2558
|
+
var label = "",
|
|
2553
2559
|
cg = gcparam.attributes.config;
|
|
2554
2560
|
//判断是不是html点
|
|
2555
2561
|
if (!!gcparam.attributes.markerContent) {
|
|
@@ -2581,15 +2587,15 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2581
2587
|
};
|
|
2582
2588
|
/*点位编辑事件*/
|
|
2583
2589
|
//编辑关闭事件
|
|
2584
|
-
t.editToolbar.on(
|
|
2590
|
+
t.editToolbar.on("deactivate", function (e) {
|
|
2585
2591
|
var eid = e.graphic.attributes.id;
|
|
2586
2592
|
var gcparam = t.GM.getGraphicParam(eid);
|
|
2587
2593
|
//关闭label移动限制开关
|
|
2588
2594
|
t.canMoveLabel = false;
|
|
2589
2595
|
t.mouseNowPosition.isCount = false;
|
|
2590
|
-
if (
|
|
2596
|
+
if ("editGraphicChange" in t.props && typeof t.props.editGraphicChange == "function") {
|
|
2591
2597
|
var obj = {};
|
|
2592
|
-
if (eid ==
|
|
2598
|
+
if (eid == "vtx-circleMove") {
|
|
2593
2599
|
var param = t.getGraphic(t.editId);
|
|
2594
2600
|
obj = {
|
|
2595
2601
|
area: Math.PI * Math.pow(t.GM.getGraphic(t.editId).geometry.radius, 2),
|
|
@@ -2607,13 +2613,13 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2607
2613
|
geometry: e.graphic.geometry
|
|
2608
2614
|
};
|
|
2609
2615
|
switch (obj.geometry.type) {
|
|
2610
|
-
case
|
|
2616
|
+
case "polyline":
|
|
2611
2617
|
obj.geometry = _objectSpread(_objectSpread({}, obj.geometry), {}, {
|
|
2612
2618
|
paths: obj.geometry.paths[0]
|
|
2613
2619
|
});
|
|
2614
2620
|
obj.distance = t.calculateDistance(obj.geometry.paths);
|
|
2615
2621
|
break;
|
|
2616
|
-
case
|
|
2622
|
+
case "polygon":
|
|
2617
2623
|
obj.geometry = _objectSpread(_objectSpread({}, obj.geometry), {}, {
|
|
2618
2624
|
rings: obj.geometry.rings[0]
|
|
2619
2625
|
});
|
|
@@ -2623,28 +2629,28 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2623
2629
|
}
|
|
2624
2630
|
t.props.editGraphicChange(obj);
|
|
2625
2631
|
}
|
|
2626
|
-
if (eid ==
|
|
2627
|
-
t.removeGraphic(
|
|
2628
|
-
t.removeGraphic(
|
|
2629
|
-
if (t.zIndexGraphics.indexOf(
|
|
2630
|
-
t.zIndexGraphics.splice(t.zIndexGraphics.indexOf(
|
|
2632
|
+
if (eid == "vtx-circleMove") {
|
|
2633
|
+
t.removeGraphic("vtx-circleMove", "point");
|
|
2634
|
+
t.removeGraphic("vtx-circleRadius", "point");
|
|
2635
|
+
if (t.zIndexGraphics.indexOf("vtx-circleMove") > -1) {
|
|
2636
|
+
t.zIndexGraphics.splice(t.zIndexGraphics.indexOf("vtx-circleMove"), 1);
|
|
2631
2637
|
}
|
|
2632
|
-
if (t.zIndexGraphics.indexOf(
|
|
2633
|
-
t.zIndexGraphics.splice(t.zIndexGraphics.indexOf(
|
|
2638
|
+
if (t.zIndexGraphics.indexOf("vtx-circleRadius") > -1) {
|
|
2639
|
+
t.zIndexGraphics.splice(t.zIndexGraphics.indexOf("vtx-circleRadius"), 1);
|
|
2634
2640
|
}
|
|
2635
2641
|
}
|
|
2636
2642
|
if (t.zIndexGraphics.indexOf(eid) > -1) {
|
|
2637
2643
|
t.zIndexGraphics.splice(t.zIndexGraphics.indexOf(eid), 1);
|
|
2638
2644
|
}
|
|
2639
|
-
t.editId =
|
|
2645
|
+
t.editId = "";
|
|
2640
2646
|
});
|
|
2641
2647
|
//移动开始事件 开启开关
|
|
2642
|
-
t.editToolbar.on(
|
|
2648
|
+
t.editToolbar.on("graphic-move-start", function (e) {
|
|
2643
2649
|
//label可以跟着点位移动,避免label直接跟着鼠标移动
|
|
2644
2650
|
t.canMoveLabel = true;
|
|
2645
2651
|
});
|
|
2646
2652
|
//移动中事件
|
|
2647
|
-
t.editToolbar.on(
|
|
2653
|
+
t.editToolbar.on("graphic-move", function (e) {
|
|
2648
2654
|
//计算鼠标点 与中心点的偏移值
|
|
2649
2655
|
if (!t.mouseNowPosition.isCount) {
|
|
2650
2656
|
t.mouseNowPosition.isCount = true;
|
|
@@ -2660,14 +2666,14 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2660
2666
|
}
|
|
2661
2667
|
});
|
|
2662
2668
|
//圆中心点的移动
|
|
2663
|
-
if (eid ==
|
|
2664
|
-
t.GM.getGraphic(
|
|
2669
|
+
if (eid == "vtx-circleMove") {
|
|
2670
|
+
t.GM.getGraphic("vtx-circleMove").setGeometry(position);
|
|
2665
2671
|
var circleCenter = new esri.geometry.Circle({
|
|
2666
2672
|
center: position,
|
|
2667
2673
|
radius: t.GM.getGraphic(t.editId).geometry.radius
|
|
2668
2674
|
});
|
|
2669
2675
|
t.GM.getGraphic(t.editId).setGeometry(circleCenter);
|
|
2670
|
-
t.GM.getGraphic(
|
|
2676
|
+
t.GM.getGraphic("vtx-circleRadius").setGeometry(new esri.geometry.Point({
|
|
2671
2677
|
longitude: t.mouseNowPosition.x - t.mouseNowPosition.px - t.circleEditPXY.px,
|
|
2672
2678
|
latitude: t.mouseNowPosition.y - t.mouseNowPosition.py - t.circleEditPXY.py,
|
|
2673
2679
|
spatialReference: {
|
|
@@ -2681,25 +2687,25 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2681
2687
|
changeLabel(position, eid, gcparam);
|
|
2682
2688
|
});
|
|
2683
2689
|
//移动结束后事件
|
|
2684
|
-
t.editToolbar.on(
|
|
2690
|
+
t.editToolbar.on("graphic-move-stop", function (e) {
|
|
2685
2691
|
var eid = e.graphic.attributes.id;
|
|
2686
2692
|
var gcparam = t.GM.getGraphicParam(eid);
|
|
2687
2693
|
//关闭label移动限制开关
|
|
2688
2694
|
t.canMoveLabel = false;
|
|
2689
2695
|
t.mouseNowPosition.isCount = false;
|
|
2690
2696
|
//判断是不是点
|
|
2691
|
-
if (gcparam.geometryType ==
|
|
2697
|
+
if (gcparam.geometryType == "point") {
|
|
2692
2698
|
changeLabel(e.graphic.geometry, eid, gcparam);
|
|
2693
2699
|
}
|
|
2694
2700
|
//圆中心点的移动
|
|
2695
|
-
if (eid ==
|
|
2696
|
-
t.GM.getGraphic(
|
|
2701
|
+
if (eid == "vtx-circleMove") {
|
|
2702
|
+
t.GM.getGraphic("vtx-circleMove").setGeometry(e.graphic.geometry);
|
|
2697
2703
|
var circleCenter = new esri.geometry.Circle({
|
|
2698
2704
|
center: e.graphic.geometry,
|
|
2699
2705
|
radius: t.GM.getGraphic(t.editId).geometry.radius
|
|
2700
2706
|
});
|
|
2701
2707
|
t.GM.getGraphic(t.editId).setGeometry(circleCenter);
|
|
2702
|
-
t.GM.getGraphic(
|
|
2708
|
+
t.GM.getGraphic("vtx-circleRadius").setGeometry(new esri.geometry.Point({
|
|
2703
2709
|
longitude: e.graphic.geometry.x - t.circleEditPXY.px,
|
|
2704
2710
|
latitude: e.graphic.geometry.y - t.circleEditPXY.py,
|
|
2705
2711
|
spatialReference: {
|
|
@@ -2707,7 +2713,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2707
2713
|
}
|
|
2708
2714
|
}));
|
|
2709
2715
|
t.state.gis.graphics.refresh();
|
|
2710
|
-
if (
|
|
2716
|
+
if ("editGraphicChange" in t.props && typeof t.props.editGraphicChange == "function") {
|
|
2711
2717
|
var param = t.getGraphic(t.editId);
|
|
2712
2718
|
t.props.editGraphicChange({
|
|
2713
2719
|
area: Math.PI * Math.pow(t.GM.getGraphic(t.editId).geometry.radius, 2),
|
|
@@ -2719,7 +2725,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2719
2725
|
}
|
|
2720
2726
|
return false;
|
|
2721
2727
|
}
|
|
2722
|
-
if (
|
|
2728
|
+
if ("editGraphicChange" in t.props && typeof t.props.editGraphicChange == "function") {
|
|
2723
2729
|
var _param2 = t.getGraphic(eid);
|
|
2724
2730
|
t.props.editGraphicChange({
|
|
2725
2731
|
e: e.graphic,
|
|
@@ -2730,10 +2736,10 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2730
2736
|
}
|
|
2731
2737
|
});
|
|
2732
2738
|
//多折线 多边形 圆事件处理
|
|
2733
|
-
t.editToolbar.on(
|
|
2739
|
+
t.editToolbar.on("vertex-move-stop", function (e) {
|
|
2734
2740
|
var eid = e.graphic.attributes.id;
|
|
2735
2741
|
var gcparam = t.GM.getGraphicParam(eid);
|
|
2736
|
-
if (
|
|
2742
|
+
if ("editGraphicChange" in t.props && typeof t.props.editGraphicChange == "function") {
|
|
2737
2743
|
var param = t.getGraphic(eid);
|
|
2738
2744
|
var obj = {
|
|
2739
2745
|
e: e.graphic,
|
|
@@ -2742,13 +2748,13 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2742
2748
|
geometry: e.graphic.geometry
|
|
2743
2749
|
};
|
|
2744
2750
|
switch (obj.geometry.type) {
|
|
2745
|
-
case
|
|
2751
|
+
case "polyline":
|
|
2746
2752
|
obj.geometry = _objectSpread(_objectSpread({}, obj.geometry), {}, {
|
|
2747
2753
|
paths: obj.geometry.paths[0]
|
|
2748
2754
|
});
|
|
2749
2755
|
obj.distance = t.calculateDistance(obj.geometry.paths);
|
|
2750
2756
|
break;
|
|
2751
|
-
case
|
|
2757
|
+
case "polygon":
|
|
2752
2758
|
obj.geometry = _objectSpread(_objectSpread({}, obj.geometry), {}, {
|
|
2753
2759
|
rings: obj.geometry.rings[0]
|
|
2754
2760
|
});
|
|
@@ -2759,12 +2765,12 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2759
2765
|
}
|
|
2760
2766
|
});
|
|
2761
2767
|
//移动开始事件 开启开关 [圆半径]
|
|
2762
|
-
t.editToolbarC.on(
|
|
2768
|
+
t.editToolbarC.on("graphic-move-start", function (e) {
|
|
2763
2769
|
//label可以跟着点位移动,避免label直接跟着鼠标移动
|
|
2764
2770
|
t.canMoveLabel = true;
|
|
2765
2771
|
});
|
|
2766
2772
|
//移动中事件 [圆半径]
|
|
2767
|
-
t.editToolbarC.on(
|
|
2773
|
+
t.editToolbarC.on("graphic-move", function (e) {
|
|
2768
2774
|
//计算鼠标点 与中心点的偏移值
|
|
2769
2775
|
if (!t.mouseNowPosition.isCount) {
|
|
2770
2776
|
t.mouseNowPosition.isCount = true;
|
|
@@ -2789,11 +2795,11 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2789
2795
|
center: new esri.geometry.Point(cgc.geometry.center.x, cgc.geometry.center.y),
|
|
2790
2796
|
radius: radius
|
|
2791
2797
|
}));
|
|
2792
|
-
t.GM.getGraphic(
|
|
2798
|
+
t.GM.getGraphic("vtx-circleRadius").setGeometry(position);
|
|
2793
2799
|
t.state.gis.graphics.refresh();
|
|
2794
2800
|
});
|
|
2795
2801
|
//移动结束后事件 [圆半径]
|
|
2796
|
-
t.editToolbarC.on(
|
|
2802
|
+
t.editToolbarC.on("graphic-move-stop", function (e) {
|
|
2797
2803
|
t.canMoveLabel = false;
|
|
2798
2804
|
t.mouseNowPosition.isCount = false;
|
|
2799
2805
|
var cgc = t.GM.getGraphic(t.editId),
|
|
@@ -2814,9 +2820,9 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2814
2820
|
center: new esri.geometry.Point(cgc.geometry.center.x, cgc.geometry.center.y),
|
|
2815
2821
|
radius: radius
|
|
2816
2822
|
}));
|
|
2817
|
-
t.GM.getGraphic(
|
|
2823
|
+
t.GM.getGraphic("vtx-circleRadius").setGeometry(position);
|
|
2818
2824
|
t.state.gis.graphics.refresh();
|
|
2819
|
-
if (
|
|
2825
|
+
if ("editGraphicChange" in t.props && typeof t.props.editGraphicChange == "function") {
|
|
2820
2826
|
var param = t.getGraphic(t.editId);
|
|
2821
2827
|
t.props.editGraphicChange({
|
|
2822
2828
|
area: Math.PI * Math.pow(t.GM.getGraphic(t.editId).geometry.radius, 2),
|
|
@@ -2838,7 +2844,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2838
2844
|
var gp = t.GM.getGraphicParam(id);
|
|
2839
2845
|
if (!gc) return;
|
|
2840
2846
|
switch (gp.geometryType) {
|
|
2841
|
-
case
|
|
2847
|
+
case "point":
|
|
2842
2848
|
//将编辑的图元放在最上面
|
|
2843
2849
|
t.czIndex(id);
|
|
2844
2850
|
if (t.zIndexGraphics.indexOf(id) == -1) {
|
|
@@ -2846,17 +2852,17 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2846
2852
|
}
|
|
2847
2853
|
t.editToolbar.activate(esri.toolbars.Edit.MOVE, gc);
|
|
2848
2854
|
break;
|
|
2849
|
-
case
|
|
2850
|
-
case
|
|
2855
|
+
case "polyline":
|
|
2856
|
+
case "polygon":
|
|
2851
2857
|
t.editToolbar.activate(esri.toolbars.Edit.EDIT_VERTICES, gc);
|
|
2852
2858
|
break;
|
|
2853
|
-
case
|
|
2859
|
+
case "circle":
|
|
2854
2860
|
// 移动圆的中心点 和 移动圆的半径点
|
|
2855
2861
|
t.addPoint([{
|
|
2856
|
-
id:
|
|
2862
|
+
id: "vtx-circleMove",
|
|
2857
2863
|
longitude: gc.geometry.center.x,
|
|
2858
2864
|
latitude: gc.geometry.center.y,
|
|
2859
|
-
url:
|
|
2865
|
+
url: "http://api0.map.bdimg.com/images/node.gif",
|
|
2860
2866
|
config: {
|
|
2861
2867
|
width: 11,
|
|
2862
2868
|
height: 11,
|
|
@@ -2864,10 +2870,10 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2864
2870
|
markerContentX: -5.5
|
|
2865
2871
|
}
|
|
2866
2872
|
}, {
|
|
2867
|
-
id:
|
|
2873
|
+
id: "vtx-circleRadius",
|
|
2868
2874
|
longitude: gc.geometry.rings[0][0][0],
|
|
2869
2875
|
latitude: gc.geometry.rings[0][0][1],
|
|
2870
|
-
url:
|
|
2876
|
+
url: "http://api0.map.bdimg.com/images/node.gif",
|
|
2871
2877
|
config: {
|
|
2872
2878
|
width: 11,
|
|
2873
2879
|
height: 11,
|
|
@@ -2879,16 +2885,16 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2879
2885
|
px: gc.geometry.center.x - gc.geometry.rings[0][0][0],
|
|
2880
2886
|
py: gc.geometry.center.y - gc.geometry.rings[0][0][1]
|
|
2881
2887
|
};
|
|
2882
|
-
t.czIndex(
|
|
2883
|
-
t.czIndex(
|
|
2884
|
-
if (t.zIndexGraphics.indexOf(
|
|
2885
|
-
t.zIndexGraphics.push(
|
|
2888
|
+
t.czIndex("vtx-circleMove");
|
|
2889
|
+
t.czIndex("vtx-circleRadius");
|
|
2890
|
+
if (t.zIndexGraphics.indexOf("vtx-circleMove") == -1) {
|
|
2891
|
+
t.zIndexGraphics.push("vtx-circleMove");
|
|
2886
2892
|
}
|
|
2887
|
-
if (t.zIndexGraphics.indexOf(
|
|
2888
|
-
t.zIndexGraphics.push(
|
|
2893
|
+
if (t.zIndexGraphics.indexOf("vtx-circleRadius") == -1) {
|
|
2894
|
+
t.zIndexGraphics.push("vtx-circleRadius");
|
|
2889
2895
|
}
|
|
2890
|
-
t.editToolbar.activate(esri.toolbars.Edit.MOVE, t.GM.getGraphic(
|
|
2891
|
-
t.editToolbarC.activate(esri.toolbars.Edit.MOVE, t.GM.getGraphic(
|
|
2896
|
+
t.editToolbar.activate(esri.toolbars.Edit.MOVE, t.GM.getGraphic("vtx-circleMove"));
|
|
2897
|
+
t.editToolbarC.activate(esri.toolbars.Edit.MOVE, t.GM.getGraphic("vtx-circleRadius"));
|
|
2892
2898
|
break;
|
|
2893
2899
|
}
|
|
2894
2900
|
//开启点编辑功能
|
|
@@ -2913,43 +2919,43 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2913
2919
|
drawTime: 90,
|
|
2914
2920
|
showTooltips: false
|
|
2915
2921
|
});
|
|
2916
|
-
t.drawToolbar.on(
|
|
2922
|
+
t.drawToolbar.on("draw-complete", function (e) {
|
|
2917
2923
|
//关闭绘制事件
|
|
2918
2924
|
t.closeDraw();
|
|
2919
2925
|
//返回参数
|
|
2920
2926
|
var param = {};
|
|
2921
2927
|
// 绘制内部管理的图元
|
|
2922
|
-
if (t.drawParam.geometryType ==
|
|
2928
|
+
if (t.drawParam.geometryType == "point") {
|
|
2923
2929
|
t.addPoint([{
|
|
2924
2930
|
id: t.drawParam.data.id,
|
|
2925
2931
|
longitude: e.geometry.x,
|
|
2926
2932
|
latitude: e.geometry.y,
|
|
2927
|
-
url: t.drawParam.parameter.url || "".concat(_default2
|
|
2933
|
+
url: t.drawParam.parameter.url || "".concat(_default2.default.mapServerURL, "/images/defaultMarker.png"),
|
|
2928
2934
|
config: _objectSpread({}, t.drawParam.parameter)
|
|
2929
|
-
}],
|
|
2935
|
+
}], "point");
|
|
2930
2936
|
//处理点返回参数
|
|
2931
2937
|
param = {
|
|
2932
2938
|
id: t.drawParam.data.id,
|
|
2933
2939
|
attributes: {
|
|
2934
2940
|
id: t.drawParam.data.id,
|
|
2935
|
-
url: t.drawParam.parameter.url || "".concat(_default2
|
|
2941
|
+
url: t.drawParam.parameter.url || "".concat(_default2.default.mapServerURL, "/images/defaultMarker.png"),
|
|
2936
2942
|
config: {
|
|
2937
2943
|
width: t.drawParam.parameter.width || 30,
|
|
2938
2944
|
height: t.drawParam.parameter.height || 30
|
|
2939
2945
|
}
|
|
2940
2946
|
},
|
|
2941
2947
|
geometry: e.geometry,
|
|
2942
|
-
geometryType:
|
|
2948
|
+
geometryType: "point",
|
|
2943
2949
|
mapLayer: t.GM.getGraphic(t.drawParam.data.id)
|
|
2944
2950
|
};
|
|
2945
2951
|
}
|
|
2946
2952
|
//线
|
|
2947
|
-
if (t.drawParam.geometryType ==
|
|
2953
|
+
if (t.drawParam.geometryType == "polyline") {
|
|
2948
2954
|
t.addLine([{
|
|
2949
2955
|
id: t.drawParam.data.id,
|
|
2950
2956
|
paths: e.geometry.paths[0],
|
|
2951
2957
|
config: _objectSpread({}, t.drawParam.parameter)
|
|
2952
|
-
}],
|
|
2958
|
+
}], "polyline");
|
|
2953
2959
|
//处理线返回参数
|
|
2954
2960
|
var _t$dealData4 = t.dealData(e.geometry.paths[0]),
|
|
2955
2961
|
lnglatAry = _t$dealData4.lnglatAry,
|
|
@@ -2966,11 +2972,11 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2966
2972
|
config: _objectSpread({}, t.drawParam.parameter)
|
|
2967
2973
|
},
|
|
2968
2974
|
distance: t.calculateDistance(e.geometry.paths[0]),
|
|
2969
|
-
geometryType:
|
|
2975
|
+
geometryType: "polyline",
|
|
2970
2976
|
mapLayer: t.GM.getGraphic(t.drawParam.data.id)
|
|
2971
2977
|
};
|
|
2972
2978
|
}
|
|
2973
|
-
if (t.drawParam.geometryType ==
|
|
2979
|
+
if (t.drawParam.geometryType == "polygon" || t.drawParam.geometryType == "rectangle") {
|
|
2974
2980
|
var rs = _toConsumableArray(e.geometry.rings[0]);
|
|
2975
2981
|
rs.pop();
|
|
2976
2982
|
t.addPolygon([{
|
|
@@ -2999,7 +3005,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2999
3005
|
mapLayer: t.GM.getGraphic(t.drawParam.data.id)
|
|
3000
3006
|
};
|
|
3001
3007
|
}
|
|
3002
|
-
if (t.drawParam.geometryType ==
|
|
3008
|
+
if (t.drawParam.geometryType == "circle") {
|
|
3003
3009
|
if (e.geometry._extent) {
|
|
3004
3010
|
var radius = (0, _MapToolFunction.getDistance)([e.geometry._extent.xmin, e.geometry._extent.ymin], [e.geometry._extent.xmax, e.geometry._extent.ymax], t.state.gis, t.grwkid) / 2;
|
|
3005
3011
|
radius = Math.sqrt(Math.pow(radius, 2) * 2) / 2;
|
|
@@ -3029,7 +3035,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3029
3035
|
}
|
|
3030
3036
|
// t.GM.setGraphicParam(t.drawParam.data.id,param);
|
|
3031
3037
|
//绘制返回
|
|
3032
|
-
if (
|
|
3038
|
+
if ("drawEnd" in t.props && typeof t.props.drawEnd == "function") {
|
|
3033
3039
|
t.props.drawEnd(param);
|
|
3034
3040
|
}
|
|
3035
3041
|
});
|
|
@@ -3037,11 +3043,11 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3037
3043
|
//避免连点
|
|
3038
3044
|
t.closeDraw();
|
|
3039
3045
|
$("#".concat(t.props.mapId, "_container")).css({
|
|
3040
|
-
cursor:
|
|
3046
|
+
cursor: "crosshair"
|
|
3041
3047
|
});
|
|
3042
3048
|
var drawParam = {};
|
|
3043
3049
|
//初始化参数
|
|
3044
|
-
drawParam.geometryType = obj.geometryType ||
|
|
3050
|
+
drawParam.geometryType = obj.geometryType || "point";
|
|
3045
3051
|
drawParam.parameter = obj.parameter ? _objectSpread({}, obj.parameter) : {};
|
|
3046
3052
|
drawParam.data = obj.data ? _objectSpread({}, obj.data) : {};
|
|
3047
3053
|
drawParam.data.id = (obj.data || {}).id || "draw".concat(new Date().getTime());
|
|
@@ -3056,21 +3062,21 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3056
3062
|
}
|
|
3057
3063
|
var lineSymbol = null,
|
|
3058
3064
|
fillSymbol = null;
|
|
3059
|
-
if (drawParam.geometryType !==
|
|
3065
|
+
if (drawParam.geometryType !== "point") {
|
|
3060
3066
|
//线类型
|
|
3061
3067
|
var lineStyle = esri.symbol.SimpleLineSymbol.STYLE_SOLID;
|
|
3062
3068
|
switch (drawParam.parameter.lineType) {
|
|
3063
|
-
case
|
|
3069
|
+
case "solid":
|
|
3064
3070
|
lineStyle = esri.symbol.SimpleLineSymbol.STYLE_SOLID;
|
|
3065
3071
|
break;
|
|
3066
|
-
case
|
|
3072
|
+
case "dashed":
|
|
3067
3073
|
lineStyle = esri.symbol.SimpleLineSymbol.STYLE_DASH;
|
|
3068
3074
|
break;
|
|
3069
3075
|
}
|
|
3070
3076
|
//处理边框线颜色和透明度 使用rgba处理透明度
|
|
3071
3077
|
var lineColor = null;
|
|
3072
3078
|
//线和面圆的线透明参数不同
|
|
3073
|
-
if (drawParam.geometryType ==
|
|
3079
|
+
if (drawParam.geometryType == "polyline") {
|
|
3074
3080
|
lineColor = new esri.Color(drawParam.parameter.color);
|
|
3075
3081
|
lineColor.a = drawParam.parameter.pellucidity;
|
|
3076
3082
|
} else {
|
|
@@ -3081,13 +3087,13 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3081
3087
|
lineSymbol = new esri.symbol.SimpleLineSymbol(lineStyle, lineColor, drawParam.parameter.lineWidth);
|
|
3082
3088
|
} else {
|
|
3083
3089
|
//点的样式
|
|
3084
|
-
var markerSymbol = new esri.symbol.PictureMarkerSymbol(drawParam.parameter.url || "".concat(_default2
|
|
3090
|
+
var markerSymbol = new esri.symbol.PictureMarkerSymbol(drawParam.parameter.url || "".concat(_default2.default.mapServerURL, "/images/defaultMarker.png"), drawParam.parameter.width || 30, drawParam.parameter.height || 30);
|
|
3085
3091
|
//设置点偏移
|
|
3086
3092
|
markerSymbol.setOffset((drawParam.parameter.markerContentX || -15) + (drawParam.parameter.width || 30) / 2, -((drawParam.parameter.markerContentY || -15) + (drawParam.parameter.height || 30) / 2));
|
|
3087
3093
|
t.drawToolbar.setMarkerSymbol(markerSymbol);
|
|
3088
3094
|
}
|
|
3089
3095
|
//处理面 矩形 圆的样式
|
|
3090
|
-
if (drawParam.geometryType ==
|
|
3096
|
+
if (drawParam.geometryType == "polygon" || drawParam.geometryType == "circle" || drawParam.geometryType == "rectangle") {
|
|
3091
3097
|
//创建面对象
|
|
3092
3098
|
fillSymbol = new esri.symbol.SimpleFillSymbol();
|
|
3093
3099
|
//添加边框线数据
|
|
@@ -3103,21 +3109,21 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3103
3109
|
//重新设置绘制类型和数据
|
|
3104
3110
|
var geometryType = esri.toolbars.Draw.POINT;
|
|
3105
3111
|
switch (drawParam.geometryType) {
|
|
3106
|
-
case
|
|
3112
|
+
case "point":
|
|
3107
3113
|
geometryType = esri.toolbars.Draw.POINT;
|
|
3108
3114
|
break;
|
|
3109
|
-
case
|
|
3115
|
+
case "polyline":
|
|
3110
3116
|
geometryType = esri.toolbars.Draw.POLYLINE;
|
|
3111
3117
|
//添加线的样式
|
|
3112
3118
|
t.drawToolbar.setLineSymbol(lineSymbol);
|
|
3113
3119
|
break;
|
|
3114
|
-
case
|
|
3120
|
+
case "polygon":
|
|
3115
3121
|
geometryType = esri.toolbars.Draw.POLYGON;
|
|
3116
3122
|
break;
|
|
3117
|
-
case
|
|
3123
|
+
case "circle":
|
|
3118
3124
|
geometryType = esri.toolbars.Draw.CIRCLE;
|
|
3119
3125
|
break;
|
|
3120
|
-
case
|
|
3126
|
+
case "rectangle":
|
|
3121
3127
|
geometryType = esri.toolbars.Draw.RECTANGLE;
|
|
3122
3128
|
break;
|
|
3123
3129
|
}
|
|
@@ -3130,7 +3136,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3130
3136
|
var t = this;
|
|
3131
3137
|
if (t.drawToolbar) {
|
|
3132
3138
|
$("#".concat(t.props.mapId, "_container")).css({
|
|
3133
|
-
cursor:
|
|
3139
|
+
cursor: "default"
|
|
3134
3140
|
});
|
|
3135
3141
|
//先关闭上次绘制的事件
|
|
3136
3142
|
t.drawToolbar.finishDrawing();
|
|
@@ -3161,23 +3167,23 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3161
3167
|
t.state.gis.graphics.remove(t.clusterPt[i].graphic);
|
|
3162
3168
|
t.state.gis.graphics.remove(t.clusterPt[i].graphicText);
|
|
3163
3169
|
}
|
|
3164
|
-
for (var
|
|
3165
|
-
t.clusterMarkers[
|
|
3170
|
+
for (var _i11 = 0; _i11 < t.clusterMarkers.length; _i11++) {
|
|
3171
|
+
t.clusterMarkers[_i11].isCluster = false;
|
|
3166
3172
|
}
|
|
3167
3173
|
//处理后的聚合点位数据
|
|
3168
|
-
for (var
|
|
3169
|
-
var gc = t.clusterMarkers[
|
|
3174
|
+
for (var _i12 = 0; _i12 < t.clusterMarkers.length; _i12++) {
|
|
3175
|
+
var gc = t.clusterMarkers[_i12].marker,
|
|
3170
3176
|
distance = 4000000,
|
|
3171
3177
|
newCluster = null;
|
|
3172
3178
|
//过滤不是点的图元id
|
|
3173
|
-
if (gc.geometry.type !==
|
|
3179
|
+
if (gc.geometry.type !== "point") {
|
|
3174
3180
|
console.warning("\u8BBE\u7F6E\u805A\u5408\u7684\u56FE\u5143\u4E0D\u7B26\u53F7\u7C7B\u578B!");
|
|
3175
3181
|
} else {
|
|
3176
3182
|
//过滤窗口视线外的点位
|
|
3177
3183
|
if (ext.contains(gc.geometry)) {
|
|
3178
3184
|
//聚合点集合空时 创建一个集合
|
|
3179
3185
|
if (t.clusterPs.length === 0) {
|
|
3180
|
-
t.createCluster(t.clusterMarkers[
|
|
3186
|
+
t.createCluster(t.clusterMarkers[_i12]);
|
|
3181
3187
|
} else {
|
|
3182
3188
|
for (var j = 0; j < t.clusterPs.length; j++) {
|
|
3183
3189
|
//判断点是否在聚合点范围内
|
|
@@ -3190,23 +3196,23 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3190
3196
|
}
|
|
3191
3197
|
//存在聚合 就添加进聚合 没有聚合就新建一个自己的聚合
|
|
3192
3198
|
if (newCluster && newCluster.extent.contains(gc.geometry)) {
|
|
3193
|
-
t.clusterMarkers[
|
|
3194
|
-
newCluster.markers.push(t.clusterMarkers[
|
|
3199
|
+
t.clusterMarkers[_i12].isCluster = true;
|
|
3200
|
+
newCluster.markers.push(t.clusterMarkers[_i12]);
|
|
3195
3201
|
newCluster.isreal = true;
|
|
3196
3202
|
} else {
|
|
3197
|
-
t.createCluster(t.clusterMarkers[
|
|
3203
|
+
t.createCluster(t.clusterMarkers[_i12]);
|
|
3198
3204
|
}
|
|
3199
3205
|
}
|
|
3200
3206
|
}
|
|
3201
3207
|
}
|
|
3202
3208
|
}
|
|
3203
3209
|
//添加cluster聚合点
|
|
3204
|
-
for (var
|
|
3205
|
-
if (t.clusterPs[
|
|
3210
|
+
for (var _i13 = 0; _i13 < t.clusterPs.length; _i13++) {
|
|
3211
|
+
if (t.clusterPs[_i13].isreal) {
|
|
3206
3212
|
//添加聚合集合点
|
|
3207
|
-
t.addClusterPoint(t.clusterPs[
|
|
3213
|
+
t.addClusterPoint(t.clusterPs[_i13]);
|
|
3208
3214
|
} else {
|
|
3209
|
-
var m = t.clusterPs[
|
|
3215
|
+
var m = t.clusterPs[_i13].markers[0];
|
|
3210
3216
|
if (!m.marker.getNode()) {
|
|
3211
3217
|
//存在html的label处理
|
|
3212
3218
|
if (m.html) {
|
|
@@ -3225,22 +3231,22 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3225
3231
|
var t = this;
|
|
3226
3232
|
var len = cluster.markers.length,
|
|
3227
3233
|
ids = [];
|
|
3228
|
-
var url =
|
|
3234
|
+
var url = "http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m4.png",
|
|
3229
3235
|
w = 90;
|
|
3230
3236
|
if (len < 50) {
|
|
3231
|
-
url =
|
|
3237
|
+
url = "http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m3.png";
|
|
3232
3238
|
w = 78;
|
|
3233
3239
|
}
|
|
3234
3240
|
if (len < 30) {
|
|
3235
|
-
url =
|
|
3241
|
+
url = "http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m2.png";
|
|
3236
3242
|
w = 66;
|
|
3237
3243
|
}
|
|
3238
3244
|
if (len < 20) {
|
|
3239
|
-
url =
|
|
3245
|
+
url = "http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m1.png";
|
|
3240
3246
|
w = 56;
|
|
3241
3247
|
}
|
|
3242
3248
|
if (len < 10) {
|
|
3243
|
-
url =
|
|
3249
|
+
url = "http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m0.png";
|
|
3244
3250
|
w = 53;
|
|
3245
3251
|
}
|
|
3246
3252
|
//处理聚合中点位
|
|
@@ -3256,17 +3262,17 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3256
3262
|
//添加聚合点
|
|
3257
3263
|
var markerSymbol = new esri.symbol.PictureMarkerSymbol(url, w, w);
|
|
3258
3264
|
//设置文字点位(记录聚合点数量)
|
|
3259
|
-
var text = new esri.symbol.TextSymbol(len).setColor(new esri.Color(
|
|
3265
|
+
var text = new esri.symbol.TextSymbol(len).setColor(new esri.Color("#fff"));
|
|
3260
3266
|
//文字居中
|
|
3261
3267
|
text.setOffset(0.5, -5);
|
|
3262
3268
|
//创建点位对象
|
|
3263
3269
|
var graphic = new esri.Graphic(cluster.center, markerSymbol, {
|
|
3264
|
-
id:
|
|
3270
|
+
id: "vtx-clusterPoint",
|
|
3265
3271
|
ids: ids,
|
|
3266
3272
|
cluster: cluster
|
|
3267
3273
|
}),
|
|
3268
3274
|
graphicText = new esri.Graphic(cluster.center, text, {
|
|
3269
|
-
id:
|
|
3275
|
+
id: "vtx-clusterPoint",
|
|
3270
3276
|
ids: ids,
|
|
3271
3277
|
cluster: cluster
|
|
3272
3278
|
});
|
|
@@ -3325,10 +3331,10 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3325
3331
|
var pointIds = t.state.pointIds;
|
|
3326
3332
|
ary = pointIds;
|
|
3327
3333
|
} else {
|
|
3328
|
-
if (Object.prototype.toString.apply(arg) ===
|
|
3334
|
+
if (Object.prototype.toString.apply(arg) === "[object Array]") {
|
|
3329
3335
|
ary = arg;
|
|
3330
|
-
} else if (typeof arg ===
|
|
3331
|
-
ary = arg.split(
|
|
3336
|
+
} else if (typeof arg === "string") {
|
|
3337
|
+
ary = arg.split(",");
|
|
3332
3338
|
}
|
|
3333
3339
|
}
|
|
3334
3340
|
var markerList = [];
|
|
@@ -3375,7 +3381,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3375
3381
|
return;
|
|
3376
3382
|
}
|
|
3377
3383
|
// if(t.containsExtent(t.areaRestriction,e.extent)){
|
|
3378
|
-
// return;
|
|
3384
|
+
// return;
|
|
3379
3385
|
// }
|
|
3380
3386
|
var _t$areaRestriction = t.areaRestriction,
|
|
3381
3387
|
xmin1 = _t$areaRestriction.xmin,
|
|
@@ -3499,7 +3505,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3499
3505
|
if (!(tl.y < -50 || tl.x < -50 || tl.y > t.state.gis.height || tl.x > t.state.gis.width)) {
|
|
3500
3506
|
//设置label的位置(通过定位来实现)
|
|
3501
3507
|
label.html.css({
|
|
3502
|
-
position:
|
|
3508
|
+
position: "absolute",
|
|
3503
3509
|
top: tl.y + (label.offset.y || 0) - t.labelLayer.y,
|
|
3504
3510
|
left: tl.x + (label.offset.x || 0) - t.labelLayer.x
|
|
3505
3511
|
});
|
|
@@ -3567,8 +3573,8 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3567
3573
|
});
|
|
3568
3574
|
var nowMovePoints = t.movePoints.slice(0, 10),
|
|
3569
3575
|
deleteIndex = [];
|
|
3570
|
-
for (var
|
|
3571
|
-
var _nowMovePoints$_i = nowMovePoints[
|
|
3576
|
+
for (var _i14 = 0; _i14 < nowMovePoints.length; _i14++) {
|
|
3577
|
+
var _nowMovePoints$_i = nowMovePoints[_i14],
|
|
3572
3578
|
id = _nowMovePoints$_i.id,
|
|
3573
3579
|
rx = _nowMovePoints$_i.rx,
|
|
3574
3580
|
ry = _nowMovePoints$_i.ry,
|
|
@@ -3600,7 +3606,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3600
3606
|
var tl = t.state.gis.toScreen(lglt);
|
|
3601
3607
|
//设置label的位置(通过定位来实现)
|
|
3602
3608
|
t.Label[id].html.css({
|
|
3603
|
-
position:
|
|
3609
|
+
position: "absolute",
|
|
3604
3610
|
top: tl.y + (t.Label[id].offset.y || 0) - t.labelLayer.y,
|
|
3605
3611
|
left: tl.x + (t.Label[id].offset.x || 0) - t.labelLayer.x
|
|
3606
3612
|
});
|
|
@@ -3608,17 +3614,17 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3608
3614
|
t.GM.setGraphicParam(id, _objectSpread(_objectSpread({}, t.GM.getGraphicParam(id)), {}, {
|
|
3609
3615
|
deg: ddeg
|
|
3610
3616
|
}));
|
|
3611
|
-
t.movePoints[
|
|
3617
|
+
t.movePoints[_i14].waitTime = 0;
|
|
3612
3618
|
if (deleteTime <= 0) {
|
|
3613
|
-
deleteIndex.push(
|
|
3619
|
+
deleteIndex.push(_i14);
|
|
3614
3620
|
}
|
|
3615
3621
|
}
|
|
3616
3622
|
}
|
|
3617
3623
|
deleteIndex.sort(function (a, b) {
|
|
3618
3624
|
return b - a;
|
|
3619
3625
|
});
|
|
3620
|
-
for (var
|
|
3621
|
-
t.movePoints.splice(deleteIndex[
|
|
3626
|
+
for (var _i15 = 0; _i15 < deleteIndex.length; _i15++) {
|
|
3627
|
+
t.movePoints.splice(deleteIndex[_i15], 1);
|
|
3622
3628
|
}
|
|
3623
3629
|
if (nowMovePoints.length == 0) {
|
|
3624
3630
|
clearInterval(t.moveToTimer);
|
|
@@ -3720,7 +3726,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3720
3726
|
}, {
|
|
3721
3727
|
key: "deepEqual",
|
|
3722
3728
|
value: function deepEqual(a, b) {
|
|
3723
|
-
return _immutable
|
|
3729
|
+
return _immutable.default.is(_immutable.default.fromJS(a), _immutable.default.fromJS(b));
|
|
3724
3730
|
}
|
|
3725
3731
|
//数据解析(分析,新增,更新,删除对应的数据)
|
|
3726
3732
|
}, {
|
|
@@ -3796,12 +3802,12 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3796
3802
|
value: function render() {
|
|
3797
3803
|
var t = this;
|
|
3798
3804
|
var _map = this.props;
|
|
3799
|
-
return /*#__PURE__*/
|
|
3805
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
3800
3806
|
id: _map.mapId,
|
|
3801
3807
|
style: {
|
|
3802
|
-
width:
|
|
3803
|
-
height:
|
|
3804
|
-
backgroundColor:
|
|
3808
|
+
width: "100%",
|
|
3809
|
+
height: "100%",
|
|
3810
|
+
backgroundColor: "#f1f1f1"
|
|
3805
3811
|
}
|
|
3806
3812
|
});
|
|
3807
3813
|
}
|
|
@@ -3879,7 +3885,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3879
3885
|
if (!t.mapCreated) return;
|
|
3880
3886
|
/*添加海量点*/
|
|
3881
3887
|
if (mapPointCollection instanceof Array && t.props.mapPointCollection instanceof Array && !t.deepEqual(mapPointCollection, t.props.mapPointCollection)) {
|
|
3882
|
-
var _t$dataMatch = t.dataMatch(t.props.mapPointCollection, mapPointCollection,
|
|
3888
|
+
var _t$dataMatch = t.dataMatch(t.props.mapPointCollection, mapPointCollection, "id"),
|
|
3883
3889
|
deletedDataIDs = _t$dataMatch.deletedDataIDs,
|
|
3884
3890
|
addedData = _t$dataMatch.addedData,
|
|
3885
3891
|
updatedData = _t$dataMatch.updatedData;
|
|
@@ -3887,14 +3893,14 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3887
3893
|
t.addPointCollection(addedData);
|
|
3888
3894
|
t.updatePointCollection(updatedData);
|
|
3889
3895
|
}
|
|
3890
|
-
if (typeof isclearAllPointCollection ==
|
|
3896
|
+
if (typeof isclearAllPointCollection == "boolean" && isclearAllPointCollection || isclearAllPointCollection && isclearAllPointCollection !== t.props.isclearAllPointCollection) {
|
|
3891
3897
|
t.clearAllPointCollection();
|
|
3892
3898
|
}
|
|
3893
3899
|
/*点数据处理
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3900
|
+
pointData[2]相同的点,执行刷新
|
|
3901
|
+
pointData[1]的数据在idsForGraphicId中不存在的,执行新增
|
|
3902
|
+
pointData[0]数据中多余的id,执行删除
|
|
3903
|
+
*/
|
|
3898
3904
|
if (mapPoints instanceof Array && t.props.mapPoints instanceof Array && !t.deepEqual(mapPoints, t.props.mapPoints)) {
|
|
3899
3905
|
var oldMapPoints = t.props.mapPoints;
|
|
3900
3906
|
var newMapPoints = mapPoints;
|
|
@@ -3907,7 +3913,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3907
3913
|
return item.id !== editGraphicId;
|
|
3908
3914
|
});
|
|
3909
3915
|
}
|
|
3910
|
-
var _t$dataMatch2 = t.dataMatch(oldMapPoints, newMapPoints,
|
|
3916
|
+
var _t$dataMatch2 = t.dataMatch(oldMapPoints, newMapPoints, "id"),
|
|
3911
3917
|
_deletedDataIDs = _t$dataMatch2.deletedDataIDs,
|
|
3912
3918
|
_addedData = _t$dataMatch2.addedData,
|
|
3913
3919
|
_updatedData = _t$dataMatch2.updatedData;
|
|
@@ -3923,7 +3929,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3923
3929
|
try {
|
|
3924
3930
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
3925
3931
|
var id = _step.value;
|
|
3926
|
-
t.removeGraphic(id,
|
|
3932
|
+
t.removeGraphic(id, "point");
|
|
3927
3933
|
}
|
|
3928
3934
|
//增加
|
|
3929
3935
|
} catch (err) {
|
|
@@ -3936,9 +3942,9 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3936
3942
|
t.updatePoint([].concat(_toConsumableArray(upds), _toConsumableArray(otherupds)));
|
|
3937
3943
|
}
|
|
3938
3944
|
/*
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3945
|
+
面数据处理
|
|
3946
|
+
先全删除,再新增
|
|
3947
|
+
*/
|
|
3942
3948
|
if (mapPolygons instanceof Array && t.props.mapPolygons instanceof Array && !t.deepEqual(mapPolygons, t.props.mapPolygons)) {
|
|
3943
3949
|
var oldMapPolygons = t.props.mapPolygons;
|
|
3944
3950
|
var newMapPolygons = mapPolygons;
|
|
@@ -3950,7 +3956,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3950
3956
|
return item.id !== editGraphicId;
|
|
3951
3957
|
});
|
|
3952
3958
|
}
|
|
3953
|
-
var _t$dataMatch3 = t.dataMatch(oldMapPolygons, newMapPolygons,
|
|
3959
|
+
var _t$dataMatch3 = t.dataMatch(oldMapPolygons, newMapPolygons, "id"),
|
|
3954
3960
|
_deletedDataIDs2 = _t$dataMatch3.deletedDataIDs,
|
|
3955
3961
|
_addedData2 = _t$dataMatch3.addedData,
|
|
3956
3962
|
_updatedData2 = _t$dataMatch3.updatedData;
|
|
@@ -3966,7 +3972,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3966
3972
|
try {
|
|
3967
3973
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
3968
3974
|
var _id = _step2.value;
|
|
3969
|
-
t.removeGraphic(_id,
|
|
3975
|
+
t.removeGraphic(_id, "polygon");
|
|
3970
3976
|
}
|
|
3971
3977
|
//增加
|
|
3972
3978
|
} catch (err) {
|
|
@@ -3979,9 +3985,9 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3979
3985
|
t.updatePolygon([].concat(_toConsumableArray(_upds), _toConsumableArray(_otherupds)));
|
|
3980
3986
|
}
|
|
3981
3987
|
/*
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3988
|
+
圆数据处理
|
|
3989
|
+
先全删除,再新增
|
|
3990
|
+
*/
|
|
3985
3991
|
if (mapCircles instanceof Array && t.props.mapCircles instanceof Array && !t.deepEqual(mapCircles, t.props.mapCircles)) {
|
|
3986
3992
|
var oldMapCircles = t.props.mapCircles;
|
|
3987
3993
|
var newMapCircles = mapCircles;
|
|
@@ -3993,7 +3999,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3993
3999
|
return item.id !== editGraphicId;
|
|
3994
4000
|
});
|
|
3995
4001
|
}
|
|
3996
|
-
var _t$dataMatch4 = t.dataMatch(oldMapCircles, newMapCircles,
|
|
4002
|
+
var _t$dataMatch4 = t.dataMatch(oldMapCircles, newMapCircles, "id"),
|
|
3997
4003
|
_deletedDataIDs3 = _t$dataMatch4.deletedDataIDs,
|
|
3998
4004
|
_addedData3 = _t$dataMatch4.addedData,
|
|
3999
4005
|
_updatedData3 = _t$dataMatch4.updatedData;
|
|
@@ -4009,7 +4015,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
4009
4015
|
try {
|
|
4010
4016
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
4011
4017
|
var _id2 = _step3.value;
|
|
4012
|
-
t.removeGraphic(_id2,
|
|
4018
|
+
t.removeGraphic(_id2, "circle");
|
|
4013
4019
|
}
|
|
4014
4020
|
//增加
|
|
4015
4021
|
} catch (err) {
|
|
@@ -4022,9 +4028,9 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
4022
4028
|
t.updateCircle([].concat(_toConsumableArray(_upds2), _toConsumableArray(_otherupds2)));
|
|
4023
4029
|
}
|
|
4024
4030
|
/*
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4031
|
+
线数据处理
|
|
4032
|
+
先全删除,再新增
|
|
4033
|
+
*/
|
|
4028
4034
|
if (mapLines instanceof Array && t.props.mapLines instanceof Array && !t.deepEqual(mapLines, t.props.mapLines)) {
|
|
4029
4035
|
var oldMapLines = t.props.mapLines;
|
|
4030
4036
|
var newMapLines = mapLines;
|
|
@@ -4036,7 +4042,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
4036
4042
|
return item.id !== editGraphicId;
|
|
4037
4043
|
});
|
|
4038
4044
|
}
|
|
4039
|
-
var _t$dataMatch5 = t.dataMatch(oldMapLines, newMapLines,
|
|
4045
|
+
var _t$dataMatch5 = t.dataMatch(oldMapLines, newMapLines, "id"),
|
|
4040
4046
|
_deletedDataIDs4 = _t$dataMatch5.deletedDataIDs,
|
|
4041
4047
|
_addedData4 = _t$dataMatch5.addedData,
|
|
4042
4048
|
_updatedData4 = _t$dataMatch5.updatedData;
|
|
@@ -4052,7 +4058,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
4052
4058
|
try {
|
|
4053
4059
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
4054
4060
|
var _id3 = _step4.value;
|
|
4055
|
-
t.removeGraphic(_id3,
|
|
4061
|
+
t.removeGraphic(_id3, "line");
|
|
4056
4062
|
}
|
|
4057
4063
|
//增加
|
|
4058
4064
|
} catch (err) {
|
|
@@ -4066,7 +4072,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
4066
4072
|
}
|
|
4067
4073
|
//画其他特例线专用
|
|
4068
4074
|
if (customizedBoundary instanceof Array && t.props.customizedBoundary instanceof Array && !t.deepEqual(customizedBoundary, t.props.customizedBoundary)) {
|
|
4069
|
-
var _t$dataMatch6 = t.dataMatch(t.props.customizedBoundary, customizedBoundary,
|
|
4075
|
+
var _t$dataMatch6 = t.dataMatch(t.props.customizedBoundary, customizedBoundary, "id"),
|
|
4070
4076
|
_deletedDataIDs5 = _t$dataMatch6.deletedDataIDs,
|
|
4071
4077
|
_addedData5 = _t$dataMatch6.addedData,
|
|
4072
4078
|
_updatedData5 = _t$dataMatch6.updatedData;
|
|
@@ -4076,7 +4082,7 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
4076
4082
|
try {
|
|
4077
4083
|
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
4078
4084
|
var _id4 = _step5.value;
|
|
4079
|
-
t.removeGraphic(_id4,
|
|
4085
|
+
t.removeGraphic(_id4, "line");
|
|
4080
4086
|
}
|
|
4081
4087
|
} catch (err) {
|
|
4082
4088
|
_iterator5.e(err);
|
|
@@ -4100,39 +4106,39 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
4100
4106
|
t.heatMapOverlay(heatMapData);
|
|
4101
4107
|
}
|
|
4102
4108
|
//图元编辑调用
|
|
4103
|
-
if (typeof isDoEdit ==
|
|
4109
|
+
if (typeof isDoEdit == "boolean" && isDoEdit || isDoEdit && isDoEdit !== t.props.isDoEdit) {
|
|
4104
4110
|
t.doEdit(editGraphicId);
|
|
4105
4111
|
}
|
|
4106
4112
|
//关闭图元编辑
|
|
4107
|
-
if (typeof isEndEdit ==
|
|
4113
|
+
if (typeof isEndEdit == "boolean" && isEndEdit || isEndEdit && isEndEdit !== t.props.isEndEdit) {
|
|
4108
4114
|
t.endEdit();
|
|
4109
4115
|
}
|
|
4110
4116
|
//开启图元绘制
|
|
4111
|
-
if (typeof isDraw ==
|
|
4117
|
+
if (typeof isDraw == "boolean" && isDraw || isDraw && isDraw !== t.props.isDraw) {
|
|
4112
4118
|
t.draw(mapDraw);
|
|
4113
4119
|
}
|
|
4114
4120
|
//关闭图元绘制
|
|
4115
|
-
if (typeof isCloseDraw ==
|
|
4121
|
+
if (typeof isCloseDraw == "boolean" && isCloseDraw || isCloseDraw && isCloseDraw !== t.props.isCloseDraw) {
|
|
4116
4122
|
t.closeDraw();
|
|
4117
4123
|
}
|
|
4118
4124
|
//设置中心点
|
|
4119
|
-
if (typeof setCenter ==
|
|
4125
|
+
if (typeof setCenter == "boolean" && setCenter || setCenter && setCenter !== t.props.setCenter) {
|
|
4120
4126
|
t.setCenter(mapCenter);
|
|
4121
4127
|
}
|
|
4122
4128
|
//设置点聚合
|
|
4123
|
-
if (typeof setCluster ==
|
|
4129
|
+
if (typeof setCluster == "boolean" && setCluster || setCluster && setCluster !== t.props.setCluster) {
|
|
4124
4130
|
t.cluster(mapCluster);
|
|
4125
4131
|
}
|
|
4126
4132
|
//设置比例尺
|
|
4127
|
-
if (typeof setZoomLevel ==
|
|
4133
|
+
if (typeof setZoomLevel == "boolean" && setZoomLevel || setZoomLevel && setZoomLevel !== t.props.setZoomLevel) {
|
|
4128
4134
|
t.setZoomLevel(mapZoomLevel);
|
|
4129
4135
|
}
|
|
4130
4136
|
//设置最优视野
|
|
4131
|
-
if (typeof setVisiblePoints ==
|
|
4137
|
+
if (typeof setVisiblePoints == "boolean" && setVisiblePoints || setVisiblePoints && setVisiblePoints !== t.props.setVisiblePoints) {
|
|
4132
4138
|
t.setVisiblePoints(mapVisiblePoints);
|
|
4133
4139
|
}
|
|
4134
4140
|
//测距工具调用
|
|
4135
|
-
if (typeof isRangingTool ==
|
|
4141
|
+
if (typeof isRangingTool == "boolean" && isRangingTool || isRangingTool && isRangingTool !== t.props.isRangingTool) {
|
|
4136
4142
|
t.vtxRangingTool(mapRangingTool);
|
|
4137
4143
|
}
|
|
4138
4144
|
// //开关路况
|
|
@@ -4142,19 +4148,19 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
4142
4148
|
// t.hideTrafficInfo();
|
|
4143
4149
|
// }
|
|
4144
4150
|
//设置区域限制
|
|
4145
|
-
if (typeof isSetAreaRestriction ==
|
|
4151
|
+
if (typeof isSetAreaRestriction == "boolean" && isSetAreaRestriction || isSetAreaRestriction && isSetAreaRestriction !== t.props.isSetAreaRestriction && areaRestriction && !!areaRestriction[0] && !!areaRestriction[1]) {
|
|
4146
4152
|
t.setAreaRestriction(areaRestriction);
|
|
4147
4153
|
}
|
|
4148
4154
|
//关闭区域限制
|
|
4149
|
-
if (typeof isClearAreaRestriction ==
|
|
4155
|
+
if (typeof isClearAreaRestriction == "boolean" && isClearAreaRestriction || isClearAreaRestriction && isClearAreaRestriction !== t.props.isClearAreaRestriction) {
|
|
4150
4156
|
t.clearAreaRestriction();
|
|
4151
4157
|
}
|
|
4152
4158
|
//清空地图
|
|
4153
|
-
if (typeof isClearAll ==
|
|
4159
|
+
if (typeof isClearAll == "boolean" && isClearAll || isClearAll && isClearAll !== t.props.isClearAll) {
|
|
4154
4160
|
t.clearAll();
|
|
4155
4161
|
}
|
|
4156
4162
|
//删除指定图元
|
|
4157
|
-
if (typeof isRemove ==
|
|
4163
|
+
if (typeof isRemove == "boolean" && isRemove || isRemove && isRemove !== t.props.isRemove) {
|
|
4158
4164
|
mapRemove.map(function (item, index) {
|
|
4159
4165
|
t.removeGraphic(item.id, item.type);
|
|
4160
4166
|
});
|
|
@@ -4189,7 +4195,6 @@ var ArcgisMap = /*#__PURE__*/function (_React$Component) {
|
|
|
4189
4195
|
window.VtxMap[t.state.mapId] = null;
|
|
4190
4196
|
}
|
|
4191
4197
|
}]);
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
//# sourceMappingURL=Map.js.map
|
|
4198
|
+
return ArcgisMap;
|
|
4199
|
+
}(_react.default.Component);
|
|
4200
|
+
var _default = exports.default = ArcgisMap;
|