none
Alternate of GetID and modeldata in BING MAP V7.0 RRS feed

  • Question

  • Hi,

    The below given code is for Bing Map V6.3


    var PolygonZone = new VEShape(VEShapeType.Polygon, pointsLocal);
                                PolygonZone.SetCustomIcon(
                                        "<span style='font-family:Times New Roman; font-size:8; font-weight:lighter;" +
                                         "color:Blue;text-align:center'>" + 'test' +
                                         "</span>");
                                PolygonZone.SetLineColor(new VEColor(255, 0, 0, 0.5));

                                PolygonZone.SetLineWidth(2);

                                PolygonZone.SetTitle('Test Image');

                                PolygonZone.ModelData ="11";

                                PolygonZone.HideIcon();

                                map.AddShape(PolygonZone);  ----map is the object of map

                                PolygonIDs.push(PolygonZone.GetID());  ----PolygonIDs is an array in JAVASCRIPT

    Any one can please tell me the correct way to deal with the following lines in BING MAP v 7.0

    [1]PolygonZone.ModelData

    [2]PolygonZone.GetID()

    If the question is not clear please let me know.

    Thanks


    Sharma M.

    Wednesday, August 27, 2014 12:28 PM

Answers

  • In V7 shapes don't get unique ID's. There really is no need for them. If you want to store an ID for a shape you can easily add a property to your shape and give it a value:

    PolygonZone.ID = 1;

    Then when ever you want the ID of this shape just do PolygonZone.ID.

    If you want to be able to search against all the shapes based on a property here is a blog post on how to do this: http://rbrundritt.wordpress.com/2012/04/02/get-entity-by-property-in-bing-maps-v7/

    As for ModelData, that is not a part of the documented Bing Maps V6.3 API. I suspect this is a custom property someone added to your shape like what I mentioned above.


    http://rbrundritt.wordpress.com

    • Proposed as answer by Ricky_Brundritt Wednesday, August 27, 2014 2:14 PM
    • Marked as answer by M_Sharma Wednesday, August 27, 2014 3:24 PM
    Wednesday, August 27, 2014 2:14 PM

All replies

  • In V7 shapes don't get unique ID's. There really is no need for them. If you want to store an ID for a shape you can easily add a property to your shape and give it a value:

    PolygonZone.ID = 1;

    Then when ever you want the ID of this shape just do PolygonZone.ID.

    If you want to be able to search against all the shapes based on a property here is a blog post on how to do this: http://rbrundritt.wordpress.com/2012/04/02/get-entity-by-property-in-bing-maps-v7/

    As for ModelData, that is not a part of the documented Bing Maps V6.3 API. I suspect this is a custom property someone added to your shape like what I mentioned above.


    http://rbrundritt.wordpress.com

    • Proposed as answer by Ricky_Brundritt Wednesday, August 27, 2014 2:14 PM
    • Marked as answer by M_Sharma Wednesday, August 27, 2014 3:24 PM
    Wednesday, August 27, 2014 2:14 PM
  • That's great and very easy.

    Thanks for your help !!


    Sharma M.

    Wednesday, August 27, 2014 3:24 PM