Windows Phone 8.1 MapIcon Click event

最后都变了- 提交于 2019-12-24 11:34:35

问题


I'm writing a Windows Phone 8.1 app(Windows Runtime version), and I used the MapIcon class to place the icons on the map control. However, I hope these icons can react to the "click" event so that I could show more details after a user has clicked a specific icon. I googled and wasn't able to find an answer. Is it possible, or do I have to create my own class in order to achieve this goal(and how)?

It's my first time to develop the Windows Phone 8.1 app, so any suggestions are really appreciated. Thank you.


回答1:


Instead of MapIcon you can place any XAML element on the map. Check http://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn792121.aspx#showing_xaml_controls_and_shapes_on_the_map Since they are full blown XAML elements, you should be able to use Tapped event.

Also note that there is no guarantee that MapIcon objects will be displayed, they may be obscured by other elements.




回答2:


Just in case someone is looking for a solution for UWP apps: there is a new MapElementClick event handler now.



来源:https://stackoverflow.com/questions/25377526/windows-phone-8-1-mapicon-click-event

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!