SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

creating hotspots in sharp# form

Last post 03-16-2007 3:42 AM by Albatross. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 02-22-2007 4:05 PM

    creating hotspots in sharp# form

    hi.

    i would like to know whether is it possible to display a map on a form and create hotspots base on the countries?

     

  • 02-22-2007 6:30 PM In reply to

    Re: creating hotspots in sharp# form

    One way would be to color each country differently, then check the color under the mouse during the click event (use the x/y position of the mouse click or mouse hover event, and scale it to the map size).

    Alternatively, you could have two maps - the one displayed which may show outlines but not different colors, and a second map that is colored accordingly. Using the same technique as above, use the mouse position to determine the coordinates on the map, and check the color for that pixel.

    This should be a lot simpler than programmatically calculating the country at a given point on the map. Note that if you use a geolocation service to pinpoint the country at a given lat/lon coordinate, you will need to compensate for the fact that maps are rectangular, but Earth (unless you're a VERY conservative Christian!) is almost a sphere. A Google search should point you in the direction of the trig formulas to convert x/y coordinates to lat/lon. I know I've done it for a RentACoder mapping project, so I can look 'em up if you'd like.

    I hope that helps a little! 

  • 03-16-2007 3:42 AM In reply to

    Re: creating hotspots in sharp# form

    I guess you can also use transparent labels on target locations, with no text, and use mousehover or mouseenter or mouseexit or something like that.

     

    Chiario 

Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.