说我有3个图钉:(1)加利福尼亚,(2)佛罗里达,(3)纽约.为了使其中的所有3个都可见,我必须缩小到足以看到整个国家.但是说,而不是我(1)加利福尼亚州,(2)内华达州,(3)德克萨斯州.我必须缩小才能覆盖美国的西南角.Windows Phone 7 API的bing映射中是否有任何功能可以帮助我解决这个问题.基本上,我想缩小到足以看到一组位置.
谢谢!
当我拖动或缩放时,我的bing地图应用程序最终会崩溃.在模拟器和设备上测试.
我已经安装了十月更新.
MapItemsControl绑定到ObservableCollection.应用程序启动时,引脚已加载并可见.
在排除故障时,我确定如果地图上的图钉位于相同的一般区域,应用程序不会崩溃.例,
addPin("40.78184126814031", "-73.97712707519532");
addPin("40.74569634433956", "-73.96717071533204");
addPin("40.7117682299881", "-74.0125322341919");
addPin("40.75777392583087", "-73.96950960159302");
Run Code Online (Sandbox Code Playgroud)
但如果引脚展开 - 应用程序在用户放大一个特定引脚和/或拖动地图时崩溃.例,
addPin("42.35960626034072", "-71.09212160110473");
addPin("51.388066116760086", "30.098590850830067");
addPin("48.17972265679143", "11.54910385608672");
addPin("40.28802528051879", "-76.65668606758117");
Run Code Online (Sandbox Code Playgroud)
不确定项目代码是否必要 - 我假设有一些我不知道的概念.
任何建议 - 我都是耳朵.下面的堆栈跟踪.
谢谢
Unspecified error
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.UIElement_HitTestPoint(UIElement element, Point ptHit)
at System.Windows.UIElement.HitTest(Point point)
at System.Windows.Media.VisualTreeHelper.FindElementsInHostCoordinates(Point intersectingPoint, UIElement subtree)
at Microsoft.Phone.Controls.Maps.Core.TouchHelper.<InputHitTest>d__0.MoveNext()
at Microsoft.Phone.Controls.Maps.Core.TouchHelper.HitTestAndRaiseDownEvent(UIElement root, TouchPoint touchPoint)
at Microsoft.Phone.Controls.Maps.Core.TouchHelper.TouchFrameReported(Object sender, TouchFrameEventArgs e)
at System.Windows.Input.Touch.OnTouch(Object sender, TouchFrameEventArgs e)
at MS.Internal.JoltHelper.RaiseEvent(IntPtr target, UInt32 eventId, IntPtr coreEventArgs, UInt32 eventArgsTypeIndex)
Run Code Online (Sandbox Code Playgroud)
最好包括代码 - 运行此代码并放大崩溃应用程序 - 谢谢
PINDATA课程 …
有谁知道Bing Maps Silverlight控件的默认控件模板和XAML样式是否可用?我们喜欢默认的Pushpin控件的一般外观,但希望它们有多种颜色,而不仅仅是默认的橙色.似乎唯一容易或直接的方法是在我们的App.xaml中提供基于默认值的新ControlTemplate - 每种颜色一个.
没问题,除了我无法识别现有的默认控件模板.大多数核心Silverlight工具包控件都在MSDN上提供了默认样式,但我还没有找到Bing Maps API的样式.
谢谢,
杰夫
你好,我想在地图上的单独图层上生成多个图钉位置.那些PushPins应代表这个坐标的位置.因此,一旦用户点击/触摸图钉,它们应该显示一些应该是可见的附加信息.
整个解决方案仅基于代码(添加图钉).
我已经在sa了,我应该在图钉后面放一个看不见的按钮 - 但我不太确定我应该怎么做.
如果有人有提示会让我前进,那就太好了!
谢谢
<DataTemplate x:Key="PushpinControlTemplate2">
<Grid x:Name="ContentGrid">
<StackPanel Orientation="Vertical">
<Grid Background="{TemplateBinding Background}"
HorizontalAlignment="Left"
MinHeight="10"
MinWidth="29">
<Hyperlinkbutton HorizontalAlignment="Center" Content="{binding}" Click="clicker" Margin="0"/>
</Grid>
<Polygon Fill="{TemplateBinding Background}"
Points="0,0 29,0 0,29"
Width="29"
Height="29"
HorizontalAlignment="Left"/>
</StackPanel>
</Grid>
</DataTemplate>
Run Code Online (Sandbox Code Playgroud)
这是我到目前为止使用的代码,函数clicker已定义,但我总是错误'AG_E_PARSER_BAD_PROPERTY_VALUE [Line:5 Position:98]'
如何让它将用户控件置于图钉位置的中心位置,而不是在图钉图标的内部和相对位置?
我尝试对齐底部并给控件留出余量.
谢谢,
我是将一些图钉绑定到MapLayer的数据.它们显示正常,但是当我使用relay命令从鼠标leftbuttonUp传递eventargs时,对象源是一个elipse.我在MapPolygon上使用了这个方法,并从对象中获取了我想要的信息.
因为我是mvvm的新手,也许我正在接受这一点,所以请让我知道!
这适用于我的MapPolygons(vm引用我的extendedMapPolygon类的命名空间)
<DataTemplate x:Name="polyTemplate">
<vm:extendedMapPolygon cName="{Binding _cName}" Locations="{Binding _Locations}" />
</DataTemplate>
Run Code Online (Sandbox Code Playgroud)
这是MapLayer中的XAML
<m:MapItemsControl ItemTemplate="{StaticResource polyTemplate}" ItemsSource="{Binding Path=_PolyforDisplay, Mode=TwoWay}" >
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonUp">
<cmd:EventToCommand Command="{Binding Path=PolySelCommand}" PassEventArgsToCommand="True" ></cmd:EventToCommand>
</i:EventTrigger>
</i:Interaction.Triggers>
</m:MapItemsControl>
Run Code Online (Sandbox Code Playgroud)
在我的viewModel构造函数中
PolySelCommand = new RelayCommand<MouseButtonEventArgs>(PolySelCommandExecute);
Run Code Online (Sandbox Code Playgroud)
最后是实际的命令
public RelayCommand<MouseButtonEventArgs> PolySelCommand { get; set; }
private void PolySelCommandExecute(MouseButtonEventArgs cmp)
{
Polygon poly = cmp.OriginalSource as Polygon;
extendedMapPolygon ePoly = poly.Parent as extendedMapPolygon;
_MapPolygonSelected = ePoly.cName;
}
Run Code Online (Sandbox Code Playgroud)
(我把它放在这里,以显示我目前使用的方法,并希望它可能对其他人有用!)
然而,当我用Pushpin尝试相同的东西时,cmp.OriginalSource是一个椭圆,我似乎无法得到任何其他东西.
我的Pushpin代码(我只是在这段代码中使用MapControl中的Pushpins)
<DataTemplate x:Name="ppTemplate">
<m:Pushpin ToolTipService.ToolTip="{Binding _psName}" Location="{Binding _Location}" />
</DataTemplate>
<m:MapItemsControl ItemTemplate="{StaticResource ppTemplate}" …Run Code Online (Sandbox Code Playgroud) 我有一个用于Windows Phone 7的Bing silverlight地图控件.我正在尝试显示当前选定的图钉.这是片段:
<my:Map x:Name="map" Canvas.ZIndex="1" CredentialsProvider="{StaticResource Credentials}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
CopyrightVisibility="Collapsed" LogoVisibility="Collapsed">
<my:MapItemsControl x:Name="Pushpins">
<my:MapItemsControl.ItemTemplate >
<DataTemplate>
<my:Pushpin Location="{Binding Location}" Canvas.ZIndex="{Binding Zindex}" PositionOrigin="0.515625,0.859375" Content="{Binding Id}" Template="{StaticResource PushpinControlTemplate}" Tap="Pushpin_Tap"/>
</DataTemplate>
</my:MapItemsControl.ItemTemplate>
</my:MapItemsControl>
</my:Map>
Run Code Online (Sandbox Code Playgroud)
该控件忽略了ZIndex.我错过了什么或不支持ZIndex.ZIndex是实现INotifyPropertyChanged的类的属性
private int _zIndex;
public int Zindex
{
get { return _zIndex; }
set
{
_zIndex = value;
OnPropertyChanged(new PropertyChangedEventArgs("Zindex"));
}
}
Run Code Online (Sandbox Code Playgroud) 标题解释得很好.
我正在使用"Bing Maps AJAX Control,7.0版".我成功禁用鼠标滚轮放大和缩小地图.但是,如果我将鼠标悬停在地图上的标记(图钉)上,它仍然会放大和缩小.
下面是我用来禁用鼠标滚轮的代码:
Microsoft.Maps.Events.addHandler(map, 'mousewheel', function(e) {
if(e.targetType == 'map') {
e.handled = true;
}
});
Run Code Online (Sandbox Code Playgroud) 我有一个带有选项卡控件的网页,它占据了屏幕的一部分。这些选项卡使用* ngIf显示/隐藏,并将所选选项卡与枚举进行比较。因此,每当用户更改选项卡时,便会破坏/创建组件。
通常这很好,但是其中一个选项卡包含一个必应地图。每次选择该标签时,都会重新加载地图控件-使地图短暂显示当前IP位置,直到加载了所需的位置和引脚(不到一秒钟的时间)。
我能够解决这个问题的唯一方法是停止为该选项卡使用* ngIf,而是设置自定义样式:
.hide {高度:0像素;溢出:隐藏;}
到目前为止,这似乎很有效,但是我担心这会在将来引起错误。
有angular2祝福的方式隐藏组件而不破坏组件吗?
谢谢。
bing-maps ×10
pushpin ×3
silverlight ×3
ajax ×1
angular ×1
c# ×1
javascript ×1
mvvm-light ×1
wpf ×1
xaml ×1