From fa95ed767a6a56500f2040189d7e6cc22061c171 Mon Sep 17 00:00:00 2001 From: lanseria Date: Mon, 18 Mar 2024 11:28:06 +0800 Subject: [PATCH] remove bug draw --- index.html | 13 ++++++++--- src/components/Map/MapHeader.vue | 4 ++-- src/components/Map/MapLayout.vue | 40 ++++++++++++++------------------ src/composables/map/mapLoad.ts | 3 +++ 4 files changed, 33 insertions(+), 27 deletions(-) diff --git a/index.html b/index.html index be0c68a..ad38f58 100644 --- a/index.html +++ b/index.html @@ -1,15 +1,22 @@ - + Map Studio 万物分享 - +
- + diff --git a/src/components/Map/MapHeader.vue b/src/components/Map/MapHeader.vue index 05f53c6..7dc3567 100644 --- a/src/components/Map/MapHeader.vue +++ b/src/components/Map/MapHeader.vue @@ -19,9 +19,9 @@ function handleAbout() {
-
+
About
diff --git a/src/components/Map/MapLayout.vue b/src/components/Map/MapLayout.vue index 6e483b3..d666186 100644 --- a/src/components/Map/MapLayout.vue +++ b/src/components/Map/MapLayout.vue @@ -29,18 +29,18 @@ onMounted(() => { }) window.map = map - const draw = new MapboxDraw({ - displayControlsDefault: false, - userProperties: true, - modes: { - ...MapboxDraw.modes, - draw_line_string: DrawLineString, - draw_radius: RadiusMode, - }, - styles: drawStyles, - }) - map.addControl(draw) - window.draw = draw + // const draw = new MapboxDraw({ + // displayControlsDefault: false, + // userProperties: true, + // modes: { + // ...MapboxDraw.modes, + // draw_line_string: DrawLineString, + // draw_radius: RadiusMode, + // }, + // styles: drawStyles, + // }) + // map.addControl(draw) + // window.draw = draw // map.scrollZoom.setWheelZoomRate(1) // map.scrollZoom.setZoomRate(1) map.addControl(new MapboxLanguage({ defaultLanguage: 'zh-Hans' })) @@ -54,7 +54,7 @@ onMounted(() => { /* Style */ map.addControl(new StylesControl({ }), 'bottom-right') /* Ruler */ - map.addControl(new RulerControl(), 'top-right') + // map.addControl(new RulerControl(), 'top-right') /* Weather */ map.addControl(new LayersControl({ }), 'bottom-right') @@ -68,11 +68,11 @@ onMounted(() => { mapLoad() }) - map.on('draw.create', (e) => { - console.warn('[draw.create]') - pushMapDrawFeatures(e.features[0]) - draw.deleteAll() - }) + // map.on('draw.create', (e) => { + // console.warn('[draw.create]') + // pushMapDrawFeatures(e.features[0]) + // draw.deleteAll() + // }) }) function toggleLeftSidebar() { storeMapLeftCollapsed.value = !storeMapLeftCollapsed.value @@ -122,10 +122,6 @@ function toggleLeftSidebar() { :global(.mapbox-control button[disabled] svg) { fill: rgba(0, 0, 0, 0.2); } -:global(.mapbox-control-styles) { - /* display: flex; - overflow: hidden; */ -} :global(.mapbox-control-styles button) { width: auto; display: flex; diff --git a/src/composables/map/mapLoad.ts b/src/composables/map/mapLoad.ts index 67e410a..9de9a9a 100644 --- a/src/composables/map/mapLoad.ts +++ b/src/composables/map/mapLoad.ts @@ -43,5 +43,8 @@ export function mapLoad() { }) }) // 点击事件 + map.on('mouseup', (e) => { + console.log(e) + }) addMapParkingSpotLayerClickEvents() }