forked from xkjyeah/vue-google-maps
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(v3): remove exposed instances because they are always undefined a…
…nd cause errors with watchers and events * test(v3): update cypress runner to use typescript * chore(v3): add space between lines * refactor(v3): improve function recycling code * fix(v3): add autocomplete-key and promise deferred pattern to autocomplete component * test(v3): add autocomplete component test * refactor(v3): fix typo on autocomplete word * chore(v3): remove unnecessary console log * chore(v3): update autocomplete slot comment * test(v3): add autocomplete and map component tests * test(v3): add marker component test We also improved the map and autocomplete component tests * test(v3): add circle component test We also improved other tests adding unmounted tests * test(v3): add cluster icon component test We also improve the circle shape component tests. * test(v3): add component test for drawing-manager We also improved mocks on other component tests * chore(root): add launch config to debug current test with vite * test(v3): add component test for heatmap layer * test(v3): add component test for info-window component * test(v3): add component test for kml-layer component * test(v3): add component test for polygon-shape component * test(v3): add component test for polyline-shape component * test(v3): add component test for street-view-panorama component * test(v3): add tests for main.ts module * fix(v3): remove exposed instances because they are always undefined * test(v3): fix marker e2e tests after the last changes * fix(v3): remove undefined instances and fix watchers Solve: #318 #319 * test(v3): add component unit tests and fix e2e tests Solve: #320 * chore(v3): add new script to build for development * chore(root): update lock file * refactor(v3): move component promises into a factory function. * chore(root): upgrade node version on gh actions and update lock file * chore(root): update lock file to pnpm version 9 * chore(root): update package-manager property on the root package
- Loading branch information
Showing
51 changed files
with
19,973 additions
and
14,114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
99 changes: 99 additions & 0 deletions
99
packages/v3/cypress/runner/components/TwoMapsInSamePage.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
<template> | ||
<GmvMap | ||
ref="mapRef" | ||
class="map" | ||
:center="center" | ||
:zoom="7" | ||
mapId="DEMO_MAP_ID" | ||
mapKey="firstMap" | ||
> | ||
<!-- <GmvInfoWindow | ||
:content="'<strong style=\'color:black\'>Marker 1</strong>'" | ||
:marker="markerRef?.markerInstance" | ||
:opened="infoWinOpen" | ||
:position="{ lat: 1.0, lng: 100.0 }" | ||
@closeclick="toggleInfoWindow" | ||
/> --> | ||
<GmvMarker | ||
v-if="mapRef" | ||
ref="markerRef" | ||
:position="{ lat: 1.0, lng: 100.0 }" | ||
@click="toggleInfoWindow" | ||
/> | ||
</GmvMap> | ||
|
||
<br /> | ||
<br /> | ||
|
||
<GmvMap | ||
ref="mapRef2" | ||
class="map" | ||
:center="center" | ||
:zoom="7" | ||
mapId="DEMO_MAP_ID" | ||
:options="{ recycle: 'secondMap' }" | ||
> | ||
<!-- <GmvInfoWindow | ||
:content="'<strong style=\'color:black\'>Marker 1</strong>'" | ||
:marker="markerRef2?.markerInstance" | ||
:opened="infoWinOpen" | ||
:position="center" | ||
@closeclick="toggleInfoWindow" | ||
/> --> | ||
<GmvMarker | ||
v-if="mapRef2" | ||
ref="markerRef2" | ||
:position="center" | ||
@click="toggleInfoWindow" | ||
/> | ||
</GmvMap> | ||
</template> | ||
<script setup lang="ts"> | ||
import type { MapLayer, Marker } from '@gmap-vue/v3/components'; | ||
import { useMapPromise } from '@gmap-vue/v3/composables'; | ||
import { ComponentInstance, onMounted, ref } from 'vue'; | ||
const mapRef = ref<ComponentInstance<typeof MapLayer> | null>(null); | ||
const mapRef2 = ref<ComponentInstance<typeof MapLayer> | null>(null); | ||
const markerRef = ref<ComponentInstance<typeof Marker> | null>(null); | ||
const markerRef2 = ref<ComponentInstance<typeof Marker> | null>(null); | ||
const infoWinOpen = ref<boolean>(false); | ||
const mapPromise = useMapPromise('firstMap'); | ||
const mapPromise2 = useMapPromise('secondMap'); | ||
const center = { | ||
lat: 1.32, | ||
lng: 103.8, | ||
}; | ||
function toggleInfoWindow() { | ||
console.log('clicked...', infoWinOpen.value); | ||
infoWinOpen.value = !infoWinOpen.value; | ||
} | ||
onMounted(() => { | ||
mapPromise?.then((map) => { | ||
if (map) { | ||
setTimeout(() => { | ||
map.panTo({ lat: 1.0, lng: 100.0 }); | ||
console.log(mapRef.value?.getRecycleKey()); | ||
console.log(mapRef2.value?.getRecycleKey()); | ||
}, 2000); | ||
} | ||
}); | ||
mapPromise2?.then((map) => { | ||
if (map) { | ||
setTimeout(() => { | ||
map.panTo({ lat: 1.0, lng: 100.0 }); | ||
console.log(mapRef.value?.getRecycleKey()); | ||
console.log(mapRef2.value?.getRecycleKey()); | ||
}, 2000); | ||
} | ||
}); | ||
}); | ||
</script> | ||
<style scoped> | ||
.map { | ||
height: 50vh; | ||
width: 50vw; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES2020", | ||
"useDefineForClassFields": true, | ||
"module": "ESNext", | ||
"lib": ["ES2020", "DOM", "DOM.Iterable"], | ||
"skipLibCheck": true, | ||
|
||
/* Bundler mode */ | ||
"moduleResolution": "bundler", | ||
"allowImportingTsExtensions": true, | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"noEmit": true, | ||
"jsx": "preserve", | ||
|
||
/* Linting */ | ||
"strict": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noFallthroughCasesInSwitch": true | ||
}, | ||
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"], | ||
"references": [{ "path": "./tsconfig.node.json" }] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"compilerOptions": { | ||
"composite": true, | ||
"skipLibCheck": true, | ||
"module": "ESNext", | ||
"moduleResolution": "bundler", | ||
"allowSyntheticDefaultImports": true | ||
}, | ||
"include": ["vite.config.mts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/// <reference types="vite/client" /> | ||
|
||
interface ImportMetaEnv { | ||
readonly VITE_GOOGLE_API_KEY: string; | ||
// more env variables... | ||
} | ||
|
||
interface ImportMeta { | ||
readonly env: ImportMetaEnv; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.