feat: 새 지도 모듈 마무리
This commit is contained in:
+4
-4
@@ -642,10 +642,10 @@ $smV: calc(500 / 700);
|
|||||||
|
|
||||||
.city_state {
|
.city_state {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 10px;
|
width: 8px;
|
||||||
height: 10px;
|
height: 8px;
|
||||||
top: -2px;
|
top: -3px;
|
||||||
left: -4px;
|
left: -5px;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -80,11 +80,15 @@ watch(
|
|||||||
left: `${x - 20}px`,
|
left: `${x - 20}px`,
|
||||||
top: `${y - 15}px`,
|
top: `${y - 15}px`,
|
||||||
};
|
};
|
||||||
|
} else {
|
||||||
|
cityPos.value = {
|
||||||
|
left: `${(x * 5) / 7 - 20}px`,
|
||||||
|
top: `${(y * 5) / 7 - 18}px`,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
function getCityState(): string {
|
function getCityState(): string {
|
||||||
const state = city.value.state;
|
const state = city.value.state;
|
||||||
if (state < 10) {
|
if (state < 10) {
|
||||||
|
|||||||
@@ -61,6 +61,7 @@
|
|||||||
:image-path="imagePath"
|
:image-path="imagePath"
|
||||||
:is-my-city="city.id === drawableMap.myCity"
|
:is-my-city="city.id === drawableMap.myCity"
|
||||||
:isFullWidth="isFullWidth"
|
:isFullWidth="isFullWidth"
|
||||||
|
:href="props.genHref?.call(city, city.id)"
|
||||||
@click="cityClick(city, $event)"
|
@click="cityClick(city, $event)"
|
||||||
@mouseenter="mouseenter(city, $event)"
|
@mouseenter="mouseenter(city, $event)"
|
||||||
@mouseleave="mouseleave(city, $event)"
|
@mouseleave="mouseleave(city, $event)"
|
||||||
@@ -73,6 +74,7 @@
|
|||||||
:city="city"
|
:city="city"
|
||||||
:is-my-city="city.id === drawableMap.myCity"
|
:is-my-city="city.id === drawableMap.myCity"
|
||||||
:isFullWidth="isFullWidth"
|
:isFullWidth="isFullWidth"
|
||||||
|
:href="props.genHref?.call(city, city.id)"
|
||||||
@click="cityClick(city, $event)"
|
@click="cityClick(city, $event)"
|
||||||
@mouseenter="mouseenter(city, $event)"
|
@mouseenter="mouseenter(city, $event)"
|
||||||
@mouseleave="mouseleave(city, $event)"
|
@mouseleave="mouseleave(city, $event)"
|
||||||
@@ -152,7 +154,6 @@ export type CityPositionMap = {
|
|||||||
</script>
|
</script>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import "@/../scss/map.scss";
|
import "@/../scss/map.scss";
|
||||||
import type { loadMapOption } from "@/map";
|
|
||||||
import { type PropType, toRef, inject, type Ref, ref, watch, type ComponentPublicInstance } from "vue";
|
import { type PropType, toRef, inject, type Ref, ref, watch, type ComponentPublicInstance } from "vue";
|
||||||
import { v4 as uuidv4 } from "uuid";
|
import { v4 as uuidv4 } from "uuid";
|
||||||
import type { MapResult } from "@/defs";
|
import type { MapResult } from "@/defs";
|
||||||
@@ -205,14 +206,6 @@ const props = defineProps({
|
|||||||
default: undefined,
|
default: undefined,
|
||||||
required: false,
|
required: false,
|
||||||
},
|
},
|
||||||
serverNick: {
|
|
||||||
type: String,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
serverID: {
|
|
||||||
type: String,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
imagePath: {
|
imagePath: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
@@ -223,17 +216,11 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
isDetailMap: { type: Boolean, default: undefined, required: false },
|
isDetailMap: { type: Boolean, default: undefined, required: false },
|
||||||
disallowClick: { type: Boolean, default: undefined, required: false },
|
disallowClick: { type: Boolean, default: undefined, required: false },
|
||||||
hrefTemplate: { type: String, default: "#", required: false },
|
genHref: {
|
||||||
/// clickable, 소속 국가, 첩보 여부 등을 반환여부를 설정
|
type: Function as PropType<(cityID: number) => string>,
|
||||||
neutralView: { type: Boolean, default: false, required: false },
|
|
||||||
///반환 값에 본인이 위치한 도시 값을 반환하도록 설정. neutralView와 별개
|
|
||||||
showMe: { type: Boolean, default: true, required: false },
|
|
||||||
|
|
||||||
callback: {
|
|
||||||
type: Function as PropType<loadMapOption["callback"]>,
|
|
||||||
default: undefined,
|
default: undefined,
|
||||||
|
required: false,
|
||||||
},
|
},
|
||||||
startYear: { type: Number, default: undefined, required: false },
|
|
||||||
|
|
||||||
cityPosition: {
|
cityPosition: {
|
||||||
type: Object as PropType<CityPositionMap>,
|
type: Object as PropType<CityPositionMap>,
|
||||||
@@ -456,7 +443,7 @@ function cityClick(city: MapCityParsed, $event: MouseEvent | TouchEvent): void {
|
|||||||
function clickOutside($event: MouseEvent): void {
|
function clickOutside($event: MouseEvent): void {
|
||||||
$event.preventDefault();
|
$event.preventDefault();
|
||||||
$event.stopPropagation();
|
$event.stopPropagation();
|
||||||
if(touchState.value == 1) {
|
if (touchState.value == 1) {
|
||||||
touchState.value = 0;
|
touchState.value = 0;
|
||||||
activatedCity.value = undefined;
|
activatedCity.value = undefined;
|
||||||
}
|
}
|
||||||
@@ -475,4 +462,4 @@ function mouseleave(city: MapCityParsed, $event: MouseEvent): void {
|
|||||||
touchState.value = 0;
|
touchState.value = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
Reference in New Issue
Block a user