Forum

VUE + google maps -...
 
Powiadomienia
Wyczyść wszystko

VUE + google maps - problems with removing markers and polylines

1 Wpisy
1 Użytkownicy
0 Reactions
937 Widoki
0
Rozpoczynający temat
  1. setMap(null) not removing any makers or lines using vue
  2. setMap(null) on polyline does not remove it from map until zoom change
1 odpowiedź
0
Rozpoczynający temat

1. do not define any markers or polylines inside data { } 

2. define variables inside setup { } and remove reactivity (do not use ref(var)). Example below.

    setup() {
        let marker = null;
        let gmap = null;
        let currentPolygon = null;
        return {
            marker, gmap, currentPolygon
        }
    },

 

problem with reactivity has been confirmed with

import {Loader} from "@googlemaps/js-api-loader";

Twoja odpowiedź

Nazwa autora

E-mail autora

Twoje zapytanie *

 
Podgląd 0 rewizje Zapisano
Udostępnij: