Forum

VUE + google maps -...
 
Notifications
Clear all

VUE + google maps - problems with removing markers and polylines

1 Posty
1 Users
0 Reactions
786 Widok
0
Topic starter
  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 Answer
0
Topic starter

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";

Odpowiedź

Author Name

Author Email

Your question *

 
Preview 0 Revisions Saved
Share: