Maps for UWP
XAML クイックリファレンス

このトピックでは、さまざまな C1Maps タスクの実行に使用される XAML の概要を提供します。

項目テンプレート

次の例は、マップ項目テンプレートを使用する方法を示します。

XAML マークアップ
コードのコピー
 <C1:C1Maps x:Name="C1Maps1" FadeInTiles="False" Margin="0,0,235,8" TargetCenter="-65,
        -25" Center="-58,-25" Zoom="2" Foreground="Aqua" Xaml:C1NagScreen.Nag="True">
           <C1:C1Maps.Resources>
             <!-- 項目テンプレート -->
                <DataTemplate x:Key="templPts">
                     <C1:C1VectorPlacemark GeoPoint="{Binding Path=LongLat}" Fill="Aqua" 
                       Stroke="Aqua" Label="{Binding Path=Name}" LabelPosition="Top" >
                       <C1:C1VectorPlacemark.Geometry>
                     <EllipseGeometry RadiusX="2" RadiusY="2" />
                  </C1:C1VectorPlacemark.Geometry>
               </C1:C1VectorPlacemark>
            </DataTemplate>
         </C1:C1Maps.Resources>
        <C1:C1VectorLayer ItemsSource="{Binding}" ItemTemplate="{StaticResource templPts}"
      HorizontalAlignment="Right" Width="403" />
 </C1:C1Maps>

ベクターレイヤラベル

次の例は、ベクターレイヤを使用してラベルを作成する方法を示します。

XAML マークアップ
コードのコピー
<C1:C1VectorLayer>
<C1:C1VectorPlacemark LabelPosition="Left" GeoPoint="-80.107008,42.16389" 
StrokeThickness="2" Foreground="#FFEB1212" PinPoint="-80.010866,42.156831"
Label="Erie, PA"/>
</C1:C1VectorLayer>
ベクターレイヤ- 折れ線
次の例は、ベクターレイヤを使用して、折れ線(開いた線)を作成する方法を示します。
<C1:C1VectorLayer Margin="2,0,-2,0">
<C1:C1VectorPolyline Points="-80.15,42.12 -123.08,39.09, -3.90,30.85" 
StrokeThickness="3" Stroke="Red">
</C1:C1VectorPolyline>
</C1:C1VectorLayer>
ベクターレイヤ- 多角形
次の例は、ベクターレイヤを使用して、折れ線(形状を成す線)を作成する方法を示します。
<C1:C1VectorLayer Margin="2,0,-2,0">
<C1:C1VectorPolygon Points="-80.15,42.12 -123.08,39.09, -3.90,30.85" 
StrokeThickness="3" Stroke="Red">
</C1:C1VectorPolygon>
</C1:C1VectorLayer>