I just wrote a blog post on this last week. You can find it here: http://www.bing.com/blogs/site_blogs/b/maps/archive/2014/01/23/make-clickable-shapes-in-the-native-bing-maps-control.aspx
Reference data when MapPolygon is clicked
-
04-10-2022 - |
문제
I plot a bunch of MapPolygons
and set a Tapped
listener for when one is clicked
polygon.Tapped += polygon_Tapped;
but when that gets called how do I know what one was tapped so I can display data associated with it?
For example in a Pushpin
I could set data in the .Tag
but that is not available for a polygon. I see that in the TappedRoutedEventArgs
there is an OriginalSource
object which would give me a reference to the object that raised the event but I still wont be able to associate data with that polygon.
the only thing I can think of is using a Dictionary
to keep a reference to the object and check if the object equals the object clicked in a loop.
any ideas?
해결책
제휴하지 않습니다 StackOverflow