I'm trying to change an existing circle radius on google maps API. I'm using jquery-location-picker but here is a light snippet of what I'm trying to do:
$('#map').locationpicker({
location: {
latitude: initLat,
longitude: initLon
},
radius: initRadius,
zoom: initZoom,
inputBinding: {
latitudeInput: $('#map-lat'),
longitudeInput: $('#map-lon'),
locationNameInput: $('#map-address'),
radiusInput: $('#map-radius')
},
onchanged: function (currentLocation, radius, isMarkerDropped) {
var mapContext = $('#map').locationpicker('map');
mapContext.marker.setVisible(true);
mapContext.map.setZoom(13);
//CHANGE RADIUS HERE
mapContext.circle.setRadius(###);
},
enableAutocomplete: true,
addressFormat: 'street_address',
autocompleteOptions: {
componentRestrictions: { country: 'us' }
}
});
Everything else in the onchanged event works correctly and I've tried various things found here without success.