You are right the '5' represents the layer ID.The mouse over and mouse click events to produce maptips are managed by the maptip widget, so you don't have to worry about that.After changing the Url, do you get some features displayed in your graphic layer?/Dominique
<esri:GraphicsLayer ID="SchoolsGraphicsLayer" Initialized="SchoolsGraphicsLayer_Initialized" > <esri:GraphicsLayer.MapTip> <Border esri:GraphicsLayer.MapTipHideDelay="00:00:01.5" CornerRadius="10" BorderBrush="#FF222957" BorderThickness="3" Margin="0,0,15,15"> <Border.Background> <LinearGradientBrush EndPoint="1.038,1.136" StartPoint="0.015,0.188"> <GradientStop Color="#FFD1DFF2"/> <GradientStop Color="#FF092959" Offset="0.946"/> </LinearGradientBrush> </Border.Background> <Border.Effect> <DropShadowEffect ShadowDepth="10" BlurRadius="14" Direction="300" /> </Border.Effect> <StackPanel Orientation="Vertical" Margin="20,15,20,15"> <StackPanel Orientation="Horizontal" Margin="0,0,0,6"> <TextBlock Text="School Name: " FontWeight="Bold" Foreground="#FF0F274E" FontSize="12" /> <TextBlock Text="{Binding Converter={StaticResource MyDictionaryConverter}, ConverterParameter=NAME, Mode=OneWay}" Foreground="#FFFFFFFF" FontSize="12" FontStyle="Italic" FontFamily="Portable User Interface" /> </StackPanel> <StackPanel Orientation="Horizontal"> <TextBlock Text="Address: " FontWeight="Bold" Foreground="#FF0F274E" FontSize="12" /> <TextBlock Text="{Binding Converter={StaticResource MyDictionaryConverter}, ConverterParameter=Address, Mode=OneWay}" Foreground="#FFFFFFFF" FontSize="12" FontStyle="Italic" FontFamily="Portable User Interface" /> </StackPanel> </StackPanel> </Border> </esri:GraphicsLayer.MapTip> </esri:GraphicsLayer>
Private Sub SchoolsGraphicsLayer_Initialized(ByVal sender As Object, ByVal args As EventArgs) Dim query As New ESRI.ArcGIS.Client.Tasks.Query() With {.Geometry = New ESRI.ArcGIS.Client.Geometry.Envelope(-180, 0, 0, 90)} query.OutFields.Add("*") Dim queryTask As New QueryTask("http://maps.pagnet.org/arcgis/rest/services/SchoolSearch2/MapServer/8") AddHandler queryTask.ExecuteCompleted, AddressOf SchoolsGraphicsLayerQueryTask_ExecuteCompleted queryTask.ExecuteAsync(query) End Sub Private Sub SchoolsGraphicsLayerQueryTask_ExecuteCompleted(ByVal sender As Object, ByVal queryArgs As ESRI.ArcGIS.Client.Tasks.QueryEventArgs) If queryArgs.FeatureSet Is Nothing Then Return End If Dim resultFeatureSet As FeatureSet = queryArgs.FeatureSet Dim graphicsLayer As ESRI.ArcGIS.Client.GraphicsLayer = TryCast(MyMap.Layers("SchoolsGraphicsLayer"), ESRI.ArcGIS.Client.GraphicsLayer) If resultFeatureSet IsNot Nothing AndAlso resultFeatureSet.Features.Count > 0 Then For Each graphicFeature As ESRI.ArcGIS.Client.Graphic In resultFeatureSet.Features graphicFeature.Symbol = DefaultFillSymbol graphicsLayer.Graphics.Add(graphicFeature) Next graphicFeature End If End Sub
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.