Map context menu

This commit is contained in:
James Lyne 2021-05-24 16:42:32 +01:00
parent 6567cfd850
commit a8ec660ffd
5 changed files with 40 additions and 3 deletions

View File

@ -11,7 +11,7 @@
}, },
"dependencies": {}, "dependencies": {},
"devDependencies": { "devDependencies": {
"@types/clipboard": "^2.0.1", "@soerenmartius/vue3-clipboard": "^0.1.2",
"@types/leaflet": "^1.7.0", "@types/leaflet": "^1.7.0",
"@typescript-eslint/eslint-plugin": "^4.23.0", "@typescript-eslint/eslint-plugin": "^4.23.0",
"@typescript-eslint/parser": "^4.23.0", "@typescript-eslint/parser": "^4.23.0",

View File

@ -25,6 +25,7 @@
<LinkControl v-if="linkControlEnabled" :leaflet="leaflet"></LinkControl> <LinkControl v-if="linkControlEnabled" :leaflet="leaflet"></LinkControl>
<ClockControl v-if="clockControlEnabled" :leaflet="leaflet"></ClockControl> <ClockControl v-if="clockControlEnabled" :leaflet="leaflet"></ClockControl>
<ChatControl v-if="chatBoxEnabled" :leaflet="leaflet"></ChatControl> <ChatControl v-if="chatBoxEnabled" :leaflet="leaflet"></ChatControl>
<MapContextMenu :leaflet="leaflet" v-if="leaflet"></MapContextMenu>
</div> </div>
</template> </template>
@ -45,9 +46,11 @@ import {Coordinate, DynmapPlayer} from "@/dynmap";
import {ActionTypes} from "@/store/action-types"; import {ActionTypes} from "@/store/action-types";
import DynmapMap from "@/leaflet/DynmapMap"; import DynmapMap from "@/leaflet/DynmapMap";
import {LoadingControl} from "@/leaflet/control/LoadingControl"; import {LoadingControl} from "@/leaflet/control/LoadingControl";
import MapContextMenu from "@/components/map/MapContextMenu.vue";
export default defineComponent({ export default defineComponent({
components: { components: {
MapContextMenu,
MapLayer, MapLayer,
PlayersLayer, PlayersLayer,
MarkerSetLayer, MarkerSetLayer,
@ -90,20 +93,24 @@ export default defineComponent({
maps, maps,
markerSets, markerSets,
configuration, configuration,
playerMarkersEnabled, playerMarkersEnabled,
coordinatesControlEnabled, coordinatesControlEnabled,
clockControlEnabled, clockControlEnabled,
linkControlEnabled, linkControlEnabled,
chatBoxEnabled, chatBoxEnabled,
logoControls, logoControls,
followTarget, followTarget,
panTarget, panTarget,
mapBackground, mapBackground,
currentWorld, currentWorld,
currentMap, currentMap,
currentProjection, currentProjection,
scheduledPan, scheduledPan,
scheduledZoom scheduledZoom,
} }
}, },
@ -277,5 +284,6 @@ export default defineComponent({
height: 100%; height: 100%;
background: transparent; background: transparent;
z-index: 0; z-index: 0;
cursor: default;
} }
</style> </style>

View File

@ -106,6 +106,7 @@ export default defineComponent({
margin-left: auto; margin-left: auto;
padding-left: 1rem; padding-left: 1rem;
padding-right: 0.2rem; padding-right: 0.2rem;
list-style: none;
} }
} }

View File

@ -23,6 +23,7 @@ import 'normalize-scss/sass/normalize/_import-now.scss';
import '@/scss/style.scss'; import '@/scss/style.scss';
import {MutationTypes} from "@/store/mutation-types"; import {MutationTypes} from "@/store/mutation-types";
import {validateConfiguration} from "@/util"; import {validateConfiguration} from "@/util";
import { VueClipboard } from '@soerenmartius/vue3-clipboard'
const splash = document.getElementById('splash'), const splash = document.getElementById('splash'),
splashSpinner = document.getElementById('splash__spinner'), splashSpinner = document.getElementById('splash__spinner'),
@ -109,7 +110,7 @@ try {
store.commit(MutationTypes.SET_CURRENT_SERVER, config.keys().next().value); store.commit(MutationTypes.SET_CURRENT_SERVER, config.keys().next().value);
} }
const app = createApp(App).use(store); const app = createApp(App).use(store).use(VueClipboard);
// app.config.performance = true; // app.config.performance = true;
app.mount('#app'); app.mount('#app');

View File

@ -139,6 +139,33 @@ input {
} }
} }
.menu {
list-style: none;
margin: 0;
padding: 0;
font-size: 1.6rem;
ul {
list-style: none;
margin: 0;
padding: 0;
}
> li {
display: flex;
padding: 0.8rem 0.8rem 0.7rem;
margin: 0 !important;
> button {
margin: -0.8rem -0.8rem -0.7rem;
padding: 0.8rem 0.8rem 0.7rem;
text-align: left;
flex-grow: 1;
min-height: 3.2rem;
}
}
}
#app .map .tile img, img { #app .map .tile img, img {
image-rendering: pixelated; image-rendering: pixelated;
} }