Hi Chandan, You mention that the fitbounds(...) worked for " particular radius change", and I presume you mean that it worked only sometimes, and not always. My guess is that it only worked when that radius was INCREASED, thus necessitating a zoom out. If I'm right, then the trick is to always do the following:
// ...user changes radius... var bounds = circle.getbounds(); // Set zoom to max possible map.setZoom(20); // 19 or 20 or get the maxZoom property of your MapOptions map.fitBounds(bounds); map.panToBounds(bounds); This is because the API, for some reason, can't zoom in when fitting bounds, but can only zoom out. So, zoom to max, then do your fitBounds, etc., which will (should!) then bring you to the correct zoom level for the new circle radius. HTH, Rob On Saturday, 10 June 2017 06:02:16 UTC+2, Chandan wrote: > > Hi, > I need to zoom in when radius is reduced and zoom out when radius is > increased in editable circles using Google maps API. > > I used map.fitbounds(circle.getbounds()) but this worked for particular > radius change. But I need to zoom in and out for every radius change. > For example: radius is 200km, when radius reduced - zoom in and when > radius increased - zoom out > -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-maps-js-api-v3+unsubscr...@googlegroups.com. To post to this group, send email to google-maps-js-api-v3@googlegroups.com. Visit this group at https://groups.google.com/group/google-maps-js-api-v3. For more options, visit https://groups.google.com/d/optout.