@vtx/map 1.2.9 → 1.2.11
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
CHANGED
|
@@ -431,11 +431,15 @@ var OlMap = /*#__PURE__*/function (_React$Component) {
|
|
|
431
431
|
// 地图开始加载时
|
|
432
432
|
|
|
433
433
|
gis.on('loadstart', function () {
|
|
434
|
-
gis.getTargetElement()
|
|
434
|
+
if (gis.getTargetElement()) {
|
|
435
|
+
gis.getTargetElement().classList.add('spinner');
|
|
436
|
+
}
|
|
435
437
|
}); // 地图加载结束时
|
|
436
438
|
|
|
437
439
|
gis.on('loadend', function () {
|
|
438
|
-
gis.getTargetElement()
|
|
440
|
+
if (gis.getTargetElement()) {
|
|
441
|
+
gis.getTargetElement().classList.remove('spinner');
|
|
442
|
+
}
|
|
439
443
|
}); // 地图双击事件
|
|
440
444
|
|
|
441
445
|
gis.on('dbclick', function (evt) {}); // 地图点击事件
|
|
@@ -472,7 +476,11 @@ var OlMap = /*#__PURE__*/function (_React$Component) {
|
|
|
472
476
|
gis.on('pointermove', function (evt) {
|
|
473
477
|
var pixel = gis.getEventPixel(evt.originalEvent);
|
|
474
478
|
var hit = gis.hasFeatureAtPixel(pixel);
|
|
475
|
-
|
|
479
|
+
|
|
480
|
+
if (gis.getTargetElement()) {
|
|
481
|
+
gis.getTargetElement().style.cursor = hit ? 'pointer' : 'default';
|
|
482
|
+
} // 获取到当前鼠标移动下的feature
|
|
483
|
+
|
|
476
484
|
|
|
477
485
|
var feature = gis.forEachFeatureAtPixel(pixel, function (feature, layer) {
|
|
478
486
|
return feature;
|