Does Google Maps API incorrectly interpret -90 and 90 lat?

25 Views Asked by At

I try to circumscribe the whole map in a rectangle but the points shift up and down too much! How do I deal with it?

    const map = new google.maps.Map(document.getElementById("map"), { zoom: 5, center: { lat: 24.886, lng: -70.268 }, mapTypeId: "terrain" });
    const rectCoordinates = [
        { lat: 90, lng: -180 }, { lat: 90, lng: 180 }, { lat: -90, lng: 180 }, { lat: -90, lng: -180 },
    ];
    const rect = new google.maps.Polygon({
        paths: rectCoordinates,
        strokeColor: "#FF0000",
        strokeOpacity: 0.8,
        strokeWeight: 2
    });
    rect.setMap(map);

enter image description here

0

There are 0 best solutions below