<esri:InfoWindow x:Name="ecocatParcelinfoWindow" Grid.Row="4" Grid.Column="1" Padding="2" CornerRadius="2" Map="{Binding ElementName=MyMap}" ContentTemplate="{StaticResource EcocatParcelInfoWindowTemplate}"/>
Sounds similar to the same issue I experienced in this thread: http://forums.arcgis.com/threads/23081-How-do-I-control-the-Infowindow-height?p=100995
<esri:InfoWindow x:Name="ecocatParcelinfoWindow" Grid.Row="4" Margin="4,-115,0,0" Padding="2" CornerRadius="2" Map="{Binding ElementName=MyMap}" ContentTemplate="{StaticResource EcocatParcelInfoWindowTemplate}"> </esri:InfoWindow>
ShowMapTip(sender as Map, e.MapPoint);
private void ShowMapTip(Map map, MapPoint pnt) { if (ecocatParcelinfoWindow.IsOpen) ecocatParcelinfoWindow.IsOpen = false; if (!ecocatParcelinfoWindow.IsOpen) { ecocatParcelinfoWindow.Content = null; IdentifyTask it = new IdentifyTask("http://rmms-dev.atlas.illinois.edu/ArcGIS/rest/services/wirt/MapServer"); var p = new IdentifyParameters() { MapExtent = MyMap.Extent, Height = (int)MyMap.ActualHeight, Width = (int)MyMap.ActualWidth, SpatialReference = MyMap.SpatialReference, Geometry = pnt }; p.LayerOption = LayerOption.all; p.LayerIds.AddRange(new int[] { 19,20,21 }); it.ExecuteCompleted +=new EventHandler<IdentifyEventArgs>(it_ExecuteCompleted); it.Failed += IdentifyTask_Failed; it.ExecuteAsync(p,pnt); } ecocatParcelinfoWindow.IsOpen = !ecocatParcelinfoWindow.IsOpen; }
private void it_ExecuteCompleted(object sender, IdentifyEventArgs e) { if (e.IdentifyResults.Count == 0) { ecocatParcelinfoWindow.IsOpen = false; return; } List<string> outfield = new List<string>(); if (e.IdentifyResults.ElementAt(0).LayerId == 19) { outfield.Add("COMMON_NAM"); outfield.Add("LAST_OBS_D"); outfield.Add("EO_NUM"); } else if (e.IdentifyResults.ElementAt(0).LayerId == 20) { outfield.Add("MA_NAME"); outfield.Add("INPC_NUMBE"); } else if (e.IdentifyResults.ElementAt(0).LayerId == 21) { outfield.Add("SITENAME"); outfield.Add("NAINUM"); } IDictionary<string, object> attributes = new Dictionary<string, object>(); foreach (var item in e.IdentifyResults[0].Feature.Attributes) if (outfield.Contains(item.Key)) attributes.Add(item.Key, item.Value); MapPoint pnt = e.UserState as MapPoint; ecocatParcelinfoWindow.Anchor = pnt; ecocatParcelinfoWindow.IsOpen = true; ecocatParcelinfoWindow.Content = attributes; }
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.