<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Adding Popups to a feature layer in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/adding-popups-to-a-feature-layer/m-p/463392#M11922</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can also try MapTips like in this &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#MapTipWidget" rel="nofollow noopener noreferrer" target="_blank"&gt;sample&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This sample works fine for me, because all my feature layers are loaded at run-time (code-behind).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You would need to setup the XAML as follows (change the "{Binding [STANAME]}" to any of your columns):&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;lt;esri:Map x:Name="MyMap" WrapAround="True"&amp;gt;
&amp;nbsp; &amp;lt;esri:FeatureLayer ID="MyMapTipsLayer" 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OutFields="*"&amp;nbsp; Where="OBJECTID &amp;gt;= 0"&amp;gt;
&amp;nbsp; &amp;lt;/esri:FeatureLayer&amp;gt;
&amp;lt;/esri:Map&amp;gt;

&amp;lt;Canvas HorizontalAlignment="Left" VerticalAlignment="Top" &amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:MapTip x:Name="MyMapTip"&amp;nbsp; BorderBrush="CornflowerBlue" 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BorderThickness="2" Title="{Binding [DcomId]}" VerticalOffset="10" 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HorizontalOffset="10" Background="#C6ECFF" /&amp;gt;
&amp;lt;/Canvas&amp;gt;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then, in code-behind (at page load) you assign the feature service to the "MyMapTip" control as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
public MainPage()
{
&amp;nbsp;&amp;nbsp; InitializeComponent();
&amp;nbsp; 
&amp;nbsp;&amp;nbsp; FeatureLayer fl = MyMap.Layers["MyMapTipsLayer"] as FeatureLayer;
&amp;nbsp;&amp;nbsp; fl.Url = "http://rmgsc.cr.usgs.gov/ArcGIS/rest/services/nhss_haz/MapServer/0/";
&amp;nbsp;&amp;nbsp; MyMapTip.GraphicsLayer = fl;
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note: Make sure you reference the Systems.Windows.Data.DLL; otherwise, you will get all sort of parse errors.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That is!&amp;nbsp; You are done!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hugo.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 20:34:52 GMT</pubDate>
    <dc:creator>HugoCardenas</dc:creator>
    <dc:date>2021-12-11T20:34:52Z</dc:date>
    <item>
      <title>Adding Popups to a feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/adding-popups-to-a-feature-layer/m-p/463390#M11920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have this layer: &lt;/SPAN&gt;&lt;A href="http://rmgsc.cr.usgs.gov/ArcGIS/rest/services/nhss_haz/MapServer/0/"&gt;http://rmgsc.cr.usgs.gov/ArcGIS/rest/services/nhss_haz/MapServer/0/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to configure the event of Mouse Over or Click on the feature to show the popup window.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I get nothing.. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think the service is not providing me the information I need for this, but everything else show up ok.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm adding the layer in code: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- create a feature layer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- set the url &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- set the renderer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- add the layer to the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm missing something?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can I add/create the "popup window" on my code based on attributes?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2012 21:13:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/adding-popups-to-a-feature-layer/m-p/463390#M11920</guid>
      <dc:creator>michaelsanchez</dc:creator>
      <dc:date>2012-03-26T21:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Popups to a feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/adding-popups-to-a-feature-layer/m-p/463391#M11921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A feature layer has no default popup window automatically set.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please look at this &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#InfoWindowSimple"&gt;sample &lt;/A&gt;&lt;SPAN&gt;that demonstrates how to set an info window for a feature layer.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2012 07:43:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/adding-popups-to-a-feature-layer/m-p/463391#M11921</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2012-03-27T07:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Popups to a feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/adding-popups-to-a-feature-layer/m-p/463392#M11922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can also try MapTips like in this &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#MapTipWidget" rel="nofollow noopener noreferrer" target="_blank"&gt;sample&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This sample works fine for me, because all my feature layers are loaded at run-time (code-behind).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You would need to setup the XAML as follows (change the "{Binding [STANAME]}" to any of your columns):&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;lt;esri:Map x:Name="MyMap" WrapAround="True"&amp;gt;
&amp;nbsp; &amp;lt;esri:FeatureLayer ID="MyMapTipsLayer" 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OutFields="*"&amp;nbsp; Where="OBJECTID &amp;gt;= 0"&amp;gt;
&amp;nbsp; &amp;lt;/esri:FeatureLayer&amp;gt;
&amp;lt;/esri:Map&amp;gt;

&amp;lt;Canvas HorizontalAlignment="Left" VerticalAlignment="Top" &amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:MapTip x:Name="MyMapTip"&amp;nbsp; BorderBrush="CornflowerBlue" 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BorderThickness="2" Title="{Binding [DcomId]}" VerticalOffset="10" 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HorizontalOffset="10" Background="#C6ECFF" /&amp;gt;
&amp;lt;/Canvas&amp;gt;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then, in code-behind (at page load) you assign the feature service to the "MyMapTip" control as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
public MainPage()
{
&amp;nbsp;&amp;nbsp; InitializeComponent();
&amp;nbsp; 
&amp;nbsp;&amp;nbsp; FeatureLayer fl = MyMap.Layers["MyMapTipsLayer"] as FeatureLayer;
&amp;nbsp;&amp;nbsp; fl.Url = "http://rmgsc.cr.usgs.gov/ArcGIS/rest/services/nhss_haz/MapServer/0/";
&amp;nbsp;&amp;nbsp; MyMapTip.GraphicsLayer = fl;
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note: Make sure you reference the Systems.Windows.Data.DLL; otherwise, you will get all sort of parse errors.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That is!&amp;nbsp; You are done!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hugo.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:34:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/adding-popups-to-a-feature-layer/m-p/463392#M11922</guid>
      <dc:creator>HugoCardenas</dc:creator>
      <dc:date>2021-12-11T20:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Popups to a feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/adding-popups-to-a-feature-layer/m-p/463393#M11923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Another way is to set GraphicsLayer.MapTip. FeatureLayer inherits from GraphicsLayer. In this code, we are requesting for all fields and displaying the key-value pair (all attributes). This is triggered on mouse enter. Hovering a feature on your layer displays the maptip. You update the look and feel of your MapTip by adding border as in this SDK sample: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#FeatureLayerMapTips" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#FeatureLayerMapTips&lt;/A&gt;&lt;SPAN&gt;. So your options are: InfoWindow, Toolkit.MapTip, or GraphicsLayer.MapTip.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:FeatureLayer ID="MyLayer" OutFields="*"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Url="yourServiceUrl"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:FeatureLayer.MapTip&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Grid&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Grid.ColumnDefinitions&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ColumnDefinition Width="Auto"/&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ColumnDefinition Width="*"/&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Grid.ColumnDefinitions&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ItemsControl ItemsSource="{Binding Keys}" Grid.Column="0" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ItemsControl ItemsSource="{Binding Values}" Grid.Column="1" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Grid&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/esri:FeatureLayer.MapTip&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;/esri:FeatureLayer&amp;gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:34:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/adding-popups-to-a-feature-layer/m-p/463393#M11923</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2021-12-11T20:34:54Z</dc:date>
    </item>
  </channel>
</rss>

