Style editable square "balls"

Asked

Viewed 127 times

0

When drawing an editable square on the map, those "dots" appear in the corners, which are the clickable areas to resize the square.

function initMap() {

      var map = new google.maps.Map(document.getElementById('map'), {
        zoom: 10,
        center: {lat: 44.5452, lng: -78.5389},
        mapTypeId: google.maps.MapTypeId.TERRAIN
      });

    // [START region_rectangle]
      var bounds = {
        north: 44.599,
        south: 44.490,
        east: -78.443,
        west: -78.649
      };

      // Define a rectangle and set its editable property to true.
      var rectangle = new google.maps.Rectangle({
        bounds: bounds,
        editable: true
      });
    // [END region_rectangle]
      rectangle.setMap(map);
}
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}
#map {
  height: 100%;
}
<div id="map"></div>

<script async defer src="https://maps.googleapis.com/maps/api/js?callback=initMap"></script>

You can style those "little balls"?

  • Could you edit the question with a print about the "ball" you’re talking about? I ended up confusing it with the markers.

  • You can put up a print?

  • I edited the post, put the link

1 answer

1

Dude. I know you can style the area of the rectangle itself:

var bounds = {
    strokeColor: '#FF0000',
    strokeOpacity: 0.8,
    strokeWeight: 2,
    fillColor: '#FF0000',
    fillOpacity: 0.35,
    north: 44.599,
    south: 44.490,
    east: -78.443,
    west: -78.649
};

I took a look at the net and found this link that shows Corners in a different way: http://googlemaps.googlermania.com/google_maps_api_v3/en/poly_containsLocation.html

Maybe this will help you. =)

  • The screenshots of the indicated page were made with an older version of the API, so they are square.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.