@vtx/map 1.1.5 → 1.1.8
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 +511 -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 +5 -5
- 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
|
@@ -75,6 +75,7 @@ var OlMap = function (_React$Component) {
|
|
|
75
75
|
sketch: null,
|
|
76
76
|
listener: null
|
|
77
77
|
};
|
|
78
|
+
_this.pointLayers = [];
|
|
78
79
|
_this.mouseNowPosition = { x: 0, y: 0, px: 0, py: 0, isCount: false };
|
|
79
80
|
_this.heatmap = null; //热力图对象
|
|
80
81
|
_this.clusterMarkers = []; //聚合点位id数组
|
|
@@ -96,13 +97,26 @@ var OlMap = function (_React$Component) {
|
|
|
96
97
|
sketch: null,
|
|
97
98
|
helpTooltipElement: null,
|
|
98
99
|
helpTooltip: null,
|
|
99
|
-
deleteContent: null,
|
|
100
100
|
measureTooltipElement: null,
|
|
101
101
|
measureTooltip: null,
|
|
102
|
+
deleteToolTipElement: null,
|
|
102
103
|
deleteToolTip: null,
|
|
103
104
|
continuePolygonMsg: '点击继续绘制图形',
|
|
104
105
|
continueLineMsg: '点击继续绘制线',
|
|
105
|
-
listener: null
|
|
106
|
+
listener: null,
|
|
107
|
+
drawElements: [],
|
|
108
|
+
drawLayer: null,
|
|
109
|
+
feature: null,
|
|
110
|
+
draw: null
|
|
111
|
+
};
|
|
112
|
+
_this.clusterInfo = {
|
|
113
|
+
clickFeature: null,
|
|
114
|
+
clickResolution: null,
|
|
115
|
+
hoverFeature: null,
|
|
116
|
+
clusterSource: null,
|
|
117
|
+
clusterHulls: null,
|
|
118
|
+
clusters: null,
|
|
119
|
+
clusterCircles: null
|
|
106
120
|
};
|
|
107
121
|
_this.state = {
|
|
108
122
|
gis: null, //地图对象
|
|
@@ -142,7 +156,12 @@ var OlMap = function (_React$Component) {
|
|
|
142
156
|
resolve();
|
|
143
157
|
});
|
|
144
158
|
});
|
|
145
|
-
Promise
|
|
159
|
+
var Client9 = new Promise(function (resolve, reject) {
|
|
160
|
+
$.getScript(_default2.default.openlayerServerURL + '/iclient-openlayers.min.js', function () {
|
|
161
|
+
resolve();
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
Promise.all([PointCollection, Client9]).then(function () {
|
|
146
165
|
resolve(window.OlMap);
|
|
147
166
|
});
|
|
148
167
|
});
|
|
@@ -318,10 +337,10 @@ var OlMap = function (_React$Component) {
|
|
|
318
337
|
var projection = olProps.projection,
|
|
319
338
|
olCoverage = olProps.olCoverage;
|
|
320
339
|
|
|
321
|
-
if (window.
|
|
322
|
-
window.
|
|
340
|
+
if (window.VtxMap) {
|
|
341
|
+
window.VtxMap[mapId] = null;
|
|
323
342
|
} else {
|
|
324
|
-
window.
|
|
343
|
+
window.VtxMap = {};
|
|
325
344
|
}
|
|
326
345
|
if (!minZoom) {
|
|
327
346
|
minZoom = 2;
|
|
@@ -332,7 +351,7 @@ var OlMap = function (_React$Component) {
|
|
|
332
351
|
if (!projection) {
|
|
333
352
|
projection = 'EPSG:4326';
|
|
334
353
|
}
|
|
335
|
-
window.
|
|
354
|
+
window.VtxMap[mapId] = t.state.gis = new ol.Map({
|
|
336
355
|
target: mapId.toString(),
|
|
337
356
|
view: new ol.View({
|
|
338
357
|
center: mapCenter && mapCenter instanceof Array && mapCenter.length == 2 ? mapCenter : [116.400433, 39.906705], //中心点
|
|
@@ -357,14 +376,22 @@ var OlMap = function (_React$Component) {
|
|
|
357
376
|
});
|
|
358
377
|
if ((olCoverage || []).length > 0) {
|
|
359
378
|
(olCoverage || []).map(function (item) {
|
|
360
|
-
if (
|
|
361
|
-
|
|
379
|
+
if (item.coverage.startsWith("http") || item.coverage.startsWith('/')) {
|
|
380
|
+
// 超图图层
|
|
381
|
+
var _layer = new ol.layer.Tile({
|
|
382
|
+
source: new ol.source.TileSuperMapRest({
|
|
383
|
+
url: item.coverage
|
|
384
|
+
})
|
|
385
|
+
});
|
|
362
386
|
t.state.gis.addLayer(_layer);
|
|
387
|
+
} else if (OL_SCREEN[item.coverage]) {
|
|
388
|
+
var _layer2 = eval(OL_SCREEN[item.coverage].initLayer);
|
|
389
|
+
t.state.gis.addLayer(_layer2);
|
|
363
390
|
}
|
|
364
391
|
});
|
|
365
392
|
} else {
|
|
366
|
-
var
|
|
367
|
-
t.state.gis.addLayer(
|
|
393
|
+
var _layer3 = eval(OL_SCREEN.default.initLayer);
|
|
394
|
+
t.state.gis.addLayer(_layer3);
|
|
368
395
|
}
|
|
369
396
|
}
|
|
370
397
|
// 设置中心点
|
|
@@ -633,7 +660,7 @@ var OlMap = function (_React$Component) {
|
|
|
633
660
|
if ('editGraphicChange' in t.props && typeof t.props.editGraphicChange == 'function') {
|
|
634
661
|
t.props.editGraphicChange(param);
|
|
635
662
|
}
|
|
636
|
-
t.GM.setGraphic(id, feature).setGraphicParam(id, _extends({}, param));
|
|
663
|
+
t.GM.setGraphic(id, feature).setGraphicParam(id, _extends({}, param, { source: gp.source }));
|
|
637
664
|
});
|
|
638
665
|
}
|
|
639
666
|
t.editId = id;
|
|
@@ -928,28 +955,94 @@ var OlMap = function (_React$Component) {
|
|
|
928
955
|
};
|
|
929
956
|
}
|
|
930
957
|
}
|
|
931
|
-
|
|
958
|
+
/*工具方法*/
|
|
932
959
|
|
|
933
960
|
}, {
|
|
934
|
-
key: '
|
|
935
|
-
value: function
|
|
961
|
+
key: 'vtxRangingTool',
|
|
962
|
+
value: function vtxRangingTool() {
|
|
936
963
|
var t = this;
|
|
937
|
-
var
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
964
|
+
var source = new ol.source.Vector({});
|
|
965
|
+
t.rangingInfo.drawLayer = new ol.layer.Vector({
|
|
966
|
+
source: source,
|
|
967
|
+
style: new ol.style.Style({
|
|
968
|
+
fill: new ol.style.Fill({
|
|
969
|
+
color: 'rgba(255, 255, 255, 0.2)'
|
|
970
|
+
}),
|
|
971
|
+
stroke: new ol.style.Stroke({
|
|
972
|
+
color: '#ffcc33',
|
|
973
|
+
width: 4
|
|
974
|
+
}),
|
|
975
|
+
image: new ol.style.Circle({
|
|
976
|
+
radius: 7,
|
|
977
|
+
fill: new ol.style.Fill({
|
|
978
|
+
color: '#ffcc33'
|
|
979
|
+
})
|
|
980
|
+
})
|
|
981
|
+
})
|
|
982
|
+
});
|
|
983
|
+
t.rangingInfo.draw = new ol.interaction.Draw({
|
|
984
|
+
source: source,
|
|
985
|
+
type: 'LineString',
|
|
986
|
+
style: new ol.style.Style({
|
|
987
|
+
fill: new ol.style.Fill({
|
|
988
|
+
color: 'rgba(255, 255, 255, 0.2)'
|
|
989
|
+
}),
|
|
990
|
+
stroke: new ol.style.Stroke({
|
|
991
|
+
color: 'rgba(0, 0, 0, 0.5)',
|
|
992
|
+
lineDash: [10, 10],
|
|
993
|
+
width: 4
|
|
994
|
+
}),
|
|
995
|
+
image: new ol.style.Circle({
|
|
996
|
+
radius: 5,
|
|
997
|
+
stroke: new ol.style.Stroke({
|
|
998
|
+
color: 'rgba(0, 0, 0, 0.7)'
|
|
999
|
+
}),
|
|
1000
|
+
fill: new ol.style.Fill({
|
|
1001
|
+
color: 'rgba(255, 255, 255, 0.2)'
|
|
1002
|
+
})
|
|
1003
|
+
})
|
|
1004
|
+
})
|
|
1005
|
+
});
|
|
1006
|
+
var obj = {};
|
|
1007
|
+
t.createHelpTooltip();
|
|
1008
|
+
t.createMeasureTooltip();
|
|
1009
|
+
t.createDeleteTooltip();
|
|
1010
|
+
t.state.gis.addLayer(t.rangingInfo.drawLayer);
|
|
1011
|
+
t.state.gis.addInteraction(t.rangingInfo.draw);
|
|
1012
|
+
// 开始监听绘制
|
|
1013
|
+
t.rangingInfo.draw.on('drawstart', function (evt) {
|
|
1014
|
+
t.rangingInfo.feature = evt.feature;
|
|
1015
|
+
var tooltipCoord = evt.coordinate;
|
|
1016
|
+
t.rangingInfo.listener = evt.feature.getGeometry().on('change', function (evt) {
|
|
1017
|
+
var geom = evt.target;
|
|
1018
|
+
var flatCoordinates = geom.flatCoordinates;
|
|
1019
|
+
|
|
1020
|
+
var lngLats = [[flatCoordinates[0], flatCoordinates[1]], [flatCoordinates[2], flatCoordinates[3]]];
|
|
1021
|
+
var output = t.formatLength(geom);
|
|
1022
|
+
tooltipCoord = geom.getLastCoordinate();
|
|
1023
|
+
obj = {
|
|
1024
|
+
distance: output,
|
|
1025
|
+
lnglats: lngLats
|
|
1026
|
+
};
|
|
1027
|
+
t.rangingInfo.measureTooltipElement.innerHTML = output;
|
|
1028
|
+
t.rangingInfo.measureTooltip.setPosition(tooltipCoord);
|
|
1029
|
+
t.rangingInfo.deleteToolTip.setPosition(tooltipCoord);
|
|
1030
|
+
t.rangingInfo.deleteToolTip.setOffset([20, 10]);
|
|
1031
|
+
});
|
|
1032
|
+
});
|
|
1033
|
+
// 双击绘制完成
|
|
1034
|
+
t.rangingInfo.draw.on('drawend', function () {
|
|
1035
|
+
t.rangingInfo.measureTooltipElement.className = 'ol-tooltip ol-tooltip-static';
|
|
1036
|
+
t.rangingInfo.measureTooltip.setOffset([0, -7]);
|
|
1037
|
+
t.rangingInfo.feature = null;
|
|
1038
|
+
t.rangingInfo.measureTooltipElement = null;
|
|
1039
|
+
// t.createMeasureTooltip();
|
|
1040
|
+
new ol.Observable.unByKey(t.rangingInfo.listener);
|
|
1041
|
+
t.state.gis.removeInteraction(t.rangingInfo.draw);
|
|
1042
|
+
if ('mapRangingTool' in t.props) {
|
|
1043
|
+
t.props.mapRangingTool(obj);
|
|
1044
|
+
}
|
|
951
1045
|
});
|
|
952
|
-
gis.addOverlay(drawInfo.measureTooltip);
|
|
953
1046
|
}
|
|
954
1047
|
// 绘图时创建提示
|
|
955
1048
|
|
|
@@ -957,42 +1050,98 @@ var OlMap = function (_React$Component) {
|
|
|
957
1050
|
key: 'createHelpTooltip',
|
|
958
1051
|
value: function createHelpTooltip() {
|
|
959
1052
|
var t = this;
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
if (drawInfo.helpTooltipElement) {
|
|
964
|
-
drawInfo.helpTooltipElement.parentNode.removeChild(helpTooltipElement);
|
|
1053
|
+
if (t.rangingTool.helpTooltipElement) {
|
|
1054
|
+
t.rangingTool.helpTooltipElement.parentNode.removeChild(t.rangingTool.helpTooltipElement);
|
|
965
1055
|
}
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
element:
|
|
1056
|
+
t.rangingTool.helpTooltipElement = document.createElement('div');
|
|
1057
|
+
t.rangingTool.helpTooltipElement.className = 'ol-tooltip hidden';
|
|
1058
|
+
t.rangingTool.helpTooltip = new ol.Overlay({
|
|
1059
|
+
element: t.rangingTool.helpTooltipElement,
|
|
970
1060
|
offset: [15, 0],
|
|
971
1061
|
positioning: 'center-left'
|
|
972
1062
|
});
|
|
973
|
-
gis.addOverlay(
|
|
1063
|
+
t.state.gis.addOverlay(t.rangingTool.helpTooltip);
|
|
974
1064
|
}
|
|
975
|
-
|
|
1065
|
+
// 工具画图提示
|
|
976
1066
|
|
|
977
1067
|
}, {
|
|
978
|
-
key: '
|
|
979
|
-
value: function
|
|
1068
|
+
key: 'createMeasureTooltip',
|
|
1069
|
+
value: function createMeasureTooltip() {
|
|
980
1070
|
var t = this;
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
//开启测距状态
|
|
984
|
-
if (!t.rangingTool.isRanging) {
|
|
985
|
-
t.rangingTool.isRanging = true;
|
|
986
|
-
}
|
|
987
|
-
//初始测距回调
|
|
988
|
-
if (!t.rangingTool.mapRangingTool) {
|
|
989
|
-
t.rangingTool.mapRangingTool = mapRangingTool;
|
|
1071
|
+
if (t.rangingInfo.measureTooltipElement) {
|
|
1072
|
+
t.rangingInfo.measureTooltipElement.parentNode.removeChild(t.rangingInfo.measureTooltipElement);
|
|
990
1073
|
}
|
|
1074
|
+
t.rangingInfo.measureTooltipElement = document.createElement('div');
|
|
1075
|
+
t.rangingInfo.measureTooltipElement.className = 'ol-tooltip ol-tooltip-measure';
|
|
1076
|
+
t.rangingInfo.measureTooltip = new ol.Overlay({
|
|
1077
|
+
element: t.rangingInfo.measureTooltipElement,
|
|
1078
|
+
offset: [0, -15],
|
|
1079
|
+
positioning: 'bottom-center',
|
|
1080
|
+
stopEvent: false,
|
|
1081
|
+
insertFirst: false
|
|
1082
|
+
});
|
|
1083
|
+
t.state.gis.addOverlay(t.rangingInfo.measureTooltip);
|
|
991
1084
|
}
|
|
992
|
-
//
|
|
1085
|
+
// 创建删除提示
|
|
993
1086
|
|
|
1087
|
+
}, {
|
|
1088
|
+
key: 'createDeleteTooltip',
|
|
1089
|
+
value: function createDeleteTooltip() {
|
|
1090
|
+
var t = this;
|
|
1091
|
+
if (t.rangingInfo.deleteToolTipElement) {
|
|
1092
|
+
t.rangingInfo.deleteToolTipElement.parentNode.removeChild(t.rangingInfo.deleteToolTipElement);
|
|
1093
|
+
}
|
|
1094
|
+
t.rangingInfo.deleteToolTipElement = document.createElement('div');
|
|
1095
|
+
t.rangingInfo.deleteToolTipElement.className = 'ol-tooltip-delete';
|
|
1096
|
+
t.rangingInfo.deleteToolTipElement.innerHTML = 'X';
|
|
1097
|
+
t.rangingInfo.deleteToolTipElement.addEventListener('click', function (e) {
|
|
1098
|
+
t.rangingInfo.measureTooltipElement = null;
|
|
1099
|
+
t.rangingInfo.helpTooltipElement = null;
|
|
1100
|
+
t.rangingInfo.deleteToolTipElement = null;
|
|
1101
|
+
t.state.gis.removeOverlay(t.rangingInfo.measureTooltip);
|
|
1102
|
+
t.state.gis.removeOverlay(t.rangingTool.helpTooltip);
|
|
1103
|
+
t.state.gis.removeOverlay(t.rangingInfo.deleteToolTip);
|
|
1104
|
+
new ol.Observable.unByKey(t.rangingInfo.listener);
|
|
1105
|
+
t.state.gis.removeInteraction(t.rangingInfo.draw);
|
|
1106
|
+
t.state.gis.removeLayer(t.rangingInfo.drawLayer);
|
|
1107
|
+
});
|
|
1108
|
+
t.rangingInfo.deleteToolTip = new ol.Overlay({
|
|
1109
|
+
element: t.rangingInfo.deleteToolTipElement,
|
|
1110
|
+
offset: [15, 15],
|
|
1111
|
+
positioning: 'bottom-center',
|
|
1112
|
+
stopEvent: false,
|
|
1113
|
+
insertFirst: true
|
|
1114
|
+
});
|
|
1115
|
+
t.state.gis.addOverlay(t.rangingInfo.deleteToolTip);
|
|
1116
|
+
}
|
|
1117
|
+
}, {
|
|
1118
|
+
key: 'formatLength',
|
|
1119
|
+
value: function formatLength(line) {
|
|
1120
|
+
var flatCoordinates = line.flatCoordinates;
|
|
1121
|
+
// const length = new ol.sphere.getDistance([flatCoordinates[0], flatCoordinates[1]],[flatCoordinates[2], flatCoordinates[3]]);
|
|
1122
|
+
|
|
1123
|
+
var paths = [];
|
|
1124
|
+
for (var n = 0; n < flatCoordinates.length; n += 2) {
|
|
1125
|
+
paths.push([flatCoordinates[n], flatCoordinates[n + 1]]);
|
|
1126
|
+
}
|
|
1127
|
+
var length = 0;
|
|
1128
|
+
if (paths.length >= 2) paths.map(function (item, index) {
|
|
1129
|
+
if (index <= paths.length - 2) {
|
|
1130
|
+
length += ol.sphere.getDistance(paths[index], paths[index + 1]);
|
|
1131
|
+
}
|
|
1132
|
+
});
|
|
1133
|
+
var output = '';
|
|
1134
|
+
if (length > 100) {
|
|
1135
|
+
output = Math.round(length / 1000 * 100) / 100 + ' ' + 'km';
|
|
1136
|
+
} else {
|
|
1137
|
+
output = Math.round(length * 100) / 100 + ' ' + 'm';
|
|
1138
|
+
}
|
|
1139
|
+
return output;
|
|
1140
|
+
}
|
|
994
1141
|
}, {
|
|
995
1142
|
key: 'getMapExtent',
|
|
1143
|
+
|
|
1144
|
+
// 获取地图的当前位置状态信息
|
|
996
1145
|
value: function getMapExtent() {
|
|
997
1146
|
var t = this;
|
|
998
1147
|
var gis = t.state.gis;
|
|
@@ -1060,28 +1209,31 @@ var OlMap = function (_React$Component) {
|
|
|
1060
1209
|
}
|
|
1061
1210
|
if (typeof arg === 'string') {
|
|
1062
1211
|
ary = arg.split(',');
|
|
1063
|
-
obj = t.getFitView(ary);
|
|
1064
1212
|
} else if (arg instanceof Array) {
|
|
1065
|
-
|
|
1066
|
-
obj = gis.getFitView(ary[0]);
|
|
1067
|
-
} else {
|
|
1068
|
-
obj = t.getFitView(arg);
|
|
1069
|
-
}
|
|
1213
|
+
ary = arg;
|
|
1070
1214
|
}
|
|
1071
|
-
|
|
1072
|
-
|
|
1215
|
+
for (var i = 0; i < ary.length; i++) {
|
|
1216
|
+
var g = t.GM.getGraphicParam(ary[i]);
|
|
1217
|
+
if (g) {
|
|
1218
|
+
switch (g.geometry.type) {
|
|
1219
|
+
case 'point':
|
|
1220
|
+
obj.push([g.geometry.x, g.geometry.y]);
|
|
1221
|
+
case 'circle':
|
|
1222
|
+
obj.push([g.geometry.x, g.geometry.y]);
|
|
1223
|
+
break;
|
|
1224
|
+
case 'polyline':
|
|
1225
|
+
obj = [].concat(_toConsumableArray(obj), _toConsumableArray(g.geometry.paths));
|
|
1226
|
+
break;
|
|
1227
|
+
case 'polygon':
|
|
1228
|
+
obj = [].concat(_toConsumableArray(obj), _toConsumableArray(g.geometry.rings));
|
|
1229
|
+
break;
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1073
1232
|
}
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
gis.getView().fit(
|
|
1233
|
+
if (obj.length > 0) {
|
|
1234
|
+
var displayRange = new ol.extent.boundingExtent(obj);
|
|
1235
|
+
gis.getView().fit(displayRange, gis.getSize());
|
|
1077
1236
|
}
|
|
1078
|
-
// if(!type || type == 'all'){
|
|
1079
|
-
|
|
1080
|
-
// }else if(type == 'zoom'){
|
|
1081
|
-
// gis.getView().setZoom(zoom)
|
|
1082
|
-
// }else if(type == 'center'){
|
|
1083
|
-
// gis.getView().setCenter(obj.lngLat);
|
|
1084
|
-
// }
|
|
1085
1237
|
}
|
|
1086
1238
|
}, {
|
|
1087
1239
|
key: 'getFitView',
|
|
@@ -1393,28 +1545,38 @@ var OlMap = function (_React$Component) {
|
|
|
1393
1545
|
});
|
|
1394
1546
|
t.state.gis.addOverlay(pop);
|
|
1395
1547
|
} else {
|
|
1548
|
+
var myImage = new Image(cg.width, cg.height);
|
|
1549
|
+
canvasDataURL(item.url || _default2.default.mapServerURL + '/images/defaultMarker.png', { width: cg.width, height: cg.height }, function (base64) {
|
|
1550
|
+
myImage.src = base64;
|
|
1551
|
+
});
|
|
1396
1552
|
// 创建地图要素图标样式
|
|
1397
1553
|
style = new ol.style.Style({
|
|
1398
1554
|
image: new ol.style.Icon({
|
|
1399
1555
|
anchor: [-cg.markerContentX, -cg.markerContentY],
|
|
1400
1556
|
anchorXUnits: 'pixels',
|
|
1401
1557
|
anchorYUnits: 'pixels',
|
|
1402
|
-
src: item.url ||
|
|
1403
|
-
|
|
1558
|
+
// src: item.url || `${configUrl.mapServerURL}/images/defaultMarker.png`,
|
|
1559
|
+
img: myImage,
|
|
1560
|
+
imgSize: [cg.width, cg.height],
|
|
1404
1561
|
opacity: cg.opacity,
|
|
1405
1562
|
scale: cg.scale || 1
|
|
1406
1563
|
})
|
|
1407
1564
|
});
|
|
1408
1565
|
}
|
|
1409
1566
|
if (!!item.canShowLabel && item.canShowLabel) {
|
|
1567
|
+
var _myImage = new Image(cg.width, cg.height);
|
|
1568
|
+
canvasDataURL(item.url || _default2.default.mapServerURL + '/images/defaultMarker.png', { width: cg.width, height: cg.height }, function (base64) {
|
|
1569
|
+
_myImage.src = base64;
|
|
1570
|
+
});
|
|
1410
1571
|
// 创建地图要素图标样式
|
|
1411
1572
|
style = new ol.style.Style({
|
|
1412
1573
|
image: new ol.style.Icon({
|
|
1413
1574
|
anchor: [-cg.markerContentX, -cg.markerContentY],
|
|
1414
1575
|
anchorXUnits: 'pixels',
|
|
1415
1576
|
anchorYUnits: 'pixels',
|
|
1416
|
-
src: item.url ||
|
|
1417
|
-
|
|
1577
|
+
// src: item.url || `${configUrl.mapServerURL}/images/defaultMarker.png`,
|
|
1578
|
+
img: _myImage,
|
|
1579
|
+
imgSize: [cg.width, cg.height],
|
|
1418
1580
|
opacity: cg.opacity,
|
|
1419
1581
|
scale: cg.scale || 1
|
|
1420
1582
|
}),
|
|
@@ -1450,6 +1612,10 @@ var OlMap = function (_React$Component) {
|
|
|
1450
1612
|
source: source,
|
|
1451
1613
|
id: item.id
|
|
1452
1614
|
});
|
|
1615
|
+
t.pointLayers.push({
|
|
1616
|
+
id: item.id,
|
|
1617
|
+
layer: pointLayer
|
|
1618
|
+
});
|
|
1453
1619
|
//添加点位图层
|
|
1454
1620
|
t.state.gis.addLayer(pointLayer);
|
|
1455
1621
|
if (!item.markerContent && cg.BAnimationType == 0) {
|
|
@@ -1471,7 +1637,10 @@ var OlMap = function (_React$Component) {
|
|
|
1471
1637
|
});
|
|
1472
1638
|
});
|
|
1473
1639
|
if (type !== 'defined') {
|
|
1474
|
-
t.state.pointIds = psids;
|
|
1640
|
+
// t.state.pointIds = psids;
|
|
1641
|
+
t.setState({
|
|
1642
|
+
pointIds: psids
|
|
1643
|
+
});
|
|
1475
1644
|
}
|
|
1476
1645
|
}
|
|
1477
1646
|
//更新点
|
|
@@ -1484,6 +1653,7 @@ var OlMap = function (_React$Component) {
|
|
|
1484
1653
|
var mapPoints = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
1485
1654
|
|
|
1486
1655
|
var t = this;
|
|
1656
|
+
console.log('updatePoint', mapPoints);
|
|
1487
1657
|
mapPoints.map(function (item, index) {
|
|
1488
1658
|
//判断图元是否存在.
|
|
1489
1659
|
if (_this3.GM.isRepetition(item.id)) {
|
|
@@ -1493,6 +1663,7 @@ var OlMap = function (_React$Component) {
|
|
|
1493
1663
|
return false;
|
|
1494
1664
|
}
|
|
1495
1665
|
var gc = t.GM.getGraphic(item.id);
|
|
1666
|
+
var gp = t.GM.getGraphicParam(item.id);
|
|
1496
1667
|
var cg = {
|
|
1497
1668
|
width: 30,
|
|
1498
1669
|
height: 30,
|
|
@@ -1569,7 +1740,7 @@ var OlMap = function (_React$Component) {
|
|
|
1569
1740
|
x: item.longitude,
|
|
1570
1741
|
y: item.latitude
|
|
1571
1742
|
},
|
|
1572
|
-
source:
|
|
1743
|
+
source: gp.source
|
|
1573
1744
|
});
|
|
1574
1745
|
} else {
|
|
1575
1746
|
console.warn('\u66F4\u65B0\u7684\u70B9\u4F4Did\u4E0D\u5B58\u5728!');
|
|
@@ -1820,6 +1991,7 @@ var OlMap = function (_React$Component) {
|
|
|
1820
1991
|
}
|
|
1821
1992
|
//获取原有的图元
|
|
1822
1993
|
var gc = _this7.GM.getGraphic(item.id);
|
|
1994
|
+
var gp = t.GM.getGraphicParam(item.id);
|
|
1823
1995
|
//获取原有的面属性,转换key值
|
|
1824
1996
|
var cg = {
|
|
1825
1997
|
lineType: 'solid',
|
|
@@ -1857,7 +2029,7 @@ var OlMap = function (_React$Component) {
|
|
|
1857
2029
|
type: 'polygon',
|
|
1858
2030
|
rings: pts
|
|
1859
2031
|
},
|
|
1860
|
-
source:
|
|
2032
|
+
source: gp.source
|
|
1861
2033
|
});
|
|
1862
2034
|
} else {
|
|
1863
2035
|
console.warn('\u66F4\u65B0\u7684\u591A\u8FB9\u5F62id\u4E0D\u5B58\u5728!');
|
|
@@ -1968,6 +2140,7 @@ var OlMap = function (_React$Component) {
|
|
|
1968
2140
|
}
|
|
1969
2141
|
//获取原有的图元
|
|
1970
2142
|
var gc = t.GM.getGraphic(item.id);
|
|
2143
|
+
var gp = t.GM.getGraphicParam(item.id);
|
|
1971
2144
|
//获取原有的面属性,转换key值
|
|
1972
2145
|
var cg = {
|
|
1973
2146
|
lineType: 'solid',
|
|
@@ -2003,7 +2176,7 @@ var OlMap = function (_React$Component) {
|
|
|
2003
2176
|
y: parseFloat(item.latitude),
|
|
2004
2177
|
radius: parseFloat(item.radius)
|
|
2005
2178
|
},
|
|
2006
|
-
source:
|
|
2179
|
+
source: gp.source
|
|
2007
2180
|
});
|
|
2008
2181
|
});
|
|
2009
2182
|
//刷新图元
|
|
@@ -2113,11 +2286,31 @@ var OlMap = function (_React$Component) {
|
|
|
2113
2286
|
return item.name == 'heatMap';
|
|
2114
2287
|
})[0];
|
|
2115
2288
|
hMap.getSource().clear();
|
|
2116
|
-
|
|
2289
|
+
gis.removeLayer(layer);
|
|
2117
2290
|
}
|
|
2118
2291
|
t.heatmap = null;
|
|
2119
2292
|
t.movePoints = [];
|
|
2293
|
+
|
|
2294
|
+
t.state.pointIds = [];
|
|
2295
|
+
t.pointLayers.map(function (item) {
|
|
2296
|
+
gis.removeLayer(item.layer);
|
|
2297
|
+
t.pointLayers = [];
|
|
2298
|
+
});
|
|
2299
|
+
|
|
2120
2300
|
t.clearAllPointCollection();
|
|
2301
|
+
t.closeDraw();
|
|
2302
|
+
if (t.clusterInfo.clusterHulls || t.clusterInfo.clusters || t.clusterInfo.clusterCircles) {
|
|
2303
|
+
t.clusterHulls.getSource().clear();
|
|
2304
|
+
t.clusterInfo.clusterSource = null;
|
|
2305
|
+
gis.removeLayer(t.clusterInfo.clusterHulls);
|
|
2306
|
+
gis.removeLayer(t.clusterInfo.clusters);
|
|
2307
|
+
gis.removeLayer(t.clusterInfo.clusterCircles);
|
|
2308
|
+
t.clusterInfo.clusterHulls = null;
|
|
2309
|
+
t.clusterInfo.clusters = null;
|
|
2310
|
+
t.clusterInfo.clusterCircles = null;
|
|
2311
|
+
}
|
|
2312
|
+
//清空缓存数据
|
|
2313
|
+
t.GM.clearAll();
|
|
2121
2314
|
//循环所有id删除
|
|
2122
2315
|
var _t$state = t.state,
|
|
2123
2316
|
pointIds = _t$state.pointIds,
|
|
@@ -2249,6 +2442,180 @@ var OlMap = function (_React$Component) {
|
|
|
2249
2442
|
if (y > ymax1) y = ymax1 - 0.1;
|
|
2250
2443
|
t.state.gis.getView().setCenter([x, y]);
|
|
2251
2444
|
}
|
|
2445
|
+
//聚合地图图元(arg为空时聚合全部点)
|
|
2446
|
+
|
|
2447
|
+
}, {
|
|
2448
|
+
key: 'cluster',
|
|
2449
|
+
value: function cluster(arg) {
|
|
2450
|
+
var t = this;
|
|
2451
|
+
var ary = [];
|
|
2452
|
+
if (!arg) {
|
|
2453
|
+
var pointIds = t.state.pointIds;
|
|
2454
|
+
|
|
2455
|
+
ary = pointIds;
|
|
2456
|
+
} else {
|
|
2457
|
+
if (Object.prototype.toString.apply(arg) === '[object Array]') {
|
|
2458
|
+
ary = arg;
|
|
2459
|
+
} else if (typeof arg === 'string') {
|
|
2460
|
+
ary = arg.split(',');
|
|
2461
|
+
}
|
|
2462
|
+
}
|
|
2463
|
+
t.state.pointIds = [];
|
|
2464
|
+
t.pointLayers.map(function (item) {
|
|
2465
|
+
t.state.gis.removeLayer(item.layer);
|
|
2466
|
+
t.pointLayers = [];
|
|
2467
|
+
});
|
|
2468
|
+
var ms = this.GM.getMoreGraphic(ary).filter(function (item, index) {
|
|
2469
|
+
// return !item && item != 0 ? false : true;
|
|
2470
|
+
return item && item.getGeometry().getType() === 'Point' && !item.label;
|
|
2471
|
+
});
|
|
2472
|
+
var source = new ol.source.Vector({
|
|
2473
|
+
features: ms
|
|
2474
|
+
});
|
|
2475
|
+
t.clusterInfo.clusterSource = new ol.source.Cluster({
|
|
2476
|
+
distance: 80,
|
|
2477
|
+
minDistance: 0,
|
|
2478
|
+
source: source
|
|
2479
|
+
});
|
|
2480
|
+
t.clusterInfo.clusterHulls = new ol.layer.Vector({
|
|
2481
|
+
source: t.clusterInfo.clusterSource,
|
|
2482
|
+
style: clusterHullStyle
|
|
2483
|
+
});
|
|
2484
|
+
t.state.gis.addLayer(t.clusterInfo.clusterHulls);
|
|
2485
|
+
t.clusterInfo.clusters = new ol.layer.Vector({
|
|
2486
|
+
source: t.clusterInfo.clusterSource,
|
|
2487
|
+
style: clusterStyle
|
|
2488
|
+
});
|
|
2489
|
+
t.state.gis.addLayer(t.clusterInfo.clusters);
|
|
2490
|
+
t.clusterInfo.clusterCircles = new ol.layer.Vector({
|
|
2491
|
+
source: t.clusterInfo.clusterSource,
|
|
2492
|
+
style: clusterCircleStyle
|
|
2493
|
+
});
|
|
2494
|
+
t.state.gis.addLayer(t.clusterInfo.clusterCircles);
|
|
2495
|
+
function clusterMemberStyle(clusterMember) {
|
|
2496
|
+
var style = clusterMember.getStyle();
|
|
2497
|
+
var image = style.getImage();
|
|
2498
|
+
return new ol.style.Style({
|
|
2499
|
+
geometry: clusterMember.getGeometry(),
|
|
2500
|
+
image: image
|
|
2501
|
+
});
|
|
2502
|
+
}
|
|
2503
|
+
function clusterCircleStyle(cluster, resolution) {
|
|
2504
|
+
if (cluster !== t.clusterInfo.clickFeature || resolution !== t.clusterInfo.clickResolution) {
|
|
2505
|
+
return;
|
|
2506
|
+
}
|
|
2507
|
+
var clusterMembers = cluster.get('features');
|
|
2508
|
+
var centerCoordinates = cluster.getGeometry().getCoordinates();
|
|
2509
|
+
return generatePointsCircle(clusterMembers.length, cluster.getGeometry().getCoordinates(), resolution).reduce(function (styles, coordinates, i) {
|
|
2510
|
+
var point = new ol.geom.Point(coordinates);
|
|
2511
|
+
var line = new ol.geom.LineString([centerCoordinates, coordinates]);
|
|
2512
|
+
styles.unshift(new ol.style.Style({
|
|
2513
|
+
geometry: line,
|
|
2514
|
+
stroke: new ol.style.Stroke({
|
|
2515
|
+
color: 'rgba(204, 85, 0, 1)',
|
|
2516
|
+
width: 1.5
|
|
2517
|
+
})
|
|
2518
|
+
}));
|
|
2519
|
+
styles.push(clusterMemberStyle(new ol.Feature(_extends({}, clusterMembers[i].getProperties(), {
|
|
2520
|
+
geometry: point
|
|
2521
|
+
}))));
|
|
2522
|
+
return styles;
|
|
2523
|
+
}, []);
|
|
2524
|
+
}
|
|
2525
|
+
function generatePointsCircle(count, clusterCenter, resolution) {
|
|
2526
|
+
var circumference = 1 * 28 * (2 + count);
|
|
2527
|
+
var legLength = circumference / (Math.PI * 2); //radius from circumference
|
|
2528
|
+
var angleStep = Math.PI * 2 / count;
|
|
2529
|
+
var res = [];
|
|
2530
|
+
var angle = void 0;
|
|
2531
|
+
legLength = Math.max(legLength, 35) * resolution; // Minimum distance to get outside the cluster icon.
|
|
2532
|
+
for (var i = 0; i < count; ++i) {
|
|
2533
|
+
// Clockwise, like spiral.
|
|
2534
|
+
angle = Math.PI / 2 + i * angleStep;
|
|
2535
|
+
res.push([clusterCenter[0] + legLength * Math.cos(angle), clusterCenter[1] + legLength * Math.sin(angle)]);
|
|
2536
|
+
}
|
|
2537
|
+
return res;
|
|
2538
|
+
}
|
|
2539
|
+
function clusterHullStyle(cluster) {
|
|
2540
|
+
if (cluster !== t.clusterInfo.hoverFeature) {
|
|
2541
|
+
return;
|
|
2542
|
+
}
|
|
2543
|
+
var originalFeatures = cluster.get('features');
|
|
2544
|
+
var points = originalFeatures.map(function (feature) {
|
|
2545
|
+
return feature.getGeometry().getCoordinates();
|
|
2546
|
+
});
|
|
2547
|
+
return new ol.style.Style({
|
|
2548
|
+
geometry: new ol.geom.Polygon(points),
|
|
2549
|
+
fill: new ol.style.Fill({
|
|
2550
|
+
color: 'rgba(255, 153, 0, 0.4)'
|
|
2551
|
+
}),
|
|
2552
|
+
stroke: new ol.style.Stroke({
|
|
2553
|
+
color: 'rgba(204, 85, 0, 1)',
|
|
2554
|
+
width: 1.5
|
|
2555
|
+
})
|
|
2556
|
+
});
|
|
2557
|
+
}
|
|
2558
|
+
function clusterStyle(feature) {
|
|
2559
|
+
var size = feature.get('features').length;
|
|
2560
|
+
if (size > 1) {
|
|
2561
|
+
return [new ol.style.Style({
|
|
2562
|
+
image: new ol.style.Circle({
|
|
2563
|
+
radius: 20,
|
|
2564
|
+
fill: new ol.style.Fill({
|
|
2565
|
+
color: 'rgba(255, 153, 102, 0.3)'
|
|
2566
|
+
})
|
|
2567
|
+
})
|
|
2568
|
+
}), new ol.style.Style({
|
|
2569
|
+
image: new ol.style.Circle({
|
|
2570
|
+
radius: 14,
|
|
2571
|
+
fill: new ol.style.Fill({
|
|
2572
|
+
color: 'rgba(255, 165, 0, 0.7)'
|
|
2573
|
+
})
|
|
2574
|
+
}),
|
|
2575
|
+
text: new ol.style.Text({
|
|
2576
|
+
text: size.toString(),
|
|
2577
|
+
fill: new ol.style.Fill({
|
|
2578
|
+
color: '#fff'
|
|
2579
|
+
}),
|
|
2580
|
+
stroke: new ol.style.Stroke({
|
|
2581
|
+
color: 'rgba(0, 0, 0, 0.6)',
|
|
2582
|
+
width: 3
|
|
2583
|
+
})
|
|
2584
|
+
})
|
|
2585
|
+
})];
|
|
2586
|
+
} else {
|
|
2587
|
+
var originalFeature = feature.get('features')[0];
|
|
2588
|
+
return clusterMemberStyle(originalFeature);
|
|
2589
|
+
}
|
|
2590
|
+
}
|
|
2591
|
+
}
|
|
2592
|
+
}, {
|
|
2593
|
+
key: 'clearCluster',
|
|
2594
|
+
value: function clearCluster() {
|
|
2595
|
+
var t = this;
|
|
2596
|
+
if (t.clusterInfo.clusterHulls) {
|
|
2597
|
+
t.state.gis.removeLayer(t.clusterInfo.clusterHulls);
|
|
2598
|
+
t.clusterInfo.clusterHulls = null;
|
|
2599
|
+
}
|
|
2600
|
+
if (t.clusterInfo.clusters) {
|
|
2601
|
+
t.state.gis.removeLayer(t.clusterInfo.clusters);
|
|
2602
|
+
t.clusterInfo.clusters = null;
|
|
2603
|
+
}
|
|
2604
|
+
if (t.clusterInfo.clusterCircles) {
|
|
2605
|
+
t.state.gis.removeLayer(t.clusterInfo.clusterCircles);
|
|
2606
|
+
t.clusterInfo.clusterCircles = null;
|
|
2607
|
+
}
|
|
2608
|
+
t.props.mapPoints.map(function (item) {
|
|
2609
|
+
if (t.GM.getGraphic(item.id)) {
|
|
2610
|
+
t.GM.removeGraphic(item.id);
|
|
2611
|
+
}
|
|
2612
|
+
});
|
|
2613
|
+
t.addPoint(t.props.mapPoints);
|
|
2614
|
+
// 临时处理下
|
|
2615
|
+
var view = t.state.gis.getView();
|
|
2616
|
+
var zoom = view.getZoom();
|
|
2617
|
+
view.setZoom(zoom - 0.5);
|
|
2618
|
+
}
|
|
2252
2619
|
/*公共方法*/
|
|
2253
2620
|
//判断extent1是否在extent2内部
|
|
2254
2621
|
|
|
@@ -2284,7 +2651,7 @@ var OlMap = function (_React$Component) {
|
|
|
2284
2651
|
}, {
|
|
2285
2652
|
key: 'calculatePointsDistance',
|
|
2286
2653
|
value: function calculatePointsDistance(fp, ep) {
|
|
2287
|
-
return Math.round(ol.sphere.getDistance(fp, ep));
|
|
2654
|
+
return Math.round(new ol.sphere.getDistance(fp, ep));
|
|
2288
2655
|
}
|
|
2289
2656
|
//计算多个点的距离(常用于线计算)
|
|
2290
2657
|
|
|
@@ -2946,8 +3313,10 @@ var OlMap = function (_React$Component) {
|
|
|
2946
3313
|
t.doEdit(editGraphicId);
|
|
2947
3314
|
}
|
|
2948
3315
|
// 获取热力图
|
|
2949
|
-
if (heatMapData && !t.deepEqual(heatMapData, t.props.heatMapData)) {
|
|
3316
|
+
if (heatMapData && heatMapData.data && !t.deepEqual(heatMapData, t.props.heatMapData)) {
|
|
2950
3317
|
t.heatMapOverlay(heatMapData);
|
|
3318
|
+
} else if (!t.deepEqual(heatMapData, t.props.heatMapData)) {
|
|
3319
|
+
t.clearHeatMap(heatMapData);
|
|
2951
3320
|
}
|
|
2952
3321
|
//清空地图
|
|
2953
3322
|
if (typeof isClearAll == 'boolean' && isClearAll || isClearAll && isClearAll !== t.props.isClearAll) {
|
|
@@ -2973,6 +3342,8 @@ var OlMap = function (_React$Component) {
|
|
|
2973
3342
|
//设置点聚合
|
|
2974
3343
|
if (typeof setCluster == 'boolean' && setCluster || setCluster && setCluster !== t.props.setCluster) {
|
|
2975
3344
|
t.cluster(mapCluster);
|
|
3345
|
+
} else if (setCluster !== t.props.setCluster) {
|
|
3346
|
+
t.clearCluster();
|
|
2976
3347
|
}
|
|
2977
3348
|
//图元编辑调用
|
|
2978
3349
|
if (typeof isDoEdit == 'boolean' && isDoEdit || isDoEdit && isDoEdit !== t.props.isDoEdit) {
|
|
@@ -3038,8 +3409,8 @@ var OlMap = function (_React$Component) {
|
|
|
3038
3409
|
e: e,
|
|
3039
3410
|
id: id,
|
|
3040
3411
|
param: t.getGraphic(id),
|
|
3041
|
-
top: e.
|
|
3042
|
-
left: e.
|
|
3412
|
+
top: e.pixel ? e.pixel[0] : undefined, //当前点所在的位置(屏幕)
|
|
3413
|
+
left: e.pixel ? e.pixel[1] : undefined
|
|
3043
3414
|
};
|
|
3044
3415
|
t.props.mouseOverGraphic(obj);
|
|
3045
3416
|
}
|
|
@@ -3057,8 +3428,8 @@ var OlMap = function (_React$Component) {
|
|
|
3057
3428
|
e: e,
|
|
3058
3429
|
id: id,
|
|
3059
3430
|
param: t.getGraphic(id),
|
|
3060
|
-
top: e.
|
|
3061
|
-
left: e.
|
|
3431
|
+
top: e.pixel ? e.pixel[0] : undefined, //当前点所在的位置(屏幕)
|
|
3432
|
+
left: e.pixel ? e.pixel[1] : undefined
|
|
3062
3433
|
};
|
|
3063
3434
|
t.props.mouseOutGraphic(obj);
|
|
3064
3435
|
}
|
|
@@ -3112,6 +3483,13 @@ var OlMap = function (_React$Component) {
|
|
|
3112
3483
|
}
|
|
3113
3484
|
cg.gradient = gradient;
|
|
3114
3485
|
}
|
|
3486
|
+
// if(d.data){
|
|
3487
|
+
// t.state.pointIds = [];
|
|
3488
|
+
// t.pointLayers.map(item => {
|
|
3489
|
+
// t.state.gis.removeLayer(item.layer);
|
|
3490
|
+
// t.pointLayers=[];
|
|
3491
|
+
// })
|
|
3492
|
+
// }
|
|
3115
3493
|
var heatData = {
|
|
3116
3494
|
type: 'FeatureCollection',
|
|
3117
3495
|
features: (d.data || []).map(function (item) {
|
|
@@ -3143,6 +3521,13 @@ var OlMap = function (_React$Component) {
|
|
|
3143
3521
|
});
|
|
3144
3522
|
t.state.gis.addLayer(t.heatmap);
|
|
3145
3523
|
}
|
|
3524
|
+
}, {
|
|
3525
|
+
key: 'clearHeatMap',
|
|
3526
|
+
value: function clearHeatMap() {
|
|
3527
|
+
var t = this;
|
|
3528
|
+
if (t.heatmap) t.state.gis.removeLayer(t.heatmap);
|
|
3529
|
+
t.heatmap = null;
|
|
3530
|
+
}
|
|
3146
3531
|
//地图移动之前事件
|
|
3147
3532
|
|
|
3148
3533
|
}, {
|
|
@@ -3201,9 +3586,9 @@ var OlMap = function (_React$Component) {
|
|
|
3201
3586
|
//编辑中的图元关闭其他事件返回
|
|
3202
3587
|
if (t.editId == id) return false;
|
|
3203
3588
|
if (typeof t.props.clickGraphic === 'function') {
|
|
3204
|
-
var _e$
|
|
3205
|
-
clientX = _e$
|
|
3206
|
-
clientY = _e$
|
|
3589
|
+
var _e$pixel = _slicedToArray(e.pixel, 2),
|
|
3590
|
+
clientX = _e$pixel[0],
|
|
3591
|
+
clientY = _e$pixel[1];
|
|
3207
3592
|
|
|
3208
3593
|
var param = t.getGraphic(id, clientX, clientY);
|
|
3209
3594
|
var obj = {
|
|
@@ -3232,7 +3617,7 @@ var OlMap = function (_React$Component) {
|
|
|
3232
3617
|
clearInterval(t.animTimer[j]);
|
|
3233
3618
|
}
|
|
3234
3619
|
}
|
|
3235
|
-
window.
|
|
3620
|
+
window.VtxMap[t.state.mapId] = null;
|
|
3236
3621
|
}
|
|
3237
3622
|
}]);
|
|
3238
3623
|
|
|
@@ -3263,4 +3648,40 @@ function getRgbColor(color, opacity) {
|
|
|
3263
3648
|
}
|
|
3264
3649
|
return 'rgba(' + arr.join(',') + ',' + opacity + ')';
|
|
3265
3650
|
}
|
|
3651
|
+
|
|
3652
|
+
// 压缩图片的方法
|
|
3653
|
+
function canvasDataURL(path, obj, callback) {
|
|
3654
|
+
var img = new Image();
|
|
3655
|
+
img.src = path;
|
|
3656
|
+
img.setAttribute("crossOrigin", 'Anonymous');
|
|
3657
|
+
img.onload = function () {
|
|
3658
|
+
var that = this;
|
|
3659
|
+
// 默认按比例压缩
|
|
3660
|
+
var w = that.width,
|
|
3661
|
+
h = that.height,
|
|
3662
|
+
scale = w / h;
|
|
3663
|
+
w = obj.width || w;
|
|
3664
|
+
h = obj.height || w / scale;
|
|
3665
|
+
var quality = 0.7; // 默认图片质量为0.7
|
|
3666
|
+
//生成canvas
|
|
3667
|
+
var canvas = document.createElement('canvas');
|
|
3668
|
+
var ctx = canvas.getContext('2d');
|
|
3669
|
+
// 创建属性节点
|
|
3670
|
+
var anw = document.createAttribute("width");
|
|
3671
|
+
anw.nodeValue = w;
|
|
3672
|
+
var anh = document.createAttribute("height");
|
|
3673
|
+
anh.nodeValue = h;
|
|
3674
|
+
canvas.setAttributeNode(anw);
|
|
3675
|
+
canvas.setAttributeNode(anh);
|
|
3676
|
+
ctx.drawImage(that, 0, 0, w, h);
|
|
3677
|
+
// 图像质量
|
|
3678
|
+
if (obj.quality && obj.quality <= 1 && obj.quality > 0) {
|
|
3679
|
+
quality = obj.quality;
|
|
3680
|
+
}
|
|
3681
|
+
// quality值越小,所绘制出的图像越模糊
|
|
3682
|
+
var base64 = canvas.toDataURL('image/jpeg', quality);
|
|
3683
|
+
// 回调函数返回base64的值
|
|
3684
|
+
callback(base64);
|
|
3685
|
+
};
|
|
3686
|
+
}
|
|
3266
3687
|
module.exports = exports['default'];
|
|
@@ -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
|
|
|
@@ -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 || {};
|