Monday, August 31, 2015

google maps javascript api v3 -- create Radius from center position --

            var image = 'aircraftsmall.png';
            var marker = new google.maps.Marker // Set the marker
            ({
                position: new google.maps.LatLng(lat, lng),
                icon: image, //use our image as the marker
                map: map, // assign the marker to our map variable
                title: 'LPN-01' // Marker ALT Text
            });
            circle = new google.maps.Circle
            ({
                fillColor: '#00f',
                fillOpacity: 0.1,
                strokeColor: '#00f',
                strokeOpacity: 0.1,
                strokeweight:1
            });
            circle.bindTo('center', marker, 'position');
            circle.setRadius(150);
            circle.setMap(map);

No comments:

Post a Comment