Getting Polygon Shapes from Drawing manager RRS feed

  • Question

  • I am pretty new to mapping in general.

    I put together a mapping application that layers property tax data and real estate data on 2 layers on a bing map. It draws the polygon shapes for the parcels. All that works great.

    Using the drawing manager tools, I want the user to be able to draw some polygons on the map and "export" some of this data. Essentially, I want to get an array of polygons and pass them via Ajax to my back end controller and query SQL and return only parcel data that is within those shapes.

    I have all that back end stuff working. I am confused on the object type IPrimitive[]. How can I iterate over this object and get the polygon geometry values. I would like to have an array of Polygon Strings.

    I think I am over thinking this a bit :)

    Here is all the further I got:

    function getShapes() {
        var shapes = drawingManager.getPrimitives();

        if (shapes && shapes.length > 0) {
    //I would like this to be converted into an array of polygon strings and not primitives.

            return shapes;
        } else {
            return null;

    Monday, November 14, 2016 3:21 PM