@vtx/map 1.1.4 → 1.1.7
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/lib/VtxMap/OlMap/Map.js +412 -90
- package/lib/VtxModal/VtxModal.css +0 -62
- package/lib/VtxModal/VtxModal.js +7 -9
- package/lib/VtxModal/VtxModal.less +6 -4
- package/lib/VtxModal/draggableModal.js +1 -1
- package/lib/VtxSearchMap/VtxSearchMap.css +0 -170
- package/lib/VtxSearchMap/VtxSearchMap.js +7 -8
- package/lib/VtxSearchMap/VtxSearchMap.less +14 -12
- package/lib/default.js +1 -1
- package/package.json +1 -1
package/lib/VtxMap/OlMap/Map.js
CHANGED
|
@@ -96,13 +96,26 @@ var OlMap = function (_React$Component) {
|
|
|
96
96
|
sketch: null,
|
|
97
97
|
helpTooltipElement: null,
|
|
98
98
|
helpTooltip: null,
|
|
99
|
-
deleteContent: null,
|
|
100
99
|
measureTooltipElement: null,
|
|
101
100
|
measureTooltip: null,
|
|
101
|
+
deleteToolTipElement: null,
|
|
102
102
|
deleteToolTip: null,
|
|
103
103
|
continuePolygonMsg: '点击继续绘制图形',
|
|
104
104
|
continueLineMsg: '点击继续绘制线',
|
|
105
|
-
listener: null
|
|
105
|
+
listener: null,
|
|
106
|
+
drawElements: [],
|
|
107
|
+
drawLayer: null,
|
|
108
|
+
feature: null,
|
|
109
|
+
draw: null
|
|
110
|
+
};
|
|
111
|
+
_this.clusterInfo = {
|
|
112
|
+
clickFeature: null,
|
|
113
|
+
clickResolution: null,
|
|
114
|
+
hoverFeature: null,
|
|
115
|
+
clusterSource: null,
|
|
116
|
+
clusterHulls: null,
|
|
117
|
+
clusters: null,
|
|
118
|
+
clusterCircles: null
|
|
106
119
|
};
|
|
107
120
|
_this.state = {
|
|
108
121
|
gis: null, //地图对象
|
|
@@ -142,7 +155,12 @@ var OlMap = function (_React$Component) {
|
|
|
142
155
|
resolve();
|
|
143
156
|
});
|
|
144
157
|
});
|
|
145
|
-
Promise
|
|
158
|
+
var Client9 = new Promise(function (resolve, reject) {
|
|
159
|
+
$.getScript(_default2.default.openlayerServerURL + '/iclient9-openlayers.js', function () {
|
|
160
|
+
resolve();
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
Promise.all([PointCollection, Client9]).then(function () {
|
|
146
164
|
resolve(window.OlMap);
|
|
147
165
|
});
|
|
148
166
|
});
|
|
@@ -315,16 +333,24 @@ var OlMap = function (_React$Component) {
|
|
|
315
333
|
mapZoomLevel = _t$props2.mapZoomLevel,
|
|
316
334
|
minZoom = _t$props2.minZoom,
|
|
317
335
|
maxZoom = _t$props2.maxZoom;
|
|
318
|
-
var
|
|
319
|
-
projection = _olProps$projection === undefined ? 'EPSG:4326' : _olProps$projection,
|
|
336
|
+
var projection = olProps.projection,
|
|
320
337
|
olCoverage = olProps.olCoverage;
|
|
321
338
|
|
|
322
|
-
if (window.
|
|
323
|
-
window.
|
|
339
|
+
if (window.VtxMap) {
|
|
340
|
+
window.VtxMap[mapId] = null;
|
|
324
341
|
} else {
|
|
325
|
-
window.
|
|
342
|
+
window.VtxMap = {};
|
|
326
343
|
}
|
|
327
|
-
|
|
344
|
+
if (!minZoom) {
|
|
345
|
+
minZoom = 2;
|
|
346
|
+
}
|
|
347
|
+
if (!maxZoom) {
|
|
348
|
+
maxZoom = 19;
|
|
349
|
+
}
|
|
350
|
+
if (!projection) {
|
|
351
|
+
projection = 'EPSG:4326';
|
|
352
|
+
}
|
|
353
|
+
window.VtxMap[mapId] = t.state.gis = new ol.Map({
|
|
328
354
|
target: mapId.toString(),
|
|
329
355
|
view: new ol.View({
|
|
330
356
|
center: mapCenter && mapCenter instanceof Array && mapCenter.length == 2 ? mapCenter : [116.400433, 39.906705], //中心点
|
|
@@ -349,14 +375,22 @@ var OlMap = function (_React$Component) {
|
|
|
349
375
|
});
|
|
350
376
|
if ((olCoverage || []).length > 0) {
|
|
351
377
|
(olCoverage || []).map(function (item) {
|
|
352
|
-
if (
|
|
353
|
-
|
|
378
|
+
if (item.coverage.startsWith("http") || item.coverage.startsWith('/')) {
|
|
379
|
+
// 超图图层
|
|
380
|
+
var _layer = new ol.layer.Tile({
|
|
381
|
+
source: new ol.source.TileSuperMapRest({
|
|
382
|
+
url: item.coverage
|
|
383
|
+
})
|
|
384
|
+
});
|
|
354
385
|
t.state.gis.addLayer(_layer);
|
|
386
|
+
} else if (OL_SCREEN[item.coverage]) {
|
|
387
|
+
var _layer2 = eval(OL_SCREEN[item.coverage].initLayer);
|
|
388
|
+
t.state.gis.addLayer(_layer2);
|
|
355
389
|
}
|
|
356
390
|
});
|
|
357
391
|
} else {
|
|
358
|
-
var
|
|
359
|
-
t.state.gis.addLayer(
|
|
392
|
+
var _layer3 = eval(OL_SCREEN.default.initLayer);
|
|
393
|
+
t.state.gis.addLayer(_layer3);
|
|
360
394
|
}
|
|
361
395
|
}
|
|
362
396
|
// 设置中心点
|
|
@@ -625,7 +659,7 @@ var OlMap = function (_React$Component) {
|
|
|
625
659
|
if ('editGraphicChange' in t.props && typeof t.props.editGraphicChange == 'function') {
|
|
626
660
|
t.props.editGraphicChange(param);
|
|
627
661
|
}
|
|
628
|
-
t.GM.setGraphic(id, feature).setGraphicParam(id, _extends({}, param));
|
|
662
|
+
t.GM.setGraphic(id, feature).setGraphicParam(id, _extends({}, param, { source: gp.source }));
|
|
629
663
|
});
|
|
630
664
|
}
|
|
631
665
|
t.editId = id;
|
|
@@ -920,28 +954,94 @@ var OlMap = function (_React$Component) {
|
|
|
920
954
|
};
|
|
921
955
|
}
|
|
922
956
|
}
|
|
923
|
-
|
|
957
|
+
/*工具方法*/
|
|
924
958
|
|
|
925
959
|
}, {
|
|
926
|
-
key: '
|
|
927
|
-
value: function
|
|
960
|
+
key: 'vtxRangingTool',
|
|
961
|
+
value: function vtxRangingTool() {
|
|
928
962
|
var t = this;
|
|
929
|
-
var
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
963
|
+
var source = new ol.source.Vector({});
|
|
964
|
+
t.rangingInfo.drawLayer = new ol.layer.Vector({
|
|
965
|
+
source: source,
|
|
966
|
+
style: new ol.style.Style({
|
|
967
|
+
fill: new ol.style.Fill({
|
|
968
|
+
color: 'rgba(255, 255, 255, 0.2)'
|
|
969
|
+
}),
|
|
970
|
+
stroke: new ol.style.Stroke({
|
|
971
|
+
color: '#ffcc33',
|
|
972
|
+
width: 4
|
|
973
|
+
}),
|
|
974
|
+
image: new ol.style.Circle({
|
|
975
|
+
radius: 7,
|
|
976
|
+
fill: new ol.style.Fill({
|
|
977
|
+
color: '#ffcc33'
|
|
978
|
+
})
|
|
979
|
+
})
|
|
980
|
+
})
|
|
981
|
+
});
|
|
982
|
+
t.rangingInfo.draw = new ol.interaction.Draw({
|
|
983
|
+
source: source,
|
|
984
|
+
type: 'LineString',
|
|
985
|
+
style: new ol.style.Style({
|
|
986
|
+
fill: new ol.style.Fill({
|
|
987
|
+
color: 'rgba(255, 255, 255, 0.2)'
|
|
988
|
+
}),
|
|
989
|
+
stroke: new ol.style.Stroke({
|
|
990
|
+
color: 'rgba(0, 0, 0, 0.5)',
|
|
991
|
+
lineDash: [10, 10],
|
|
992
|
+
width: 4
|
|
993
|
+
}),
|
|
994
|
+
image: new ol.style.Circle({
|
|
995
|
+
radius: 5,
|
|
996
|
+
stroke: new ol.style.Stroke({
|
|
997
|
+
color: 'rgba(0, 0, 0, 0.7)'
|
|
998
|
+
}),
|
|
999
|
+
fill: new ol.style.Fill({
|
|
1000
|
+
color: 'rgba(255, 255, 255, 0.2)'
|
|
1001
|
+
})
|
|
1002
|
+
})
|
|
1003
|
+
})
|
|
1004
|
+
});
|
|
1005
|
+
var obj = {};
|
|
1006
|
+
t.createHelpTooltip();
|
|
1007
|
+
t.createMeasureTooltip();
|
|
1008
|
+
t.createDeleteTooltip();
|
|
1009
|
+
t.state.gis.addLayer(t.rangingInfo.drawLayer);
|
|
1010
|
+
t.state.gis.addInteraction(t.rangingInfo.draw);
|
|
1011
|
+
// 开始监听绘制
|
|
1012
|
+
t.rangingInfo.draw.on('drawstart', function (evt) {
|
|
1013
|
+
t.rangingInfo.feature = evt.feature;
|
|
1014
|
+
var tooltipCoord = evt.coordinate;
|
|
1015
|
+
t.rangingInfo.listener = evt.feature.getGeometry().on('change', function (evt) {
|
|
1016
|
+
var geom = evt.target;
|
|
1017
|
+
var flatCoordinates = geom.flatCoordinates;
|
|
1018
|
+
|
|
1019
|
+
var lngLats = [[flatCoordinates[0], flatCoordinates[1]], [flatCoordinates[2], flatCoordinates[3]]];
|
|
1020
|
+
var output = t.formatLength(geom);
|
|
1021
|
+
tooltipCoord = geom.getLastCoordinate();
|
|
1022
|
+
obj = {
|
|
1023
|
+
distance: output,
|
|
1024
|
+
lnglats: lngLats
|
|
1025
|
+
};
|
|
1026
|
+
t.rangingInfo.measureTooltipElement.innerHTML = output;
|
|
1027
|
+
t.rangingInfo.measureTooltip.setPosition(tooltipCoord);
|
|
1028
|
+
t.rangingInfo.deleteToolTip.setPosition(tooltipCoord);
|
|
1029
|
+
t.rangingInfo.deleteToolTip.setOffset([20, 10]);
|
|
1030
|
+
});
|
|
1031
|
+
});
|
|
1032
|
+
// 双击绘制完成
|
|
1033
|
+
t.rangingInfo.draw.on('drawend', function () {
|
|
1034
|
+
t.rangingInfo.measureTooltipElement.className = 'ol-tooltip ol-tooltip-static';
|
|
1035
|
+
t.rangingInfo.measureTooltip.setOffset([0, -7]);
|
|
1036
|
+
t.rangingInfo.feature = null;
|
|
1037
|
+
t.rangingInfo.measureTooltipElement = null;
|
|
1038
|
+
// t.createMeasureTooltip();
|
|
1039
|
+
new ol.Observable.unByKey(t.rangingInfo.listener);
|
|
1040
|
+
t.state.gis.removeInteraction(t.rangingInfo.draw);
|
|
1041
|
+
if ('mapRangingTool' in t.props) {
|
|
1042
|
+
t.props.mapRangingTool(obj);
|
|
1043
|
+
}
|
|
943
1044
|
});
|
|
944
|
-
gis.addOverlay(drawInfo.measureTooltip);
|
|
945
1045
|
}
|
|
946
1046
|
// 绘图时创建提示
|
|
947
1047
|
|
|
@@ -949,42 +1049,88 @@ var OlMap = function (_React$Component) {
|
|
|
949
1049
|
key: 'createHelpTooltip',
|
|
950
1050
|
value: function createHelpTooltip() {
|
|
951
1051
|
var t = this;
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
if (drawInfo.helpTooltipElement) {
|
|
956
|
-
drawInfo.helpTooltipElement.parentNode.removeChild(helpTooltipElement);
|
|
1052
|
+
if (t.rangingTool.helpTooltipElement) {
|
|
1053
|
+
t.rangingTool.helpTooltipElement.parentNode.removeChild(t.rangingTool.helpTooltipElement);
|
|
957
1054
|
}
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
element:
|
|
1055
|
+
t.rangingTool.helpTooltipElement = document.createElement('div');
|
|
1056
|
+
t.rangingTool.helpTooltipElement.className = 'ol-tooltip hidden';
|
|
1057
|
+
t.rangingTool.helpTooltip = new ol.Overlay({
|
|
1058
|
+
element: t.rangingTool.helpTooltipElement,
|
|
962
1059
|
offset: [15, 0],
|
|
963
1060
|
positioning: 'center-left'
|
|
964
1061
|
});
|
|
965
|
-
gis.addOverlay(
|
|
1062
|
+
t.state.gis.addOverlay(t.rangingTool.helpTooltip);
|
|
966
1063
|
}
|
|
967
|
-
|
|
1064
|
+
// 工具画图提示
|
|
968
1065
|
|
|
969
1066
|
}, {
|
|
970
|
-
key: '
|
|
971
|
-
value: function
|
|
1067
|
+
key: 'createMeasureTooltip',
|
|
1068
|
+
value: function createMeasureTooltip() {
|
|
972
1069
|
var t = this;
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
//开启测距状态
|
|
976
|
-
if (!t.rangingTool.isRanging) {
|
|
977
|
-
t.rangingTool.isRanging = true;
|
|
978
|
-
}
|
|
979
|
-
//初始测距回调
|
|
980
|
-
if (!t.rangingTool.mapRangingTool) {
|
|
981
|
-
t.rangingTool.mapRangingTool = mapRangingTool;
|
|
1070
|
+
if (t.rangingInfo.measureTooltipElement) {
|
|
1071
|
+
t.rangingInfo.measureTooltipElement.parentNode.removeChild(t.rangingInfo.measureTooltipElement);
|
|
982
1072
|
}
|
|
1073
|
+
t.rangingInfo.measureTooltipElement = document.createElement('div');
|
|
1074
|
+
t.rangingInfo.measureTooltipElement.className = 'ol-tooltip ol-tooltip-measure';
|
|
1075
|
+
t.rangingInfo.measureTooltip = new ol.Overlay({
|
|
1076
|
+
element: t.rangingInfo.measureTooltipElement,
|
|
1077
|
+
offset: [0, -15],
|
|
1078
|
+
positioning: 'bottom-center',
|
|
1079
|
+
stopEvent: false,
|
|
1080
|
+
insertFirst: false
|
|
1081
|
+
});
|
|
1082
|
+
t.state.gis.addOverlay(t.rangingInfo.measureTooltip);
|
|
983
1083
|
}
|
|
984
|
-
//
|
|
1084
|
+
// 创建删除提示
|
|
985
1085
|
|
|
1086
|
+
}, {
|
|
1087
|
+
key: 'createDeleteTooltip',
|
|
1088
|
+
value: function createDeleteTooltip() {
|
|
1089
|
+
var t = this;
|
|
1090
|
+
if (t.rangingInfo.deleteToolTipElement) {
|
|
1091
|
+
t.rangingInfo.deleteToolTipElement.parentNode.removeChild(t.rangingInfo.deleteToolTipElement);
|
|
1092
|
+
}
|
|
1093
|
+
t.rangingInfo.deleteToolTipElement = document.createElement('div');
|
|
1094
|
+
t.rangingInfo.deleteToolTipElement.className = 'ol-tooltip-delete';
|
|
1095
|
+
t.rangingInfo.deleteToolTipElement.innerHTML = 'X';
|
|
1096
|
+
t.rangingInfo.deleteToolTipElement.addEventListener('click', function (e) {
|
|
1097
|
+
t.rangingInfo.measureTooltipElement = null;
|
|
1098
|
+
t.rangingInfo.helpTooltipElement = null;
|
|
1099
|
+
t.rangingInfo.deleteToolTipElement = null;
|
|
1100
|
+
t.state.gis.removeOverlay(t.rangingInfo.measureTooltip);
|
|
1101
|
+
t.state.gis.removeOverlay(t.rangingTool.helpTooltip);
|
|
1102
|
+
t.state.gis.removeOverlay(t.rangingInfo.deleteToolTip);
|
|
1103
|
+
new ol.Observable.unByKey(t.rangingInfo.listener);
|
|
1104
|
+
t.state.gis.removeInteraction(t.rangingInfo.draw);
|
|
1105
|
+
t.state.gis.removeLayer(t.rangingInfo.drawLayer);
|
|
1106
|
+
});
|
|
1107
|
+
t.rangingInfo.deleteToolTip = new ol.Overlay({
|
|
1108
|
+
element: t.rangingInfo.deleteToolTipElement,
|
|
1109
|
+
offset: [15, 15],
|
|
1110
|
+
positioning: 'bottom-center',
|
|
1111
|
+
stopEvent: false,
|
|
1112
|
+
insertFirst: true
|
|
1113
|
+
});
|
|
1114
|
+
t.state.gis.addOverlay(t.rangingInfo.deleteToolTip);
|
|
1115
|
+
}
|
|
1116
|
+
}, {
|
|
1117
|
+
key: 'formatLength',
|
|
1118
|
+
value: function formatLength(line) {
|
|
1119
|
+
var flatCoordinates = line.flatCoordinates;
|
|
1120
|
+
|
|
1121
|
+
var length = new ol.sphere.getDistance([flatCoordinates[0], flatCoordinates[1]], [flatCoordinates[2], flatCoordinates[3]]);
|
|
1122
|
+
var output = '';
|
|
1123
|
+
if (length > 100) {
|
|
1124
|
+
output = Math.round(length / 1000 * 100) / 100 + ' ' + 'km';
|
|
1125
|
+
} else {
|
|
1126
|
+
output = Math.round(length * 100) / 100 + ' ' + 'm';
|
|
1127
|
+
}
|
|
1128
|
+
return output;
|
|
1129
|
+
}
|
|
986
1130
|
}, {
|
|
987
1131
|
key: 'getMapExtent',
|
|
1132
|
+
|
|
1133
|
+
// 获取地图的当前位置状态信息
|
|
988
1134
|
value: function getMapExtent() {
|
|
989
1135
|
var t = this;
|
|
990
1136
|
var gis = t.state.gis;
|
|
@@ -1052,28 +1198,31 @@ var OlMap = function (_React$Component) {
|
|
|
1052
1198
|
}
|
|
1053
1199
|
if (typeof arg === 'string') {
|
|
1054
1200
|
ary = arg.split(',');
|
|
1055
|
-
obj = t.getFitView(ary);
|
|
1056
1201
|
} else if (arg instanceof Array) {
|
|
1057
|
-
|
|
1058
|
-
obj = gis.getFitView(ary[0]);
|
|
1059
|
-
} else {
|
|
1060
|
-
obj = t.getFitView(arg);
|
|
1061
|
-
}
|
|
1202
|
+
ary = arg;
|
|
1062
1203
|
}
|
|
1063
|
-
|
|
1064
|
-
|
|
1204
|
+
for (var i = 0; i < ary.length; i++) {
|
|
1205
|
+
var g = t.GM.getGraphicParam(ary[i]);
|
|
1206
|
+
if (g) {
|
|
1207
|
+
switch (g.geometry.type) {
|
|
1208
|
+
case 'point':
|
|
1209
|
+
obj.push([g.geometry.x, g.geometry.y]);
|
|
1210
|
+
case 'circle':
|
|
1211
|
+
obj.push([g.geometry.x, g.geometry.y]);
|
|
1212
|
+
break;
|
|
1213
|
+
case 'polyline':
|
|
1214
|
+
obj = [].concat(_toConsumableArray(obj), _toConsumableArray(g.geometry.paths));
|
|
1215
|
+
break;
|
|
1216
|
+
case 'polygon':
|
|
1217
|
+
obj = [].concat(_toConsumableArray(obj), _toConsumableArray(g.geometry.rings));
|
|
1218
|
+
break;
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1065
1221
|
}
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
gis.getView().fit(
|
|
1222
|
+
if (obj.length > 0) {
|
|
1223
|
+
var displayRange = new ol.extent.boundingExtent(obj);
|
|
1224
|
+
gis.getView().fit(displayRange, gis.getSize());
|
|
1069
1225
|
}
|
|
1070
|
-
// if(!type || type == 'all'){
|
|
1071
|
-
|
|
1072
|
-
// }else if(type == 'zoom'){
|
|
1073
|
-
// gis.getView().setZoom(zoom)
|
|
1074
|
-
// }else if(type == 'center'){
|
|
1075
|
-
// gis.getView().setCenter(obj.lngLat);
|
|
1076
|
-
// }
|
|
1077
1226
|
}
|
|
1078
1227
|
}, {
|
|
1079
1228
|
key: 'getFitView',
|
|
@@ -1332,6 +1481,7 @@ var OlMap = function (_React$Component) {
|
|
|
1332
1481
|
var t = this;
|
|
1333
1482
|
var ps = [];
|
|
1334
1483
|
var psids = [].concat(_toConsumableArray(t.state.pointIds));
|
|
1484
|
+
console.log('addPoint', mapPoints);
|
|
1335
1485
|
mapPoints.map(function (item, index) {
|
|
1336
1486
|
//如果id重复,直接跳过不执行.
|
|
1337
1487
|
if (_this2.GM.isRepetition(item.id)) {
|
|
@@ -1476,6 +1626,7 @@ var OlMap = function (_React$Component) {
|
|
|
1476
1626
|
var mapPoints = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
1477
1627
|
|
|
1478
1628
|
var t = this;
|
|
1629
|
+
console.log('updatePoint', mapPoints);
|
|
1479
1630
|
mapPoints.map(function (item, index) {
|
|
1480
1631
|
//判断图元是否存在.
|
|
1481
1632
|
if (_this3.GM.isRepetition(item.id)) {
|
|
@@ -1485,6 +1636,7 @@ var OlMap = function (_React$Component) {
|
|
|
1485
1636
|
return false;
|
|
1486
1637
|
}
|
|
1487
1638
|
var gc = t.GM.getGraphic(item.id);
|
|
1639
|
+
var gp = t.GM.getGraphicParam(item.id);
|
|
1488
1640
|
var cg = {
|
|
1489
1641
|
width: 30,
|
|
1490
1642
|
height: 30,
|
|
@@ -1561,7 +1713,7 @@ var OlMap = function (_React$Component) {
|
|
|
1561
1713
|
x: item.longitude,
|
|
1562
1714
|
y: item.latitude
|
|
1563
1715
|
},
|
|
1564
|
-
source:
|
|
1716
|
+
source: gp.source
|
|
1565
1717
|
});
|
|
1566
1718
|
} else {
|
|
1567
1719
|
console.warn('\u66F4\u65B0\u7684\u70B9\u4F4Did\u4E0D\u5B58\u5728!');
|
|
@@ -1812,6 +1964,7 @@ var OlMap = function (_React$Component) {
|
|
|
1812
1964
|
}
|
|
1813
1965
|
//获取原有的图元
|
|
1814
1966
|
var gc = _this7.GM.getGraphic(item.id);
|
|
1967
|
+
var gp = t.GM.getGraphicParam(item.id);
|
|
1815
1968
|
//获取原有的面属性,转换key值
|
|
1816
1969
|
var cg = {
|
|
1817
1970
|
lineType: 'solid',
|
|
@@ -1849,7 +2002,7 @@ var OlMap = function (_React$Component) {
|
|
|
1849
2002
|
type: 'polygon',
|
|
1850
2003
|
rings: pts
|
|
1851
2004
|
},
|
|
1852
|
-
source:
|
|
2005
|
+
source: gp.source
|
|
1853
2006
|
});
|
|
1854
2007
|
} else {
|
|
1855
2008
|
console.warn('\u66F4\u65B0\u7684\u591A\u8FB9\u5F62id\u4E0D\u5B58\u5728!');
|
|
@@ -1960,6 +2113,7 @@ var OlMap = function (_React$Component) {
|
|
|
1960
2113
|
}
|
|
1961
2114
|
//获取原有的图元
|
|
1962
2115
|
var gc = t.GM.getGraphic(item.id);
|
|
2116
|
+
var gp = t.GM.getGraphicParam(item.id);
|
|
1963
2117
|
//获取原有的面属性,转换key值
|
|
1964
2118
|
var cg = {
|
|
1965
2119
|
lineType: 'solid',
|
|
@@ -1995,7 +2149,7 @@ var OlMap = function (_React$Component) {
|
|
|
1995
2149
|
y: parseFloat(item.latitude),
|
|
1996
2150
|
radius: parseFloat(item.radius)
|
|
1997
2151
|
},
|
|
1998
|
-
source:
|
|
2152
|
+
source: gp.source
|
|
1999
2153
|
});
|
|
2000
2154
|
});
|
|
2001
2155
|
//刷新图元
|
|
@@ -2105,11 +2259,28 @@ var OlMap = function (_React$Component) {
|
|
|
2105
2259
|
return item.name == 'heatMap';
|
|
2106
2260
|
})[0];
|
|
2107
2261
|
hMap.getSource().clear();
|
|
2108
|
-
|
|
2262
|
+
gis.removeLayer(layer);
|
|
2109
2263
|
}
|
|
2110
2264
|
t.heatmap = null;
|
|
2111
2265
|
t.movePoints = [];
|
|
2266
|
+
t.pointLayers.map(function (item) {
|
|
2267
|
+
gis.removeLayer(item);
|
|
2268
|
+
t.pointLayers = [];
|
|
2269
|
+
});
|
|
2112
2270
|
t.clearAllPointCollection();
|
|
2271
|
+
t.closeDraw();
|
|
2272
|
+
if (t.clusterInfo.clusterHulls || t.clusterInfo.clusters || t.clusterInfo.clusterCircles) {
|
|
2273
|
+
t.clusterHulls.getSource().clear();
|
|
2274
|
+
t.clusterInfo.clusterSource = null;
|
|
2275
|
+
gis.removeLayer(t.clusterInfo.clusterHulls);
|
|
2276
|
+
gis.removeLayer(t.clusterInfo.clusters);
|
|
2277
|
+
gis.removeLayer(t.clusterInfo.clusterCircles);
|
|
2278
|
+
t.clusterInfo.clusterHulls = null;
|
|
2279
|
+
t.clusterInfo.clusters = null;
|
|
2280
|
+
t.clusterInfo.clusterCircles = null;
|
|
2281
|
+
}
|
|
2282
|
+
//清空缓存数据
|
|
2283
|
+
t.GM.clearAll();
|
|
2113
2284
|
//循环所有id删除
|
|
2114
2285
|
var _t$state = t.state,
|
|
2115
2286
|
pointIds = _t$state.pointIds,
|
|
@@ -2241,6 +2412,152 @@ var OlMap = function (_React$Component) {
|
|
|
2241
2412
|
if (y > ymax1) y = ymax1 - 0.1;
|
|
2242
2413
|
t.state.gis.getView().setCenter([x, y]);
|
|
2243
2414
|
}
|
|
2415
|
+
//聚合地图图元(arg为空时聚合全部点)
|
|
2416
|
+
|
|
2417
|
+
}, {
|
|
2418
|
+
key: 'cluster',
|
|
2419
|
+
value: function cluster(arg) {
|
|
2420
|
+
var t = this;
|
|
2421
|
+
var ary = [];
|
|
2422
|
+
if (!arg) {
|
|
2423
|
+
var pointIds = t.state.pointIds;
|
|
2424
|
+
|
|
2425
|
+
ary = pointIds;
|
|
2426
|
+
} else {
|
|
2427
|
+
if (Object.prototype.toString.apply(arg) === '[object Array]') {
|
|
2428
|
+
ary = arg;
|
|
2429
|
+
} else if (typeof arg === 'string') {
|
|
2430
|
+
ary = arg.split(',');
|
|
2431
|
+
}
|
|
2432
|
+
}
|
|
2433
|
+
t.pointLayers.map(function (item) {
|
|
2434
|
+
t.state.gis.removeLayer(item.layer);
|
|
2435
|
+
t.pointLayers = [];
|
|
2436
|
+
});
|
|
2437
|
+
var ms = this.GM.getMoreGraphic(ary).filter(function (item, index) {
|
|
2438
|
+
// return !item && item != 0 ? false : true;
|
|
2439
|
+
return item && item.getGeometry().getType() === 'Point' && !item.label;
|
|
2440
|
+
});
|
|
2441
|
+
var source = new ol.source.Vector({
|
|
2442
|
+
features: ms
|
|
2443
|
+
});
|
|
2444
|
+
t.clusterInfo.clusterSource = new ol.source.Cluster({
|
|
2445
|
+
distance: 80,
|
|
2446
|
+
minDistance: 0,
|
|
2447
|
+
source: source
|
|
2448
|
+
});
|
|
2449
|
+
t.clusterInfo.clusterHulls = new ol.layer.Vector({
|
|
2450
|
+
source: t.clusterInfo.clusterSource,
|
|
2451
|
+
style: clusterHullStyle
|
|
2452
|
+
});
|
|
2453
|
+
t.state.gis.addLayer(t.clusterInfo.clusterHulls);
|
|
2454
|
+
t.clusterInfo.clusters = new ol.layer.Vector({
|
|
2455
|
+
source: t.clusterInfo.clusterSource,
|
|
2456
|
+
style: clusterStyle
|
|
2457
|
+
});
|
|
2458
|
+
t.state.gis.addLayer(t.clusterInfo.clusters);
|
|
2459
|
+
t.clusterInfo.clusterCircles = new ol.layer.Vector({
|
|
2460
|
+
source: t.clusterInfo.clusterSource,
|
|
2461
|
+
style: clusterCircleStyle
|
|
2462
|
+
});
|
|
2463
|
+
t.state.gis.addLayer(t.clusterInfo.clusterCircles);
|
|
2464
|
+
function clusterMemberStyle(clusterMember) {
|
|
2465
|
+
var style = clusterMember.getStyle();
|
|
2466
|
+
var image = style.getImage();
|
|
2467
|
+
return new ol.style.Style({
|
|
2468
|
+
geometry: clusterMember.getGeometry(),
|
|
2469
|
+
image: image
|
|
2470
|
+
});
|
|
2471
|
+
}
|
|
2472
|
+
function clusterCircleStyle(cluster, resolution) {
|
|
2473
|
+
if (cluster !== t.clusterInfo.clickFeature || resolution !== t.clusterInfo.clickResolution) {
|
|
2474
|
+
return;
|
|
2475
|
+
}
|
|
2476
|
+
var clusterMembers = cluster.get('features');
|
|
2477
|
+
var centerCoordinates = cluster.getGeometry().getCoordinates();
|
|
2478
|
+
return generatePointsCircle(clusterMembers.length, cluster.getGeometry().getCoordinates(), resolution).reduce(function (styles, coordinates, i) {
|
|
2479
|
+
var point = new ol.geom.Point(coordinates);
|
|
2480
|
+
var line = new ol.geom.LineString([centerCoordinates, coordinates]);
|
|
2481
|
+
styles.unshift(new ol.style.Style({
|
|
2482
|
+
geometry: line,
|
|
2483
|
+
stroke: new ol.style.Stroke({
|
|
2484
|
+
color: 'rgba(204, 85, 0, 1)',
|
|
2485
|
+
width: 1.5
|
|
2486
|
+
})
|
|
2487
|
+
}));
|
|
2488
|
+
styles.push(clusterMemberStyle(new ol.Feature(_extends({}, clusterMembers[i].getProperties(), {
|
|
2489
|
+
geometry: point
|
|
2490
|
+
}))));
|
|
2491
|
+
return styles;
|
|
2492
|
+
}, []);
|
|
2493
|
+
}
|
|
2494
|
+
function generatePointsCircle(count, clusterCenter, resolution) {
|
|
2495
|
+
var circumference = 1 * 28 * (2 + count);
|
|
2496
|
+
var legLength = circumference / (Math.PI * 2); //radius from circumference
|
|
2497
|
+
var angleStep = Math.PI * 2 / count;
|
|
2498
|
+
var res = [];
|
|
2499
|
+
var angle = void 0;
|
|
2500
|
+
legLength = Math.max(legLength, 35) * resolution; // Minimum distance to get outside the cluster icon.
|
|
2501
|
+
for (var i = 0; i < count; ++i) {
|
|
2502
|
+
// Clockwise, like spiral.
|
|
2503
|
+
angle = Math.PI / 2 + i * angleStep;
|
|
2504
|
+
res.push([clusterCenter[0] + legLength * Math.cos(angle), clusterCenter[1] + legLength * Math.sin(angle)]);
|
|
2505
|
+
}
|
|
2506
|
+
return res;
|
|
2507
|
+
}
|
|
2508
|
+
function clusterHullStyle(cluster) {
|
|
2509
|
+
if (cluster !== t.clusterInfo.hoverFeature) {
|
|
2510
|
+
return;
|
|
2511
|
+
}
|
|
2512
|
+
var originalFeatures = cluster.get('features');
|
|
2513
|
+
var points = originalFeatures.map(function (feature) {
|
|
2514
|
+
return feature.getGeometry().getCoordinates();
|
|
2515
|
+
});
|
|
2516
|
+
return new ol.style.Style({
|
|
2517
|
+
geometry: new ol.geom.Polygon(points),
|
|
2518
|
+
fill: new ol.style.Fill({
|
|
2519
|
+
color: 'rgba(255, 153, 0, 0.4)'
|
|
2520
|
+
}),
|
|
2521
|
+
stroke: new ol.style.Stroke({
|
|
2522
|
+
color: 'rgba(204, 85, 0, 1)',
|
|
2523
|
+
width: 1.5
|
|
2524
|
+
})
|
|
2525
|
+
});
|
|
2526
|
+
}
|
|
2527
|
+
function clusterStyle(feature) {
|
|
2528
|
+
var size = feature.get('features').length;
|
|
2529
|
+
if (size > 1) {
|
|
2530
|
+
return [new ol.style.Style({
|
|
2531
|
+
image: new ol.style.Circle({
|
|
2532
|
+
radius: 20,
|
|
2533
|
+
fill: new ol.style.Fill({
|
|
2534
|
+
color: 'rgba(255, 153, 102, 0.3)'
|
|
2535
|
+
})
|
|
2536
|
+
})
|
|
2537
|
+
}), new ol.style.Style({
|
|
2538
|
+
image: new ol.style.Circle({
|
|
2539
|
+
radius: 14,
|
|
2540
|
+
fill: new ol.style.Fill({
|
|
2541
|
+
color: 'rgba(255, 165, 0, 0.7)'
|
|
2542
|
+
})
|
|
2543
|
+
}),
|
|
2544
|
+
text: new ol.style.Text({
|
|
2545
|
+
text: size.toString(),
|
|
2546
|
+
fill: new ol.style.Fill({
|
|
2547
|
+
color: '#fff'
|
|
2548
|
+
}),
|
|
2549
|
+
stroke: new ol.style.Stroke({
|
|
2550
|
+
color: 'rgba(0, 0, 0, 0.6)',
|
|
2551
|
+
width: 3
|
|
2552
|
+
})
|
|
2553
|
+
})
|
|
2554
|
+
})];
|
|
2555
|
+
} else {
|
|
2556
|
+
var originalFeature = feature.get('features')[0];
|
|
2557
|
+
return clusterMemberStyle(originalFeature);
|
|
2558
|
+
}
|
|
2559
|
+
}
|
|
2560
|
+
}
|
|
2244
2561
|
/*公共方法*/
|
|
2245
2562
|
//判断extent1是否在extent2内部
|
|
2246
2563
|
|
|
@@ -2276,7 +2593,7 @@ var OlMap = function (_React$Component) {
|
|
|
2276
2593
|
}, {
|
|
2277
2594
|
key: 'calculatePointsDistance',
|
|
2278
2595
|
value: function calculatePointsDistance(fp, ep) {
|
|
2279
|
-
return Math.round(ol.sphere.getDistance(fp, ep));
|
|
2596
|
+
return Math.round(new ol.sphere.getDistance(fp, ep));
|
|
2280
2597
|
}
|
|
2281
2598
|
//计算多个点的距离(常用于线计算)
|
|
2282
2599
|
|
|
@@ -2692,6 +3009,8 @@ var OlMap = function (_React$Component) {
|
|
|
2692
3009
|
pointData[1]的数据在idsForGraphicId中不存在的,执行新增
|
|
2693
3010
|
pointData[0]数据中多余的id,执行删除
|
|
2694
3011
|
*/
|
|
3012
|
+
console.log(mapPoints, t.props.mapPoints);
|
|
3013
|
+
console.log(!t.deepEqual(mapPoints, t.props.mapPoints));
|
|
2695
3014
|
if (mapPoints instanceof Array && t.props.mapPoints instanceof Array && !t.deepEqual(mapPoints, t.props.mapPoints)) {
|
|
2696
3015
|
var oldMapPoints = t.props.mapPoints;
|
|
2697
3016
|
var newMapPoints = mapPoints;
|
|
@@ -2954,10 +3273,13 @@ var OlMap = function (_React$Component) {
|
|
|
2954
3273
|
t.setVisiblePoints(mapVisiblePoints);
|
|
2955
3274
|
}
|
|
2956
3275
|
//设置中心点
|
|
2957
|
-
if (typeof setCenter == 'boolean' && setCenter || setCenter && setCenter !== t.props.setCenter) {
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
3276
|
+
// if ((typeof (setCenter) == 'boolean' && setCenter) || (setCenter && setCenter !== t.props.setCenter)) {
|
|
3277
|
+
// if (!(t.getCurrentCenter().lng == mapCenter[0] && t.getCurrentCenter().lat == mapCenter[1])) {
|
|
3278
|
+
// t.setCenter(mapCenter);
|
|
3279
|
+
// }
|
|
3280
|
+
// }
|
|
3281
|
+
if (nextProps.mapCenter && nextProps.mapCenter.length > 0 && JSON.stringify(nextProps.mapCenter) !== JSON.stringify(this.props.mapCenter)) {
|
|
3282
|
+
t.setCenter(mapCenter);
|
|
2961
3283
|
}
|
|
2962
3284
|
//设置点聚合
|
|
2963
3285
|
if (typeof setCluster == 'boolean' && setCluster || setCluster && setCluster !== t.props.setCluster) {
|
|
@@ -3027,8 +3349,8 @@ var OlMap = function (_React$Component) {
|
|
|
3027
3349
|
e: e,
|
|
3028
3350
|
id: id,
|
|
3029
3351
|
param: t.getGraphic(id),
|
|
3030
|
-
top: e.
|
|
3031
|
-
left: e.
|
|
3352
|
+
top: e.pixel ? e.pixel[0] : undefined, //当前点所在的位置(屏幕)
|
|
3353
|
+
left: e.pixel ? e.pixel[1] : undefined
|
|
3032
3354
|
};
|
|
3033
3355
|
t.props.mouseOverGraphic(obj);
|
|
3034
3356
|
}
|
|
@@ -3046,8 +3368,8 @@ var OlMap = function (_React$Component) {
|
|
|
3046
3368
|
e: e,
|
|
3047
3369
|
id: id,
|
|
3048
3370
|
param: t.getGraphic(id),
|
|
3049
|
-
top: e.
|
|
3050
|
-
left: e.
|
|
3371
|
+
top: e.pixel ? e.pixel[0] : undefined, //当前点所在的位置(屏幕)
|
|
3372
|
+
left: e.pixel ? e.pixel[1] : undefined
|
|
3051
3373
|
};
|
|
3052
3374
|
t.props.mouseOutGraphic(obj);
|
|
3053
3375
|
}
|
|
@@ -3190,9 +3512,9 @@ var OlMap = function (_React$Component) {
|
|
|
3190
3512
|
//编辑中的图元关闭其他事件返回
|
|
3191
3513
|
if (t.editId == id) return false;
|
|
3192
3514
|
if (typeof t.props.clickGraphic === 'function') {
|
|
3193
|
-
var _e$
|
|
3194
|
-
clientX = _e$
|
|
3195
|
-
clientY = _e$
|
|
3515
|
+
var _e$pixel = _slicedToArray(e.pixel, 2),
|
|
3516
|
+
clientX = _e$pixel[0],
|
|
3517
|
+
clientY = _e$pixel[1];
|
|
3196
3518
|
|
|
3197
3519
|
var param = t.getGraphic(id, clientX, clientY);
|
|
3198
3520
|
var obj = {
|
|
@@ -3221,7 +3543,7 @@ var OlMap = function (_React$Component) {
|
|
|
3221
3543
|
clearInterval(t.animTimer[j]);
|
|
3222
3544
|
}
|
|
3223
3545
|
}
|
|
3224
|
-
window.
|
|
3546
|
+
window.VtxMap[t.state.mapId] = null;
|
|
3225
3547
|
}
|
|
3226
3548
|
}]);
|
|
3227
3549
|
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
.vtx-ui-modal-normal .ant-modal .ant-modal-content {
|
|
2
|
-
height: 100%;
|
|
3
|
-
}
|
|
4
|
-
.vtx-ui-modal-normal .ant-modal .ant-modal-content .ant-modal-body {
|
|
5
|
-
max-height: calc(100% - 108px);
|
|
6
|
-
overflow: auto;
|
|
7
|
-
background-color: #fbfbfb;
|
|
8
|
-
}
|
|
9
|
-
.vtx-ui-modal-normal .vtx-ui-modal-title {
|
|
10
|
-
position: relative;
|
|
11
|
-
width: 100%;
|
|
12
|
-
}
|
|
13
|
-
.vtx-ui-modal-normal .vtx-ui-modal-title .vtx-ui-modal-title_name {
|
|
14
|
-
width: 100%;
|
|
15
|
-
color: #108EE2;
|
|
16
|
-
}
|
|
17
|
-
.vtx-ui-modal-normal .vtx-ui-modal-title .vtx-ui-modal-close,
|
|
18
|
-
.vtx-ui-modal-normal .vtx-ui-modal-title .vtx-ui-modal-maximizeIcon {
|
|
19
|
-
position: absolute;
|
|
20
|
-
top: -13px;
|
|
21
|
-
right: -16px;
|
|
22
|
-
}
|
|
23
|
-
.vtx-ui-modal-normal .vtx-ui-modal-title .vtx-ui-modal-close p,
|
|
24
|
-
.vtx-ui-modal-normal .vtx-ui-modal-title .vtx-ui-modal-maximizeIcon p {
|
|
25
|
-
width: 36px;
|
|
26
|
-
height: 48px;
|
|
27
|
-
text-align: center;
|
|
28
|
-
line-height: 48px;
|
|
29
|
-
cursor: pointer;
|
|
30
|
-
border: 0;
|
|
31
|
-
background: transparent;
|
|
32
|
-
position: absolute;
|
|
33
|
-
right: 0;
|
|
34
|
-
top: 0;
|
|
35
|
-
z-index: 10;
|
|
36
|
-
font-weight: 700;
|
|
37
|
-
text-decoration: none;
|
|
38
|
-
-webkit-transition: color 0.3s ease;
|
|
39
|
-
transition: color 0.3s ease;
|
|
40
|
-
color: rgba(0, 0, 0, 0.43);
|
|
41
|
-
outline: 0;
|
|
42
|
-
display: inline-block;
|
|
43
|
-
}
|
|
44
|
-
.vtx-ui-modal-normal .vtx-ui-modal-title .vtx-ui-modal-close p:hover,
|
|
45
|
-
.vtx-ui-modal-normal .vtx-ui-modal-title .vtx-ui-modal-maximizeIcon p:hover {
|
|
46
|
-
color: #444;
|
|
47
|
-
text-decoration: none;
|
|
48
|
-
}
|
|
49
|
-
.vtx-ui-modal-normal .vtx-ui-modal-title .vtx-ui-modal-maximizeIcon {
|
|
50
|
-
right: 20px;
|
|
51
|
-
}
|
|
52
|
-
.vtx-ui-modal-maxClass .ant-modal {
|
|
53
|
-
top: 0 !important;
|
|
54
|
-
left: 0 !important;
|
|
55
|
-
width: 100% !important;
|
|
56
|
-
height: 100% !important;
|
|
57
|
-
padding-bottom: 0 !important;
|
|
58
|
-
overflow: hidden;
|
|
59
|
-
}
|
|
60
|
-
.vtx-ui-modal-maxClass .ant-modal-body {
|
|
61
|
-
height: calc(100% - 108px) !important;
|
|
62
|
-
}
|
package/lib/VtxModal/VtxModal.js
CHANGED
|
@@ -12,19 +12,17 @@ var _react = require('react');
|
|
|
12
12
|
|
|
13
13
|
var _react2 = _interopRequireDefault(_react);
|
|
14
14
|
|
|
15
|
-
require('./VtxModal.
|
|
15
|
+
require('./VtxModal.less');
|
|
16
16
|
|
|
17
17
|
var _modal = require('antd/lib/modal');
|
|
18
18
|
|
|
19
19
|
var _modal2 = _interopRequireDefault(_modal);
|
|
20
20
|
|
|
21
|
-
require('antd/lib/modal/style
|
|
21
|
+
require('antd/lib/modal/style');
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
require('antd/lib/icon/style');
|
|
24
24
|
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
require('antd/lib/icon/style/css');
|
|
25
|
+
var _default = require('../default');
|
|
28
26
|
|
|
29
27
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
30
28
|
|
|
@@ -197,7 +195,7 @@ var VtxModal = function (_React$Component) {
|
|
|
197
195
|
});
|
|
198
196
|
}
|
|
199
197
|
},
|
|
200
|
-
maximizable ? _react2.default.createElement(
|
|
198
|
+
maximizable ? _react2.default.createElement(_default.VtxMapIcon, { type: 'icon-shrink' }) : _react2.default.createElement(_default.VtxMapIcon, { type: 'icon-arrawsalt' })
|
|
201
199
|
)
|
|
202
200
|
) : null,
|
|
203
201
|
closable ? _react2.default.createElement(
|
|
@@ -206,9 +204,9 @@ var VtxModal = function (_React$Component) {
|
|
|
206
204
|
_react2.default.createElement(
|
|
207
205
|
'p',
|
|
208
206
|
{ onClick: t.props.onCancel },
|
|
209
|
-
_react2.default.createElement(
|
|
207
|
+
_react2.default.createElement(_default.VtxMapIcon, { type: 'icon-close' })
|
|
210
208
|
)
|
|
211
|
-
) :
|
|
209
|
+
) : null
|
|
212
210
|
);
|
|
213
211
|
}();
|
|
214
212
|
var bodyStyle = _extends({}, this.props.bodyStyle);
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@import (reference) '~antd/lib/style/themes/index.less';
|
|
2
|
+
|
|
1
3
|
.vtx-ui-modal-normal{
|
|
2
4
|
.ant-modal{
|
|
3
5
|
.ant-modal-content{
|
|
@@ -5,7 +7,7 @@
|
|
|
5
7
|
.ant-modal-body{
|
|
6
8
|
max-height: e('calc(100% - 108px)');
|
|
7
9
|
overflow: auto;
|
|
8
|
-
background-color:
|
|
10
|
+
background-color: @table-expanded-row-bg;
|
|
9
11
|
}
|
|
10
12
|
}
|
|
11
13
|
}
|
|
@@ -14,7 +16,7 @@
|
|
|
14
16
|
width: 100%;
|
|
15
17
|
.vtx-ui-modal-title_name{
|
|
16
18
|
width: 100%;
|
|
17
|
-
color:
|
|
19
|
+
color: @primary-color;
|
|
18
20
|
}
|
|
19
21
|
.vtx-ui-modal-close,.vtx-ui-modal-maximizeIcon{
|
|
20
22
|
position: absolute;
|
|
@@ -36,11 +38,11 @@
|
|
|
36
38
|
text-decoration: none;
|
|
37
39
|
-webkit-transition: color .3s ease;
|
|
38
40
|
transition: color .3s ease;
|
|
39
|
-
color:
|
|
41
|
+
color: @text-color;
|
|
40
42
|
outline: 0;
|
|
41
43
|
display: inline-block;
|
|
42
44
|
&:hover{
|
|
43
|
-
color:
|
|
45
|
+
color: @text-color-secondary;
|
|
44
46
|
text-decoration: none;
|
|
45
47
|
}
|
|
46
48
|
}
|
|
@@ -20,7 +20,7 @@ var _modal = require('antd/lib/modal');
|
|
|
20
20
|
|
|
21
21
|
var _modal2 = _interopRequireDefault(_modal);
|
|
22
22
|
|
|
23
|
-
require('antd/lib/modal/style
|
|
23
|
+
require('antd/lib/modal/style');
|
|
24
24
|
|
|
25
25
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
26
26
|
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
.vtx-ui-searchmap-searchmodal {
|
|
2
|
-
z-index: 1001;
|
|
3
|
-
}
|
|
4
|
-
.vtx-ui-searchmap-searchmodal .ant-modal {
|
|
5
|
-
width: calc(100% - 200px) !important;
|
|
6
|
-
min-width: 800px;
|
|
7
|
-
height: 70vh;
|
|
8
|
-
}
|
|
9
|
-
.vtx-ui-searchmap-searchmodal .ant-modal .ant-modal-title {
|
|
10
|
-
color: #108EE9;
|
|
11
|
-
}
|
|
12
|
-
.vtx-ui-searchmap-searchmodal .ant-modal .ant-modal-content {
|
|
13
|
-
width: 100%;
|
|
14
|
-
height: 100%;
|
|
15
|
-
}
|
|
16
|
-
.vtx-ui-searchmap-searchmodal .ant-modal .ant-modal-content .ant-modal-body {
|
|
17
|
-
width: 100%;
|
|
18
|
-
height: calc(100% - 108px) !important;
|
|
19
|
-
padding: 0px;
|
|
20
|
-
background-color: white;
|
|
21
|
-
}
|
|
22
|
-
.vtx-ui-searchmap-searchmodal .vtx-ui-searchmap-searchmap {
|
|
23
|
-
width: 100%;
|
|
24
|
-
height: 100%;
|
|
25
|
-
padding-top: 48px;
|
|
26
|
-
box-sizing: border-box;
|
|
27
|
-
position: relative;
|
|
28
|
-
overflow: hidden;
|
|
29
|
-
}
|
|
30
|
-
.vtx-ui-searchmap-searchmodal .vtx-ui-searchmap-searchmap .vtx-ui-searchmap-top,
|
|
31
|
-
.vtx-ui-searchmap-searchmodal .vtx-ui-searchmap-searchmap .vtx-ui-searchmap-bottom {
|
|
32
|
-
width: 100%;
|
|
33
|
-
height: 48px;
|
|
34
|
-
position: absolute;
|
|
35
|
-
left: 0px;
|
|
36
|
-
padding: 10px 15px;
|
|
37
|
-
}
|
|
38
|
-
.vtx-ui-searchmap-searchmodal .vtx-ui-searchmap-searchmap .vtx-ui-searchmap-top button,
|
|
39
|
-
.vtx-ui-searchmap-searchmodal .vtx-ui-searchmap-searchmap .vtx-ui-searchmap-bottom button {
|
|
40
|
-
margin-left: 10px;
|
|
41
|
-
}
|
|
42
|
-
.vtx-ui-searchmap-searchmodal .vtx-ui-searchmap-searchmap .vtx-ui-searchmap-top {
|
|
43
|
-
top: 0px;
|
|
44
|
-
border-bottom: 1px solid #e1e1e1;
|
|
45
|
-
}
|
|
46
|
-
.vtx-ui-searchmap-searchmodal .vtx-ui-searchmap-searchmap .vtx-ui-searchmap-top .vtx-ui-searchmap-othermodal {
|
|
47
|
-
position: absolute;
|
|
48
|
-
right: 25px;
|
|
49
|
-
line-height: 28px;
|
|
50
|
-
display: inline-block;
|
|
51
|
-
}
|
|
52
|
-
.vtx-ui-searchmap-searchmodal .vtx-ui-searchmap-searchmap .vtx-ui-searchmap-bottom {
|
|
53
|
-
bottom: 0px;
|
|
54
|
-
border-top: 1px solid #e1e1e1;
|
|
55
|
-
text-align: right;
|
|
56
|
-
}
|
|
57
|
-
.vtx-ui-searchmap-searchmodal .vtx-ui-searchmap-searchmap .vtx-ui-searchmap-content {
|
|
58
|
-
width: 100%;
|
|
59
|
-
height: 100%;
|
|
60
|
-
position: relative;
|
|
61
|
-
padding-left: 25px;
|
|
62
|
-
}
|
|
63
|
-
.vtx-ui-searchmap-searchmodal .vtx-ui-searchmap-searchmap .vtx-ui-searchmap-content .vtx-ui-searchmap-show {
|
|
64
|
-
display: inline-block;
|
|
65
|
-
width: 100%;
|
|
66
|
-
height: 100%;
|
|
67
|
-
}
|
|
68
|
-
.vtx-ui-searchmap-searchmodal .vtx-ui-searchmap-searchmap .vtx-ui-searchmap-content .vtx-ui-searchmap-hidden {
|
|
69
|
-
display: none;
|
|
70
|
-
}
|
|
71
|
-
.vtx-ui-searchmap-searchmodal .vtx-ui-searchmap-searchmap .vtx-ui-searchmap-content .vtx-ui-searchmap-w_l {
|
|
72
|
-
width: 300px !important;
|
|
73
|
-
}
|
|
74
|
-
.vtx-ui-searchmap-searchmodal .vtx-ui-searchmap-searchmap .vtx-ui-searchmap-content .vtx-ui-searchmap-content_left {
|
|
75
|
-
width: 25px;
|
|
76
|
-
height: 100%;
|
|
77
|
-
display: inline-block;
|
|
78
|
-
-webkit-transition-duration: 0.3s;
|
|
79
|
-
-o-transition-duration: 0.3s;
|
|
80
|
-
transition-duration: 0.3s;
|
|
81
|
-
transition-property: width;
|
|
82
|
-
vertical-align: top;
|
|
83
|
-
border-right: 1px solid #e1e1e1;
|
|
84
|
-
position: absolute;
|
|
85
|
-
top: 0px;
|
|
86
|
-
left: 0px;
|
|
87
|
-
z-index: 10;
|
|
88
|
-
background-color: #FFF;
|
|
89
|
-
}
|
|
90
|
-
.vtx-ui-searchmap-searchmodal .vtx-ui-searchmap-searchmap .vtx-ui-searchmap-content .vtx-ui-searchmap-content_left .vtx-ui-searchmap-listtitle {
|
|
91
|
-
width: 100%;
|
|
92
|
-
height: 30px;
|
|
93
|
-
line-height: 30px;
|
|
94
|
-
border-bottom: 1px solid #e1e1e1;
|
|
95
|
-
}
|
|
96
|
-
.vtx-ui-searchmap-searchmodal .vtx-ui-searchmap-searchmap .vtx-ui-searchmap-content .vtx-ui-searchmap-content_left .vtx-ui-searchmap-listtitle .vtx-ui-searchmap-title {
|
|
97
|
-
width: calc(100% - 30px);
|
|
98
|
-
display: inline-block;
|
|
99
|
-
padding-left: 15px;
|
|
100
|
-
font-size: 15px;
|
|
101
|
-
}
|
|
102
|
-
.vtx-ui-searchmap-searchmodal .vtx-ui-searchmap-searchmap .vtx-ui-searchmap-content .vtx-ui-searchmap-content_left .vtx-ui-searchmap-listtitle .vtx-ui-searchmap-btn {
|
|
103
|
-
display: inline-block;
|
|
104
|
-
width: 30px;
|
|
105
|
-
text-align: center;
|
|
106
|
-
color: #0c88e8;
|
|
107
|
-
height: 30px;
|
|
108
|
-
line-height: 30px;
|
|
109
|
-
cursor: pointer;
|
|
110
|
-
}
|
|
111
|
-
.vtx-ui-searchmap-searchmodal .vtx-ui-searchmap-searchmap .vtx-ui-searchmap-content .vtx-ui-searchmap-content_left .vtx-ui-searchmap-lists {
|
|
112
|
-
width: 100%;
|
|
113
|
-
line-height: 35px;
|
|
114
|
-
border-bottom: 1px solid #e1e1e1;
|
|
115
|
-
font-size: 12px;
|
|
116
|
-
overflow: hidden;
|
|
117
|
-
text-overflow: ellipsis;
|
|
118
|
-
white-space: nowrap;
|
|
119
|
-
padding: 0px 15px;
|
|
120
|
-
cursor: pointer;
|
|
121
|
-
color: #999;
|
|
122
|
-
}
|
|
123
|
-
.vtx-ui-searchmap-searchmodal .vtx-ui-searchmap-searchmap .vtx-ui-searchmap-content .vtx-ui-searchmap-content_left .vtx-ui-searchmap-lists:hover {
|
|
124
|
-
background-color: #ECF6FD;
|
|
125
|
-
color: #108EE9;
|
|
126
|
-
}
|
|
127
|
-
.vtx-ui-searchmap-searchmodal .vtx-ui-searchmap-searchmap .vtx-ui-searchmap-content .vtx-ui-searchmap-content_left .vtx-ui-searchmap-lists.vtx-ui-searchmap-select {
|
|
128
|
-
background-color: #ECF6FD;
|
|
129
|
-
color: #108EE9;
|
|
130
|
-
}
|
|
131
|
-
.vtx-ui-searchmap-searchmodal .vtx-ui-searchmap-searchmap .vtx-ui-searchmap-content .vtx-ui-searchmap-content_left .vtx-ui-searchmap-scrollauto {
|
|
132
|
-
height: calc(100% - 30px);
|
|
133
|
-
overflow-y: auto;
|
|
134
|
-
}
|
|
135
|
-
.vtx-ui-searchmap-searchmodal .vtx-ui-searchmap-searchmap .vtx-ui-searchmap-content .vtx-ui-searchmap-content_right {
|
|
136
|
-
width: 100%;
|
|
137
|
-
height: 100%;
|
|
138
|
-
display: inline-block;
|
|
139
|
-
-webkit-transition-duration: 0.3s;
|
|
140
|
-
-o-transition-duration: 0.3s;
|
|
141
|
-
transition-duration: 0.3s;
|
|
142
|
-
transition-property: width;
|
|
143
|
-
}
|
|
144
|
-
.vtx-ui-searchmap-searchmodal .vtx-ui-searchmap-searchmap .vtx-ui-searchmap-content .vtx-ui-searchmap-btn {
|
|
145
|
-
text-align: center;
|
|
146
|
-
color: #0c88e8;
|
|
147
|
-
height: 30px;
|
|
148
|
-
line-height: 30px;
|
|
149
|
-
cursor: pointer;
|
|
150
|
-
}
|
|
151
|
-
.vtx-ui-searchmap-showlabel {
|
|
152
|
-
margin-left: 0;
|
|
153
|
-
width: 100px;
|
|
154
|
-
line-height: 25px;
|
|
155
|
-
text-align: center;
|
|
156
|
-
position: relative;
|
|
157
|
-
left: -38px;
|
|
158
|
-
background-color: #222020;
|
|
159
|
-
opacity: 0.6;
|
|
160
|
-
border-radius: 5px;
|
|
161
|
-
color: #FFF;
|
|
162
|
-
padding: 2px 8px;
|
|
163
|
-
text-overflow: ellipsis;
|
|
164
|
-
white-space: nowrap;
|
|
165
|
-
word-break: normal;
|
|
166
|
-
overflow: hidden;
|
|
167
|
-
}
|
|
168
|
-
.vtx-ui-searchmap-hiddenlabel {
|
|
169
|
-
display: none;
|
|
170
|
-
}
|
|
@@ -12,31 +12,31 @@ var _react = require('react');
|
|
|
12
12
|
|
|
13
13
|
var _react2 = _interopRequireDefault(_react);
|
|
14
14
|
|
|
15
|
-
require('./VtxSearchMap.
|
|
15
|
+
require('./VtxSearchMap.less');
|
|
16
16
|
|
|
17
17
|
var _button = require('antd/lib/button');
|
|
18
18
|
|
|
19
19
|
var _button2 = _interopRequireDefault(_button);
|
|
20
20
|
|
|
21
|
-
require('antd/lib/button/style
|
|
21
|
+
require('antd/lib/button/style');
|
|
22
22
|
|
|
23
23
|
var _input = require('antd/lib/input');
|
|
24
24
|
|
|
25
25
|
var _input2 = _interopRequireDefault(_input);
|
|
26
26
|
|
|
27
|
-
require('antd/lib/input/style
|
|
27
|
+
require('antd/lib/input/style');
|
|
28
28
|
|
|
29
29
|
var _message = require('antd/lib/message');
|
|
30
30
|
|
|
31
31
|
var _message2 = _interopRequireDefault(_message);
|
|
32
32
|
|
|
33
|
-
require('antd/lib/message/style
|
|
33
|
+
require('antd/lib/message/style');
|
|
34
34
|
|
|
35
35
|
var _checkbox = require('antd/lib/checkbox');
|
|
36
36
|
|
|
37
37
|
var _checkbox2 = _interopRequireDefault(_checkbox);
|
|
38
38
|
|
|
39
|
-
require('antd/lib/checkbox/style
|
|
39
|
+
require('antd/lib/checkbox/style');
|
|
40
40
|
|
|
41
41
|
var _VtxModal = require('../VtxModal');
|
|
42
42
|
|
|
@@ -766,10 +766,9 @@ var VtxSearchMap = function (_React$Component) {
|
|
|
766
766
|
clickGraphic: this.clickGraphic.bind(this),
|
|
767
767
|
clickMap: function clickMap() {
|
|
768
768
|
t.isClickMap = true;
|
|
769
|
-
}
|
|
770
|
-
}, drawProps, {
|
|
769
|
+
},
|
|
771
770
|
olProps: olProps
|
|
772
|
-
}))
|
|
771
|
+
}, drawProps))
|
|
773
772
|
)
|
|
774
773
|
)
|
|
775
774
|
)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@import (reference) '~antd/lib/style/themes/index.less';
|
|
2
|
+
|
|
1
3
|
.vtx-ui-searchmap-searchmodal{
|
|
2
4
|
z-index: 1001;
|
|
3
5
|
.ant-modal{
|
|
@@ -5,7 +7,7 @@
|
|
|
5
7
|
min-width: 800px;
|
|
6
8
|
height: 70vh;
|
|
7
9
|
.ant-modal-title{
|
|
8
|
-
color:
|
|
10
|
+
color: @primary-color;
|
|
9
11
|
}
|
|
10
12
|
.ant-modal-content{
|
|
11
13
|
width: 100%;
|
|
@@ -14,7 +16,7 @@
|
|
|
14
16
|
width: 100%;
|
|
15
17
|
height: e('calc(100% - 108px)') !important;
|
|
16
18
|
padding: 0px;
|
|
17
|
-
background-color:
|
|
19
|
+
background-color: @body-background;
|
|
18
20
|
}
|
|
19
21
|
}
|
|
20
22
|
}
|
|
@@ -38,7 +40,7 @@
|
|
|
38
40
|
}
|
|
39
41
|
.vtx-ui-searchmap-top{
|
|
40
42
|
top: 0px;
|
|
41
|
-
border-bottom: 1px solid
|
|
43
|
+
border-bottom: 1px solid @border-color-base;
|
|
42
44
|
.vtx-ui-searchmap-othermodal{
|
|
43
45
|
position: absolute;
|
|
44
46
|
right: 25px;
|
|
@@ -48,7 +50,7 @@
|
|
|
48
50
|
}
|
|
49
51
|
.vtx-ui-searchmap-bottom{
|
|
50
52
|
bottom: 0px;
|
|
51
|
-
border-top: 1px solid
|
|
53
|
+
border-top: 1px solid @border-color-base;
|
|
52
54
|
text-align: right;
|
|
53
55
|
}
|
|
54
56
|
.vtx-ui-searchmap-content{
|
|
@@ -76,17 +78,17 @@
|
|
|
76
78
|
transition-duration: 0.3s;
|
|
77
79
|
transition-property: width;
|
|
78
80
|
vertical-align: top;
|
|
79
|
-
border-right: 1px solid
|
|
81
|
+
border-right: 1px solid @border-color-base;
|
|
80
82
|
position: absolute;
|
|
81
83
|
top: 0px;
|
|
82
84
|
left: 0px;
|
|
83
85
|
z-index: 10;
|
|
84
|
-
background-color:
|
|
86
|
+
background-color: @body-background;
|
|
85
87
|
.vtx-ui-searchmap-listtitle{
|
|
86
88
|
width: 100%;
|
|
87
89
|
height: 30px;
|
|
88
90
|
line-height: 30px;
|
|
89
|
-
border-bottom: 1px solid
|
|
91
|
+
border-bottom: 1px solid @border-color-base;;
|
|
90
92
|
.vtx-ui-searchmap-title{
|
|
91
93
|
width: e('calc(100% - 30px)');
|
|
92
94
|
display: inline-block;
|
|
@@ -97,7 +99,7 @@
|
|
|
97
99
|
display: inline-block;
|
|
98
100
|
width: 30px;
|
|
99
101
|
text-align: center;
|
|
100
|
-
color:
|
|
102
|
+
color: @primary-color;
|
|
101
103
|
height: 30px;
|
|
102
104
|
line-height: 30px;
|
|
103
105
|
cursor: pointer;
|
|
@@ -106,7 +108,7 @@
|
|
|
106
108
|
.vtx-ui-searchmap-lists{
|
|
107
109
|
width: 100%;
|
|
108
110
|
line-height: 35px;
|
|
109
|
-
border-bottom: 1px solid
|
|
111
|
+
border-bottom: 1px solid @border-color-base;;
|
|
110
112
|
font-size: 12px;
|
|
111
113
|
overflow: hidden;
|
|
112
114
|
text-overflow: ellipsis;
|
|
@@ -116,12 +118,12 @@
|
|
|
116
118
|
color: #999;
|
|
117
119
|
&:hover{
|
|
118
120
|
background-color: #ECF6FD;
|
|
119
|
-
color:
|
|
121
|
+
color: @primary-color;
|
|
120
122
|
}
|
|
121
123
|
}
|
|
122
124
|
.vtx-ui-searchmap-lists.vtx-ui-searchmap-select{
|
|
123
125
|
background-color: #ECF6FD;
|
|
124
|
-
color:
|
|
126
|
+
color: @primary-color;
|
|
125
127
|
}
|
|
126
128
|
.vtx-ui-searchmap-scrollauto{
|
|
127
129
|
height: e('calc(100% - 30px)');
|
|
@@ -139,7 +141,7 @@
|
|
|
139
141
|
}
|
|
140
142
|
.vtx-ui-searchmap-btn{
|
|
141
143
|
text-align: center;
|
|
142
|
-
color:
|
|
144
|
+
color: @primary-color;
|
|
143
145
|
height: 30px;
|
|
144
146
|
line-height: 30px;
|
|
145
147
|
cursor: pointer;
|
package/lib/default.js
CHANGED
|
@@ -19,7 +19,7 @@ if (antdMajorVersion === '3') {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
var VtxMapIcon = exports.VtxMapIcon = createFromIconfontCN({
|
|
22
|
-
scriptUrl: '//at.alicdn.com/t/
|
|
22
|
+
scriptUrl: '//at.alicdn.com/t/font_2865072_vy1sa1whz3l.js'
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
var globalCfg = window.VtxPublicServiceAddress || {};
|