Search code examples
javascriptvue.jsazure-maps

Resizing a programatically loaded rectangle with DrawingManager


I'm implementing a web app using Azure Maps with the DrawingManager library. I want to give my end users option to save a drawn rectangle and possibly edit it by resizing later. This should be possible given that resizing rectangles work perfectly fine straight after you add them.

There seems to be some issue around this when you add the shape programatically and the rectangle becomes.. a weird shape. You can reproduce this issue even with the online published example: https://samples.azuremaps.com/drawing-tools-module/load-data-into-drawing-manager when you try to resize a rectangle.

example of the weirdly resized rectangle

Maybe someone also came across this issue and found a solution or a workaround?


Solution

  • 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