Map radius from seed point

Draw radius from a seed point for streetviewhub.com

by actuallyakash

HTML

<div id="map"></div>
<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCkUOdZ5y7hMm0yrcCQoCvLwzdM6M8s5qk&callback=initMap">
</script>

CSS

#map {
  height: 100%;
}
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

JavaScript

// Draw radius from a seed point
var coords = [48.859953, 2.292047];
var center = {
  lat: coords[0],
  lng: coords[1]
};
var radius = 1000;
var zoom = 15;

function initMap() {
  // Create the map.
  var map = new google.maps.Map(document.getElementById('map'), {
    center: center,
    zoom: zoom,
    gestureHandling: 'greedy'
  });
  
  var marker = new google.maps.Marker({
    position: center,
    map: map
  });

  // Construct the circle
  var cityCircle = new google.maps.Circle({
    strokeColor: '#FF0000',
    strokeOpacity: 0.8,
    strokeWeight: 2,
    fillColor: '#FF0000',
    fillOpacity: 0.35,
    map: map,
    center: center,
    radius: radius
  });
}