Polygon pop up label on mouseover RRS feed

  • Question

  • I frequently use the polygon feature in V8 of map to create polygons that represent counties in that state. Is there an easy way for a mouseover event to show the county name label?  Then for the label to disappear when mouse moves away from that polygon?
    Saturday, July 16, 2016 8:23 PM


All replies

  • We have an code sample of how to do this in the documentation here: https://msdn.microsoft.com/en-us/library/mt750273.aspx

    It uses a click event, simply change this to mouseover if you want it to display then. You can then add a second mouseout event to hide the infobox when the mouse leaves the polygon. If you want to have an expanding type infobox when clicked, take a look at this code sample: https://msdn.microsoft.com/en-us/library/mt750275.aspx

    [Blog] [twitter] [LinkedIn]

    Saturday, July 16, 2016 9:36 PM
  • Ricky,

    I tried a few ways but I haven't gotten it to work yet--I will keep at it.

    But since this tool is still evolving (now v8) maybe you could add a property like 'ToolTip' to each polygon.  I used some mapping programs five or six years ago and they had a ToolTip property where I could assign something to each polygon, such as county name.  It made it easy for mouseover popups.

    Thanks, David

    Sunday, July 17, 2016 9:10 PM