bjorn2404 / jQuery-Store-Locator-Plugin

A store locator plugin using Google Maps API version 3
MIT License
493 stars 235 forks source link

Access map object in callback #257

Open amirkhan81 opened 5 years ago

amirkhan81 commented 5 years ago

I might be dense, but I'm trying to access the map object in a callback function with the hope of adding a circle around certain markers by category. As a PoC I've tried this but seems to do nothing. Any thoughts?

callbackMapSet: function(map, originPoint, originalZoom, myOptions) { console.log('amir map ', map); // Add circle overlay and bind to marker

        function initMap() {
            var circle = new google.maps.Circle({
            center: {
                lat: 44.878,
                lng: -77.629
              },
            radius: 300,
            strokeColor: "#E16D65",
            strokeOpacity: 1,
            strokeWeight: 3,
            fillColor: "#E16D65",
            fillOpacity: 1
        });
        circle.setMap(map);

        console.log(circle.get() + 'amir')
        };

    },