2016-06-11 18 views
-1

私はビン地図に問題があります。私はカスタムピン(画像)をマップに配置したいのですが、ピンのすべてがほんの少ししか表示されません。ピンがBingマップ、カスタムピンが消えて

を消失するズームこれは私のコードです:

foreach (Stores store in boltok) 
     { 
      var myPosition = new Windows.Devices.Geolocation.BasicGeoposition(); 
      myPosition.Latitude = store.Latitude; 
      myPosition.Longitude = store.Longitude; 
      var myStorePoint = new Windows.Devices.Geolocation.Geopoint(myPosition); 
      MapIcon icon = new MapIcon(); 
      icon.Location = new Geopoint(new BasicGeoposition() 
      { 
       Latitude = store.Latitude, 
       Longitude = store.Longitude 
      }); 
      icon.Visible = true; 
      icon.ZIndex = 0; 
      icon.Image = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/StoreFinder/Pin.png")); 
      icon.NormalizedAnchorPoint = new Point(0.5, 1.0); 

      myMapControl.MapElements.Add(icon); 
      myMapControl.Children.Add(icon); 

     } 

私を助けてください!

答えて

0

MapIconを使用する場合は、MapElementsプロパティにのみ追加し、childrenプロパティには追加しないでください。 MapIconは、いくつかの衝突検出機能を備えて設計されており、束が重なり合っているときは非表示になります。ズームインすると再び表示されます。これを必要としない場合は、プッシュピンとして使用するUserControlを作成し、Childrenのプロパティマップに追加します。このドキュメントの「マップコントロールのXAML要素を表示する」セクションをご覧ください。https://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn792121.aspx

関連する問題