locked
Bing Map- to show the custom values on clicking on the map RRS feed

  • Question

  • hello all,

    I have some values stored in an two-dimensional array containing name and a polygon with some latitude values

    like

    var valuesAndLat={

    name:'xyz',

    lat:'polygon(some values)'

    }

    on clicking on the polygon can we get the name mentioned in the array

    can it be extended to multiple polygons also

    please help

    Monday, September 24, 2012 1:59 PM

Answers

  • Yes, when you create the polygon object you can add additional properties to it and store your information in that. Simply do something like this:

    var poly = new Microsoft.Maps.Polygon(....);

    poly.MyData = "";


    http://rbrundritt.wordpress.com

    Monday, September 24, 2012 3:48 PM
  • Simply add a click event to the polygons. http://msdn.microsoft.com/en-us/library/gg508988.aspx

    Also the MyData property is not predefined. In JavaScript you don't need to predefine properties. Just be sure to check if it exists before using.


    http://rbrundritt.wordpress.com


    Tuesday, September 25, 2012 10:34 AM

All replies

  • Yes, when you create the polygon object you can add additional properties to it and store your information in that. Simply do something like this:

    var poly = new Microsoft.Maps.Polygon(....);

    poly.MyData = "";


    http://rbrundritt.wordpress.com

    Monday, September 24, 2012 3:48 PM
  • MyData

    is it a predefined property?

    Tuesday, September 25, 2012 6:00 AM
  • ya able to get that
    but can we make the multipolygon on the Bing map clickable
    Tuesday, September 25, 2012 10:09 AM
  • Simply add a click event to the polygons. http://msdn.microsoft.com/en-us/library/gg508988.aspx

    Also the MyData property is not predefined. In JavaScript you don't need to predefine properties. Just be sure to check if it exists before using.


    http://rbrundritt.wordpress.com


    Tuesday, September 25, 2012 10:34 AM