Browse Source

Merge branch 'ctw' of http://124.70.32.114:3100/woka/cesium-map-object into mh

# Conflicts:
#	ruoyi-ui/src/views/cesiumMap/index.vue
master
menghao 3 months ago
parent
commit
8afdbd1ff8
  1. 738
      ruoyi-ui/src/views/cesiumMap/index.vue

738
ruoyi-ui/src/views/cesiumMap/index.vue

@ -11,6 +11,26 @@
</div> -->
<!-- 工具栏内容 -->
<div class="location-panel">
<div class="input-group">
<input
type="number"
v-model.number="targetLng"
placeholder="经度 (例如 116.40)"
step="0.000001"
>
<input
type="number"
v-model.number="targetLat"
placeholder="纬度 (例如 39.90)"
step="0.000001"
>
<button @click="flyToLocation" class="tool-btn location-btn">
<span class="icon">🚀</span>
定位
</button>
</div>
</div>
<div class="toolbar-content" v-show="!isToolbarCollapsed">
<div class="toolbar-group">
<button
@ -209,6 +229,11 @@ export default {
scaleBar: null,
isToolbarCollapsed: false,
// ================== ==================
targetLng: 116.3974, // ()
targetLat: 39.9093, //
// =================================================
//
drawingMode: null, // 'point', 'line', 'polygon', 'rectangle', 'circle'
drawingHandler: null,
@ -365,25 +390,26 @@ export default {
loadOfflineMap() {
this.viewer.imageryLayers.removeAll()
try {
const offlineProvider = new Cesium.UrlTemplateImageryProvider({
url: 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
// ArcGIS
const administrativeMap = new Cesium.UrlTemplateImageryProvider({
// 2D
url: 'https://webrd02.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}',
minimumLevel: 0,
maximumLevel: 18,
tileWidth: 256,
tileHeight: 256,
tilingScheme: new Cesium.WebMercatorTilingScheme(),
credit: '离线地图'
// TilingScheme使 WebMercator
tilingScheme: new Cesium.WebMercatorTilingScheme()
})
this.viewer.imageryLayers.addImageryProvider(offlineProvider)
this.viewer.imageryLayers.addImageryProvider(administrativeMap)
// add
} catch (error) {
console.error('加载离线地图失败:', error)
console.error('加载地图失败:', error)
this.showGridLayer()
}
},
},
showGridLayer() {
const gridProvider = new Cesium.GridImageryProvider()
@ -497,68 +523,94 @@ export default {
},
// 线
// 线
startLineDrawing() {
this.drawingPoints = [];
//
let activeCursorPosition = null;
// -
//
if (this.tempEntity) this.viewer.entities.remove(this.tempEntity);
if (this.tempPreviewEntity) this.viewer.entities.remove(this.tempPreviewEntity);
this.tempEntity = null;
this.tempPreviewEntity = null;
// 1.
this.drawingHandler.setInputAction((movement) => {
const newPosition = this.getClickPosition(movement.endPosition);
if (newPosition) {
activeCursorPosition = newPosition;
}
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
// 2.
this.drawingHandler.setInputAction((click) => {
const position = this.getClickPosition(click.position);
if (position) {
this.drawingPoints.push(position);
// 线
// === 线 ===
if (this.drawingPoints.length === 1) {
const previewPositions = [position, position];
if (this.tempPreviewEntity) {
this.viewer.entities.remove(this.tempPreviewEntity);
}
activeCursorPosition = position; //
// 线
this.tempPreviewEntity = this.viewer.entities.add({
polyline: {
positions: previewPositions,
// 使 CallbackProperty
positions: new Cesium.CallbackProperty(() => {
//
if (this.drawingPoints.length > 0 && activeCursorPosition) {
//
const lastPoint = this.drawingPoints[this.drawingPoints.length - 1];
// [, ]
return [lastPoint, activeCursorPosition];
}
return [];
}, false),
width: this.defaultStyles.line.width,
material: Cesium.Color.fromCssColorString(this.defaultStyles.line.color).withAlpha(0.5),
clampToGround: true
// 线
material: new Cesium.PolylineDashMaterialProperty({
color: Cesium.Color.fromCssColorString(this.defaultStyles.line.color),
dashLength: 16
}),
clampToGround: true //
}
});
}
// === /线 ===
else {
// 线线
if (this.tempEntity) {
this.viewer.entities.remove(this.tempEntity);
}
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
// - 线
this.drawingHandler.setInputAction((movement) => {
if (this.drawingPoints.length > 0) {
const mousePosition = this.getClickPosition(movement.endPosition);
if (mousePosition) {
// 线
const previewPositions = [...this.drawingPoints, mousePosition];
// 线
if (this.tempPreviewEntity) {
this.viewer.entities.remove(this.tempPreviewEntity);
}
// 线
this.tempPreviewEntity = this.viewer.entities.add({
this.tempEntity = this.viewer.entities.add({
polyline: {
positions: previewPositions,
positions: this.drawingPoints,
width: this.defaultStyles.line.width,
material: Cesium.Color.fromCssColorString(this.defaultStyles.line.color).withAlpha(0.5), //
material: Cesium.Color.fromCssColorString(this.defaultStyles.line.color),
clampToGround: true
}
});
}
}
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
//
// 3.
this.drawingHandler.setInputAction(() => {
// 线
if (this.tempPreviewEntity) {
this.viewer.entities.remove(this.tempPreviewEntity);
this.tempPreviewEntity = null;
}
if (this.drawingPoints.length > 1) {
this.finishLineDrawing();
} else {
this.cancelDrawing();
}
//
activeCursorPosition = null;
}, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
},
@ -591,63 +643,84 @@ export default {
//
startPolygonDrawing() {
this.drawingPoints = [];
let activeCursorPosition = null; //
// 1.
//
if (this.tempEntity) this.viewer.entities.remove(this.tempEntity);
if (this.tempPreviewEntity) this.viewer.entities.remove(this.tempPreviewEntity);
this.tempEntity = null;
this.tempPreviewEntity = null;
// 2.
this.drawingHandler.setInputAction((movement) => {
const newPosition = this.getClickPosition(movement.endPosition);
if (newPosition) {
activeCursorPosition = newPosition;
}
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
// 3.
this.drawingHandler.setInputAction((click) => {
const position = this.getClickPosition(click.position)
const position = this.getClickPosition(click.position);
if (position) {
this.drawingPoints.push(position)
this.drawingPoints.push(position);
//
if (this.tempEntity) {
this.viewer.entities.remove(this.tempEntity)
}
// === ===
if (this.drawingPoints.length === 1) {
activeCursorPosition = position; //
if (this.drawingPoints.length > 2) {
//
const polygonPoints = [...this.drawingPoints, this.drawingPoints[0]]
this.tempEntity = this.viewer.entities.add({
// --- ---
polygon: {
hierarchy: new Cesium.PolygonHierarchy(polygonPoints),
material: Cesium.Color.fromCssColorString(this.defaultStyles.polygon.color)
.withAlpha(this.defaultStyles.polygon.opacity),
outline: true,
outlineColor: Cesium.Color.fromCssColorString(this.defaultStyles.polygon.color),
outlineWidth: this.defaultStyles.polygon.width
}
})
} else if (this.drawingPoints.length === 2) {
// 线
this.tempEntity = this.viewer.entities.add({
// hierarchy 使 CallbackProperty
hierarchy: new Cesium.CallbackProperty(() => {
// +
if (activeCursorPosition) {
return new Cesium.PolygonHierarchy([...this.drawingPoints, activeCursorPosition]);
}
return new Cesium.PolygonHierarchy(this.drawingPoints);
}, false),
// 使便
material: Cesium.Color.fromCssColorString(this.defaultStyles.polygon.color).withAlpha(0.5),
//
perPositionHeight: false
},
// --- 线 ---
polyline: {
positions: this.drawingPoints,
width: this.defaultStyles.polygon.width,
material: Cesium.Color.fromCssColorString(this.defaultStyles.polygon.color),
// positions 使 CallbackProperty 线
positions: new Cesium.CallbackProperty(() => {
if (activeCursorPosition) {
// [, , ]
return [...this.drawingPoints, activeCursorPosition, this.drawingPoints[0]];
}
return this.drawingPoints;
}, false),
width: this.defaultStyles.line.width,
// 使线
material: new Cesium.PolylineDashMaterialProperty({
color: Cesium.Color.fromCssColorString(this.defaultStyles.line.color),
dashLength: 16
}),
clampToGround: true
}
})
} else if (this.drawingPoints.length === 1) {
//
this.tempEntity = this.viewer.entities.add({
position: this.drawingPoints[0],
point: {
pixelSize: 8,
color: Cesium.Color.fromCssColorString(this.defaultStyles.polygon.color)
}
})
});
}
}
}, Cesium.ScreenSpaceEventType.LEFT_CLICK)
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
//
this.drawingHandler.setInputAction((click) => {
if (this.drawingPoints.length > 2) {
this.finishPolygonDrawing()
// 4.
this.drawingHandler.setInputAction(() => {
if (this.drawingPoints.length >= 3) {
this.finishPolygonDrawing(); //
} else {
this.cancelDrawing(); //
}
}, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)
//
this.drawingHandler.setInputAction(() => {
this.cancelDrawing()
}, Cesium.ScreenSpaceEventType.RIGHT_CLICK)
//
activeCursorPosition = null;
}, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
},
finishPolygonDrawing() {
@ -665,156 +738,288 @@ export default {
return entity
},
//
//
startRectangleDrawing() {
let startPosition = null
this.drawingPoints = []; //
let activeCursorPosition = null; //
let startPoint = null; //
this.drawingHandler.setInputAction((click) => {
startPosition = this.getClickPosition(click.position)
if (startPosition) {
this.drawingStartPoint = startPosition
}
}, Cesium.ScreenSpaceEventType.LEFT_DOWN)
// 1.
if (this.tempEntity) this.viewer.entities.remove(this.tempEntity);
this.tempEntity = null;
// 2.
this.drawingHandler.setInputAction((movement) => {
if (startPosition) {
const endPosition = this.getClickPosition(movement.endPosition)
if (endPosition) {
//
if (this.tempEntity) {
this.viewer.entities.remove(this.tempEntity)
const newPosition = this.getClickPosition(movement.endPosition);
if (newPosition) {
activeCursorPosition = newPosition;
}
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
const rectangle = this.calculateRectangle(startPosition, endPosition)
// 3.
this.drawingHandler.setInputAction((click) => {
const position = this.getClickPosition(click.position);
if (position) {
// --- A ---
if (!startPoint) {
startPoint = position;
this.drawingPoints.push(startPoint);
activeCursorPosition = startPoint; //
//
this.tempEntity = this.viewer.entities.add({
rectangle: {
coordinates: rectangle,
material: Cesium.Color.fromCssColorString(this.defaultStyles.rectangle.color)
.withAlpha(this.defaultStyles.rectangle.opacity),
// 使 CallbackProperty
coordinates: new Cesium.CallbackProperty(() => {
if (startPoint && activeCursorPosition) {
// 使 Cesium
return Cesium.Rectangle.fromCartesianArray([startPoint, activeCursorPosition]);
}
return Cesium.Rectangle.fromDegrees(0, 0, 0, 0);
}, false),
// +
material: Cesium.Color.fromCssColorString(this.defaultStyles.polygon.color).withAlpha(0.5),
outline: true,
outlineColor: Cesium.Color.fromCssColorString(this.defaultStyles.rectangle.color),
outlineWidth: this.defaultStyles.rectangle.width
}
})
outlineColor: Cesium.Color.fromCssColorString(this.defaultStyles.line.color),
outlineWidth: 2,
clampToGround: true //
}
});
}
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE)
// --- B ---
else {
this.drawingPoints.push(position);
//
activeCursorPosition = null;
this.drawingHandler.setInputAction(() => {
if (startPosition && this.tempEntity) {
this.finishRectangleDrawing(startPosition)
startPosition = null
//
this.finishRectangleDrawing();
}
}, Cesium.ScreenSpaceEventType.LEFT_UP)
}
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
//
// 4.
this.drawingHandler.setInputAction(() => {
this.cancelDrawing()
}, Cesium.ScreenSpaceEventType.RIGHT_CLICK)
this.cancelDrawing();
}, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
},
finishRectangleDrawing(startPosition) {
if (!this.tempEntity) return
finishRectangleDrawing() {
// 1.
const rect = Cesium.Rectangle.fromCartesianArray(this.drawingPoints);
const rectangleCoords = this.tempEntity.rectangle.coordinates.getValue()
const entity = this.addRectangleEntity(rectangleCoords)
// 2.
if (this.tempEntity) {
this.viewer.entities.remove(this.tempEntity);
this.tempEntity = null;
}
//
const area = this.calculateRectangleArea(rectangleCoords)
// 3.
const finalEntity = this.viewer.entities.add({
id: 'rectangle-' + new Date().getTime(), // ID
rectangle: {
coordinates: rect,
material: Cesium.Color.fromCssColorString(this.defaultStyles.polygon.color).withAlpha(0.5),
outline: true,
outlineColor: Cesium.Color.fromCssColorString(this.defaultStyles.line.color),
outlineWidth: 2,
clampToGround: true
}
});
// 4.
this.allEntities.push(finalEntity);
// 5.
const area = this.calculateRectangleArea(rect);
this.measurementResult = {
area: area,
type: 'rectangle'
}
};
this.stopDrawing()
return entity
// 6.
this.stopDrawing();
},
//
calculateRectangleArea(rectangle) {
//
const ellipsoid = this.viewer.scene.globe.ellipsoid;
// 使 Cesium
// const geometry = new Cesium.RectangleGeometry({ rectangle: rectangle });
// const geometryInstance = Cesium.RectangleGeometry.createGeometry(geometry);
// ...
// 使
//
const west = rectangle.west;
const south = rectangle.south;
const east = rectangle.east;
const north = rectangle.north;
//
const centerLat = (south + north) / 2;
// 西使
// 6378137
const R = 6378137;
const width = (east - west) * R * Math.cos(centerLat);
//
const height = (north - south) * R;
// = *
const area = Math.abs(width * height);
return area;
},
//
startCircleDrawing() {
let centerPosition = null
let radius = 0
this.drawingPoints = []; //
let activeCursorPosition = null; //
let centerPoint = null; //
this.drawingHandler.setInputAction((click) => {
centerPosition = this.getClickPosition(click.position)
if (centerPosition) {
this.drawingStartPoint = centerPosition
// 1.
if (this.tempEntity) this.viewer.entities.remove(this.tempEntity);
this.tempEntity = null;
//
if (this.tempEntity) {
this.viewer.entities.remove(this.tempEntity)
// 2.
this.drawingHandler.setInputAction((movement) => {
const newPosition = this.getClickPosition(movement.endPosition);
if (newPosition) {
activeCursorPosition = newPosition;
}
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
// 3.
this.drawingHandler.setInputAction((click) => {
const position = this.getClickPosition(click.position);
if (position) {
// --- A ---
if (!centerPoint) {
centerPoint = position;
this.drawingPoints.push(centerPoint);
activeCursorPosition = centerPoint;
//
this.tempEntity = this.viewer.entities.add({
position: centerPosition,
point: {
pixelSize: 8,
color: Cesium.Color.fromCssColorString(this.defaultStyles.circle.color)
position: centerPoint, //
ellipse: {
// 使 CallbackProperty
semiMajorAxis: new Cesium.CallbackProperty(() => {
if (centerPoint && activeCursorPosition) {
return Cesium.Cartesian3.distance(centerPoint, activeCursorPosition);
}
return 0;
}, false),
semiMinorAxis: new Cesium.CallbackProperty(() => {
if (centerPoint && activeCursorPosition) {
return Cesium.Cartesian3.distance(centerPoint, activeCursorPosition);
}
return 0;
}, false),
//
material: Cesium.Color.fromCssColorString(this.defaultStyles.polygon.color).withAlpha(0.5),
outline: true,
outlineColor: Cesium.Color.fromCssColorString(this.defaultStyles.line.color),
outlineWidth: 2,
// height: 0, // 使 heightReference
}
})
});
}
}, Cesium.ScreenSpaceEventType.LEFT_DOWN)
// --- B/ ---
else {
// 便
this.drawingPoints.push(position);
activeCursorPosition = null; //
this.drawingHandler.setInputAction((movement) => {
if (centerPosition) {
const currentPosition = this.getClickPosition(movement.endPosition)
if (currentPosition) {
radius = Cesium.Cartesian3.distance(centerPosition, currentPosition)
//
this.finishCircleDrawing(position);
}
}
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
//
// 4.
this.drawingHandler.setInputAction(() => {
this.cancelDrawing();
}, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
},
finishCircleDrawing(edgePosition) {
const centerPoint = this.drawingPoints[0];
// 1.
const radius = Cesium.Cartesian3.distance(centerPoint, edgePosition);
// 2.
if (this.tempEntity) {
this.viewer.entities.remove(this.tempEntity)
this.viewer.entities.remove(this.tempEntity);
this.tempEntity = null;
}
//
const positions = this.calculateCircle(centerPosition, radius, 64)
this.tempEntity = this.viewer.entities.add({
polygon: {
hierarchy: new Cesium.PolygonHierarchy(positions),
material: Cesium.Color.fromCssColorString(this.defaultStyles.circle.color)
.withAlpha(this.defaultStyles.circle.opacity),
// 3.
const finalEntity = this.viewer.entities.add({
id: 'circle-' + new Date().getTime(),
position: centerPoint,
ellipse: {
semiMajorAxis: radius,
semiMinorAxis: radius,
material: Cesium.Color.fromCssColorString(this.defaultStyles.polygon.color).withAlpha(0.5),
outline: true,
outlineColor: Cesium.Color.fromCssColorString(this.defaultStyles.circle.color),
outlineWidth: this.defaultStyles.circle.width
}
})
}
}
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE)
this.drawingHandler.setInputAction(() => {
if (centerPosition && radius > 0) {
this.finishCircleDrawing(centerPosition, radius)
centerPosition = null
radius = 0
outlineColor: Cesium.Color.fromCssColorString(this.defaultStyles.line.color),
outlineWidth: 2
}
}, Cesium.ScreenSpaceEventType.LEFT_UP)
});
//
// this.drawingHandler.setInputAction(() => {
// this.cancelDrawing()
// }, Cesium.ScreenSpaceEventType.RIGHT_CLICK)
},
// 4.
this.allEntities.push(finalEntity);
finishCircleDrawing(center, radius) {
const positions = this.calculateCircle(center, radius, 64)
const entity = this.addCircleEntity(center, radius, positions)
// 5. (π * r²)
//
const area = Math.PI * Math.pow(radius, 2);
//
const area = Math.PI * radius * radius
this.measurementResult = {
radius: radius, //
area: area,
radius: radius,
type: 'circle'
};
// 6.
this.stopDrawing();
},
flyToLocation() {
// 1.
if (!this.targetLng || !this.targetLat) {
alert("请输入有效的经度和纬度!");
return;
}
this.stopDrawing()
return entity
const lng = parseFloat(this.targetLng);
const lat = parseFloat(this.targetLat);
//
if (lng < -180 || lng > 180 || lat < -90 || lat > 90) {
alert("经纬度超出有效范围!");
return;
}
// 2.
if (this.viewer) {
this.viewer.camera.flyTo({
destination: Cesium.Cartesian3.fromDegrees(lng, lat, 5000), // 5000
orientation: {
heading: Cesium.Math.toRadians(0.0),
pitch: Cesium.Math.toRadians(-90.0), //
roll: 0.0
},
duration: 2 //
});
cancelDrawing() {
this.stopDrawing()
this.drawingMode = null
//
this.addTempMarker(lng, lat);
}
},
// ================== ==================
@ -962,72 +1167,37 @@ export default {
}
})
const entityData = {
id,
type: 'rectangle',
coordinates: coordinates,
entity: entity,
color: this.defaultStyles.rectangle.color,
opacity: this.defaultStyles.rectangle.opacity,
width: this.defaultStyles.rectangle.width,
label: `矩形 ${this.entityCounter}`
}
this.allEntities.push(entityData)
// entity bug
this.allEntities.push(entity)
entity.clickHandler = (e) => {
this.selectEntity(entityData)
e.stopPropagation()
}
return entityData
},
addCircleEntity(center, radius, positions) {
return entity
},
addCircleEntity(center, radius) {
this.entityCounter++
const id = `circle_${this.entityCounter}`
const entity = this.viewer.entities.add({
id: id,
name: `圆形 ${this.entityCounter}`,
polygon: {
hierarchy: new Cesium.PolygonHierarchy(positions),
position: center, //
// 使 ellipse ()
ellipse: {
semiMinorAxis: radius, // =
semiMajorAxis: radius, // =
material: Cesium.Color.fromCssColorString(this.defaultStyles.circle.color)
.withAlpha(this.defaultStyles.circle.opacity),
outline: true,
outlineColor: Cesium.Color.fromCssColorString(this.defaultStyles.circle.color),
outlineWidth: this.defaultStyles.circle.width
},
position: center,
point: {
pixelSize: 5,
color: Cesium.Color.RED
}
})
const centerLL = this.cartesianToLatLng(center)
const entityData = {
id,
type: 'circle',
center: centerLL,
radius: radius,
positions: positions,
entity: entity,
color: this.defaultStyles.circle.color,
opacity: this.defaultStyles.circle.opacity,
width: this.defaultStyles.circle.width,
label: `圆形 ${this.entityCounter}`
}
this.allEntities.push(entityData)
entity.clickHandler = (e) => {
this.selectEntity(entityData)
e.stopPropagation()
}
// entity
this.allEntities.push(entity)
return entityData
},
return entity
},
// ================== ==================
@ -1206,25 +1376,47 @@ export default {
},
clearAll() {
//
this.stopDrawing()
this.drawingMode = null
// 1.
if (this.allEntities && this.allEntities.length > 0) {
//
this.allEntities.forEach(entity => {
if (entity.entity) {
this.viewer.entities.remove(entity.entity)
// 2.
this.allEntities.forEach(item => {
try {
// A: Cesium Entity (线)
if (item instanceof Cesium.Entity) {
this.viewer.entities.remove(item);
}
// B: ( { entity: ... })
else if (item.entity && item.entity instanceof Cesium.Entity) {
this.viewer.entities.remove(item.entity);
}
// C: ID
else if (item.id) {
this.viewer.entities.removeById(item.id);
}
} catch (e) {
console.warn('删除实体失败:', e);
}
});
}
})
//
this.allEntities = []
this.entityCounter = 0
this.selectedEntity = null
this.measurementResult = null
// 3.
this.allEntities = [];
console.log('已清除所有图形')
},
// 4.
if (this.tempEntity) {
this.viewer.entities.remove(this.tempEntity);
this.tempEntity = null;
}
if (this.tempPreviewEntity) {
this.viewer.entities.remove(this.tempPreviewEntity);
this.tempPreviewEntity = null;
}
// 5.
this.measurementResult = null;
this.stopDrawing();
},
// ================== ==================
@ -1443,6 +1635,54 @@ export default {
margin: 5px 0;
}
/* 定位面板样式 */
.location-panel {
position: absolute;
top: -80px;
right: -180px; /* 放在右上角 */
z-index: 1000;
background: rgba(255, 255, 255, 0.95);
border-radius: 8px;
padding: 10px;
box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.input-group {
display: flex;
gap: 10px;
align-items: center;
}
.input-group input {
width: 100px;
padding: 6px 10px;
border: 1px solid #ddd;
border-radius: 4px;
outline: none;
font-size: 14px;
}
.input-group input:focus {
border-color: #4dabf7;
}
.location-btn {
background: #4dabf7;
color: white;
border: none;
padding: 6px 15px;
border-radius: 4px;
cursor: pointer;
display: flex;
align-items: center;
gap: 5px;
transition: background 0.3s;
}
.location-btn:hover {
background: #3b8dbd;
}
/* 原来的工具按钮样式保持不变,但添加展开/收起状态的调整 */
.tool-btn {
padding: 10px 15px;
@ -1572,3 +1812,5 @@ export default {
}
}
</style>

Loading…
Cancel
Save