2017-08-31 7 views
0

を使用してのMapControlを表示することができませんC#が、私は以下のような制御フォルダ持ちのBing地図

MapControl.MapServiceToken = "MyMapToken"; 
         ListingClass listing = new ListingClass(); 
         listing.Latitude = Double.Parse("-7.78183620", CultureInfo.InvariantCulture); 
         listing.Longitude = Double.Parse("110.40856360", CultureInfo.InvariantCulture); 

         // Specify a known location. 
         BasicGeoposition snPosition = new BasicGeoposition() { Latitude = listing.Latitude, Longitude = listing.Longitude }; 
         Geopoint snPoint = new Geopoint(snPosition); 

         // Create a MapIcon. 
         MapIcon mapIcon1 = new MapIcon(); 
         mapIcon1.Image = 
          RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///images/map-pin-red-md1.png")); 
         mapIcon1.Location = snPoint; 
         mapIcon1.NormalizedAnchorPoint = new Point(0.5, 1.0); 
         mapIcon1.Title = pageTitle.Text; 
         mapIcon1.ZIndex = 0; 

         // Add the MapIcon to the map. 
         MapControl.MapElements.Add(mapIcon1); 

         // Center the map over the POI. 
         MapControl.Center = snPoint; 
         MapControl.ZoomLevel = 14; 
         MapControl.LandmarksVisible = true; 

私は悩みを抱えているが、つまりは(フォルダを表示することができません白いページのみ)。どのようにそれを処理するには?

ビッグマップを使用できるアプリケーションの数には制限がありますか?無料のビング開発者ライセンスをお求めですか? 前のアプリケーションでは、ビン・マップを表示できます(アプリケーションの名前に応じて別のキーを使用します)。

答えて

0

問題が発生しています。つまり、フォルダを表示できません(ホワイトページのみ)。どのようにそれを処理するには?

MapControlがデフォルトWidthHeight、お勧めの方法は、それが親コンテナをフィットさせるために任意のプロパティ(例えば、HeightMarginなど)を設定することではありません必要はありませんように思えます。地図が表示されます。たとえば、グリッドの1行目にあるあなたのマップは、あなただけのようなマップを定義することができ、次のとおりです。Heightを設定せずとWidthマップは親切に異なるUWPデバイスを適応することができますので、

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> 
    <Grid.RowDefinitions> 
    <RowDefinition Height="*"/> 
    <RowDefinition Height="*"/> 
    <RowDefinition Height="*"/> 
    </Grid.RowDefinitions> 
    <Grid.ColumnDefinitions> 
     <ColumnDefinition Width="*"/> 
     <ColumnDefinition Width="*"/> 
     <ColumnDefinition Width="*"/> 
    </Grid.ColumnDefinitions> 
    <maps:MapControl x:Name="MapControl" Grid.Row="1" Grid.ColumnSpan="2" BorderBrush="Black" BorderThickness="1"/> 
</Grid> 

をお勧めしない理由があります。 heightプロパティを設定する場合は、マップを表示するには、widthプロパティまたはHorizontalAlignment="Stretch"プロパティの幅を指定する必要があります。たとえば:

<maps:MapControl x:Name="MapControl" Height="200" HorizontalAlignment="Stretch" BorderBrush="Black" BorderThickness="1" Grid.Row="1" Grid.ColumnSpan="2"/> 
<maps:MapControl x:Name="MapControl" Height="200" Width="200" BorderBrush="Black" BorderThickness="1"Grid.Row="1" Grid.ColumnSpan="2" /> 

私は自由ビングの開発者ライセンスをお願いしたい、大きな地図を使用できるアプリケーションの数に制限はありますか?

アプリケーションごとに異なるキーを使用している場合は、アプリケーションの数に制限はありません。しかし、これらのキーを使用している場合は、請求可能なAPIを満たしている可能性があります。

関連する問題