2016-07-26 12 views
0

뒤에 C# 코드에 ItemSource로 TextBlock이 같은 일부 컨트롤을 추가하고 내 XAML은 다음과 같이이다 :내가는 ArcGIS Windows 런타임 Esri는 프로젝트가

<esri:MapView x:Name="MyMapView"> 

<esri:MapView.Overlays> 
    <esri:OverlayItemsControl> 
      <Grid MaxWidth="350"> 
       <TextBlock Text="Details" FontWeight="Bold" Margin="0,0,0,4" /> 
      </Grid> 
     </Border> 
    </esri:OverlayItemsControl> 
</esri:MapView.Overlays> 

</esri:MapView> 

나는이 OverlaysOverlayItemsControl 코드 뒤에보다는 XAML에서 추가 할 .

MapView mapView = new MapView(); 
mapView.Overlays.ItemsSource = new List<object> { new TextBlock() { Text = "Details", Name = "overLay" } }; 
mapView.Overlays.Items.Clear(); 
mapView.Overlays.Items.Add(MyMapView.Overlays.ItemsSource); 

를하지만 오류가 있습니다 :

것은 내가 뒤에 C# 코드에서이 같은 somethig에 시도했다. 나는 정확히 무엇이 잘못되었는지를 모른다.

그 컨트롤을 추가하는 방법 Overlays, Grid, Textblock 그 뒤의 코드는 Esri MapView입니까?

답변

0

는 내가 코드를 통해 지정된 맵 포인트 (MP)에 텍스트 상자를 그리기 오전 :

TextBox tbMsg = new TextBox(); 
tbMsg.Width = 250; 
tbMsg.Height = 200; 
tbMsg.Text = "Your Message"; 

tbMsg.GotFocus += Tb_GotFocus; 
tbMsg.Visibility = Visibility.Visible; 


Esri.ArcGISRuntime.Controls.MapView.SetViewOverlayAnchor(tbMsg, mp); 
MyMapView.Overlays.Items.Add(tbMsg); 
+0

는 어디에 질문이다. – Gammer

+0

Esri 맵 컨트롤 위에 직접 추가 할 수 없습니다. –