2017-03-10 16 views
1

Telerik RadMapとVisualisationLayerを使用してマップ上に郵便番号の形状を表示しています。この時点までは Telerik MapPinPointの位置を正しく設定できません

<telerik:VisualizationLayer ItemsSource="{Binding MapItemCollection}" x:Name="VisualizationLayer"> 
    <telerik:VisualizationLayer.ItemTemplate> 
     <DataTemplate> 
      <telerik:MapPolygonView telerik:MapLayer.Location="{Binding MapItemLocation}" Points="{Binding MapItemPoints}" local:MapUtility.ShapeColor="{Binding MapItemColor}"/> 
     </DataTemplate> 
    </telerik:VisualizationLayer.ItemTemplate> 
</telerik:VisualizationLayer> 

は、すべてがうまく出て動作しますが、 - 私は、この形状の中央にタイトルとして、この形状Telerik.MapPinPointを与えることをしようとしたとき。 PinPointの位置は、郵便番号の図形の位置によって上書きされ、図形の中心ではなく図形の端に配置されます。今

Telerik Map Sample

<telerik:VisualizationLayer ItemsSource="{Binding MapItemCollection}" x:Name="VisualizationLayer"> 
    <telerik:VisualizationLayer.ItemTemplate> 
     <DataTemplate> 
      <telerik:MapPolygonView telerik:MapLayer.Location="{Binding MapItemLocation}" Points="{Binding MapItemPoints}" local:MapUtility.ShapeColor="{Binding MapItemColor}"/> 
     </DataTemplate> 
    </telerik:VisualizationLayer.ItemTemplate> 
</telerik:VisualizationLayer> 

<telerik:VisualizationLayer ItemsSource="{Binding MapItemCollection}" x:Name="Layer"> 
    <telerik:VisualizationLayer.ItemTemplate> 
     <DataTemplate> 
      <telerik:MapPinPoint telerik:MapLayer.Location="{Binding PinPointLocation}" 
       Background="#80808080" 
       Foreground="White" 
       BorderBrush="Black" 
       BorderThickness="1" 
       Text="{Binding PinPointText}"/> 
      </DataTemplate> 
    </telerik:VisualizationLayer.ItemTemplate> 
</telerik:VisualizationLayer> 

マイ修正ピンポイントのためMapItemクラスの別のインスタンスを取得し、Location.Emptyに、このインスタンスのMapItemLocationを設定することです。私はこれを行うとうまくいくが、1つの図形と郵便番号をすべて1つのインスタンスにまとめて考えることにしたい。

答えて

1

私はTelerik Supportの回答を得ました。私はまた、私の問題の解決策を求めました。

解決策は、UseDefaultPropertyAccessorをfalseに設定することです。

<telerik:VisualizationLayer ItemsSource="{Binding MapItemCollection}" x:Name="Layer" UseDefaultPropertyAccessor="False"> 
<telerik:VisualizationLayer.ItemTemplate> 
    <DataTemplate> 
     <telerik:MapPinPoint telerik:MapLayer.Location="{Binding PinPointLocation}" 
       Background="#80808080" 
       Foreground="White" 
       BorderBrush="Black" 
       BorderThickness="1" 
       Text="{Binding PinPointText}"/> 
    </DataTemplate> 
</telerik:VisualizationLayer.ItemTemplate> 

これは、問題を修正し、期待どおりに機能するようになりました。 enter image description here

関連する問題