[Vuejs]-Resizing a programatically loaded rectangle with DrawingManager

0👍

OK I found what the problem was myself. It’s not a bug in the library, just a bug in the example data.

The loaded figure should have the coordinates listed in reverse order. This works just fine with the library.

enter image description here

0👍

GeoJSON doesn’t have a native rectangle object. If you are passing in a polygon that is a rectangle in shape, it will be treated as a polygon (what appears to be happening here).

If you know the polygon is a rectangle shape, you make use of the extended GeoJSON specification in Azure Maps and add the subType property to your polygon to let the drawing manager know it is a rectangle.

For example:

{
    "type": "Feature",
    "properties": {
        "subType": "Rectangle"
    },
    "geometry": {
        "type": "Polygon",
        "coordinates": [
            [[-122.35568,47.612875],[-122.28444,47.612875],[-122.28444,47.58046],[-122.35568,47.58046],[-122.35568,47.6128758]
            ]
        ]
    }
}

Leave a comment