@@ -105,6 +105,7 @@ const props = withDefaults(defineProps<{
105
105
trigger: [' mouseenter' , ' mouseover' , ' mousedown' ],
106
106
width: 640 ,
107
107
height: 400 ,
108
+ centerMarker: true
108
109
})
109
110
110
111
const emits = defineEmits <{
@@ -306,7 +307,7 @@ onMounted(() => {
306
307
// do a diff of next and prev
307
308
const centerHash = hash ({ position: options .value .center })
308
309
for (const key of toRemove ) {
309
- if (key === centerHash ) {
310
+ if (props . centerMarker && key === centerHash ) {
310
311
continue
311
312
}
312
313
const marker = await mapMarkers .value .get (key )
@@ -335,7 +336,7 @@ onMounted(() => {
335
336
center = await resolveQueryToLatLang (center as string )
336
337
}
337
338
map .value ! .setCenter (center as google .maps .LatLng )
338
- if (typeof props . centerMarker === ' undefined ' || props .centerMarker ) {
339
+ if (props .centerMarker ) {
339
340
if (options .value .mapId ) {
340
341
// not allowed to use advanced markers with styles
341
342
return
@@ -418,7 +419,7 @@ const placeholder = computed(() => {
418
419
style: props .mapOptions ?.styles ? transformMapStyles (props .mapOptions .styles ) : undefined ,
419
420
markers: [
420
421
... (props .markers || []),
421
- ( typeof props .centerMarker === ' undefined ' || props . centerMarker ) && center ,
422
+ props .centerMarker && center ,
422
423
]
423
424
.filter (Boolean )
424
425
.map ((m ) => {
0 commit comments