触摸在 HTC 上无法使用 bing 地图
我们在使用 HTC 手机和触摸地图控制时遇到问题。例如,这适用于 Samsung Focus 或 LG Optima。
在地图上,我们通过调用来显示“领土”:
MapPolygon shape = new MapPolygon(); shape.Locations = lb.Points; shape.StrokeThickness = 1; shape.Tag = lb; shape.Stroke = new SolidColorBrush(Colors.Black); shape.Fill = lb.ColorBrush; shape.Tag = lb; _touchTerritoryBehavior = new TouchBehavior(shape); _touchTerritoryBehavior.Tap += new EventHandler(_touchTerritoryBehavior_Tap); MyLayer.Children.Add(shape);
其中 TouchBehaviour 与 WP7 培训套件中的内容相同 MyLayer 只是地图 xaml 中的一个图层
<my:Map Name="myMap" CredentialsProvider="{Binding CredentialsProvider}" LogoVisibility="Collapsed"
ZoomLevel="{Binding Zoom, Mode=TwoWay}"
Center="{Binding Center, Mode=TwoWay}" AnimationLevel="None"
Height="680" Width="480" VerticalAlignment="Bottom" CopyrightVisibility="Collapsed" ViewChangeEnd="myMap_ViewChangeEnd" Margin="0,55,0,0">
<my:Map.Mode>
<my:RoadMode />
</my:Map.Mode>
<my:MapLayer Name="PinLayer">
</my:MapLayer>
<my:MapLayer x:Name="MyLayer">
<my:MapPolygon Locations="20,-20 20,20 -20,20 -20,-20" Opacity="0.7" />
</my:MapLayer>
那么为什么这在 HTC 手机上不起作用,但在其他 WP7 手机上却完美工作?
We are having an issue with HTC phones and touch on the map control. This works on the Samsung Focus or the LG Optima for example.
On the map we show "territories" by calling:
MapPolygon shape = new MapPolygon(); shape.Locations = lb.Points; shape.StrokeThickness = 1; shape.Tag = lb; shape.Stroke = new SolidColorBrush(Colors.Black); shape.Fill = lb.ColorBrush; shape.Tag = lb; _touchTerritoryBehavior = new TouchBehavior(shape); _touchTerritoryBehavior.Tap += new EventHandler(_touchTerritoryBehavior_Tap); MyLayer.Children.Add(shape);
Where the TouchBehaviour is the same as what's inside the WP7 Training Kit The MyLayer is simply a layer in the map xaml
<my:Map Name="myMap" CredentialsProvider="{Binding CredentialsProvider}" LogoVisibility="Collapsed"
ZoomLevel="{Binding Zoom, Mode=TwoWay}"
Center="{Binding Center, Mode=TwoWay}" AnimationLevel="None"
Height="680" Width="480" VerticalAlignment="Bottom" CopyrightVisibility="Collapsed" ViewChangeEnd="myMap_ViewChangeEnd" Margin="0,55,0,0">
<my:Map.Mode>
<my:RoadMode />
</my:Map.Mode>
<my:MapLayer Name="PinLayer">
</my:MapLayer>
<my:MapLayer x:Name="MyLayer">
<my:MapPolygon Locations="20,-20 20,20 -20,20 -20,-20" Opacity="0.7" />
</my:MapLayer>
So why would this not work on HTC Phones yet work perfectly on other WP7 phones?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论