Skip to content

Commit

Permalink
remove bug draw
Browse files Browse the repository at this point in the history
  • Loading branch information
lanseria committed Mar 18, 2024
1 parent a418275 commit fa95ed7
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 27 deletions.
13 changes: 10 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
<!DOCTYPE html>
<!doctype html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="/512.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Map Studio 万物分享</title>
<meta name="description" content="map.studio 万物分享 | share studio 分享任何地图上的有趣的事物">
<meta
name="description"
content="map.studio 万物分享 | share studio 分享任何地图上的有趣的事物"
/>
</head>
<body class="font-sans">
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
<script defer data-domain="map-studio.netlify.app" src="https://plausible.vip.cpolar.top/js/script.js"></script>
<script
defer
data-domain="map-studio.netlify.app"
src="https://plausible.vip.cpolar.top/js/script.js"
></script>
</body>
</html>
4 changes: 2 additions & 2 deletions src/components/Map/MapHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ function handleAbout() {
</div>
</div>
<div class="mr-8px flex items-center">
<div class="ml-8px cursor-pointer" :class="globalMapDrawEnable ? 'bg-green' : ''" @click="globalHandleMapDrawToggle()">
<!-- <div class="ml-8px cursor-pointer" :class="globalMapDrawEnable ? 'bg-green' : ''" @click="globalHandleMapDrawToggle()">
Draw
</div>
</div> -->
<div class="ml-8px cursor-pointer" @click="handleAbout()">
About
</div>
Expand Down
40 changes: 18 additions & 22 deletions src/components/Map/MapLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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' }))
Expand All @@ -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')
Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions src/composables/map/mapLoad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,8 @@ export function mapLoad() {
})
})
// 点击事件
map.on('mouseup', (e) => {
console.log(e)
})
addMapParkingSpotLayerClickEvents()
}

0 comments on commit fa95ed7

Please sign in to comment.