Try a different order:
east: 34.990,
west: 34.883,
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
This is my java file:
and i tried to add the rectangle but the result is a long endless rectangle to the west and east and what i wanted to do is to add a small rectangle to the current lat and lng.
i tried to do it like this example : https://developers.google.com/maps/documentation/javascript/examples/rectangle-simple#maps_rectangle_simple-javascript
the result is :
function initMap() {
// The location of Uluru
const uluru = { lat: 32.1582615544072, lng: 34.89155037133181 };
// The map, centered at Uluru
const map = new google.maps.Map(document.getElementById("map"), {
zoom: 11,
center: uluru,
disableDefaultUI: true,
});
const rectangle = new google.maps.Rectangle({
strokeColor: "#FF0000",
strokeOpacity: 0.8,
strokeWeight: 2,
fillColor: "#FF0000",
fillOpacity: 0.35,
map,
bounds: {
north: 32.165,
south: 32.151,
east: 34.883,
west: 34.990,
},
});
}
window.initMap = initMap;
Try a different order:
east: 34.990,
west: 34.883,