<?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: Cannot get featureLayer to display under DynamicMapServiceLayer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-get-featurelayer-to-display-under/m-p/390059#M35988</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;If I add the featureLayer in after adding the dynamicMapServiceLayer it works fine and I get no error. if I try to add the featurelayer first I get a "type error"&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think the map is taking on the properties (such as extent and coordinate system) of the Dynamic layer, which then allows you to add the Feature Layer. See the &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/arcgisdynamicmapservicelayer.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Dynamic Map help entry&lt;/A&gt;&lt;SPAN&gt; which says: "&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Verdana;"&gt;If the first layer added to the map is an ArcGISDynamicMapServiceLayer, the map will take on the projection of this layer."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could try specifying these properties when you declare the Map object:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
//specify the initial extent and coordinate system
&lt;SPAN style="color: #000000; font-family: monospace;"&gt; var initExtent = new esri.geometry.Extent({"xmin":-9270392,"ymin":5247043,"xmax":-9269914,"ymax":5247401,"spatialReference":{"wkid":102100}});&lt;/SPAN&gt;
//create map
map = new esri.Map("mapDiv",{extent:initExtent}); 
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This should allow you to add the Feature layer to the map without first requiring the Dynamic layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;What am I doing wrong and why will the featureLayer not show up under the dynamicMapServiceLayer?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A Feature layer is a type of Graphics layer, and according the &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/graphicslayer.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;help file&lt;/A&gt;&lt;SPAN&gt;, "&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Verdana;"&gt;Graphics layers can be reordered within the group of graphics layers. However, the graphics layer in &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/map.htm#graphics" rel="nofollow noopener noreferrer" target="_blank"&gt;Map.Graphics&lt;/A&gt;&lt;SPAN style="color: #000000; font-family: Verdana;"&gt; is always on top. Also, all graphics layers are always on top of &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/tiledmapservicelayer.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;TiledMapServiceLayers&lt;/A&gt;&lt;SPAN style="color: #000000; font-family: Verdana;"&gt; and &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/dynamicmapservicelayer.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;DynamicMapServiceLayers&lt;/A&gt;&lt;SPAN style="color: #000000; font-family: Verdana;"&gt;."&lt;BR /&gt;&lt;BR /&gt;So you may need to change the way you're adding these layers, and either use two Feature layers, or two Dynamic layers.&lt;BR /&gt;&lt;BR /&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 17:53:07 GMT</pubDate>
    <dc:creator>StephenLead</dc:creator>
    <dc:date>2021-12-11T17:53:07Z</dc:date>
    <item>
      <title>Cannot get featureLayer to display under DynamicMapServiceLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-get-featurelayer-to-display-under/m-p/390057#M35986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to add 2 layers to my map, 1 featureLayer and 1 dynamicMapServiceLayer. The featureLayer needs to show up underneath the dynamicMapServiceLayer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For some reason if I try to add the featurelayer first I get a "type error" in serverapi.arcgisonline.com:14:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;TypeError
arguments: Array[2]
get message: function getter() { [native code] }
get stack: function getter() { [native code] }
set message: function setter() { [native code] }
set stack: function setter() { [native code] }
type: "non_object_property_load"
__proto__: Error&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I add the featureLayer in after adding the dynamicMapServiceLayer it works fine and I get no error. However I need the featureLayer to be under the dynamicMapServiceLayer not ontop. I have tried to add it to the map with an index of 0 (map.addLayer(featureLayer,0)) but it still puts it on top. I have tried to use "map.reorderLayer" but it does not seem to do anything, it still shows up on top. What am I doing wrong and why will the featureLayer not show up under the dynamicMapServiceLayer?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my page:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://northmiamicra.org/PWorksLayout.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://northmiamicra.org/PWorksLayout.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:53:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-get-featurelayer-to-display-under/m-p/390057#M35986</guid>
      <dc:creator>GarethMann</dc:creator>
      <dc:date>2021-12-11T17:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot get featureLayer to display under DynamicMapServiceLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-get-featurelayer-to-display-under/m-p/390058#M35987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;**bump bump**&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Jan 2012 11:07:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-get-featurelayer-to-display-under/m-p/390058#M35987</guid>
      <dc:creator>GarethMann</dc:creator>
      <dc:date>2012-01-22T11:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot get featureLayer to display under DynamicMapServiceLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-get-featurelayer-to-display-under/m-p/390059#M35988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;If I add the featureLayer in after adding the dynamicMapServiceLayer it works fine and I get no error. if I try to add the featurelayer first I get a "type error"&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think the map is taking on the properties (such as extent and coordinate system) of the Dynamic layer, which then allows you to add the Feature Layer. See the &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/arcgisdynamicmapservicelayer.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Dynamic Map help entry&lt;/A&gt;&lt;SPAN&gt; which says: "&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Verdana;"&gt;If the first layer added to the map is an ArcGISDynamicMapServiceLayer, the map will take on the projection of this layer."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could try specifying these properties when you declare the Map object:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
//specify the initial extent and coordinate system
&lt;SPAN style="color: #000000; font-family: monospace;"&gt; var initExtent = new esri.geometry.Extent({"xmin":-9270392,"ymin":5247043,"xmax":-9269914,"ymax":5247401,"spatialReference":{"wkid":102100}});&lt;/SPAN&gt;
//create map
map = new esri.Map("mapDiv",{extent:initExtent}); 
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This should allow you to add the Feature layer to the map without first requiring the Dynamic layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;What am I doing wrong and why will the featureLayer not show up under the dynamicMapServiceLayer?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A Feature layer is a type of Graphics layer, and according the &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/graphicslayer.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;help file&lt;/A&gt;&lt;SPAN&gt;, "&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Verdana;"&gt;Graphics layers can be reordered within the group of graphics layers. However, the graphics layer in &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/map.htm#graphics" rel="nofollow noopener noreferrer" target="_blank"&gt;Map.Graphics&lt;/A&gt;&lt;SPAN style="color: #000000; font-family: Verdana;"&gt; is always on top. Also, all graphics layers are always on top of &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/tiledmapservicelayer.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;TiledMapServiceLayers&lt;/A&gt;&lt;SPAN style="color: #000000; font-family: Verdana;"&gt; and &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/dynamicmapservicelayer.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;DynamicMapServiceLayers&lt;/A&gt;&lt;SPAN style="color: #000000; font-family: Verdana;"&gt;."&lt;BR /&gt;&lt;BR /&gt;So you may need to change the way you're adding these layers, and either use two Feature layers, or two Dynamic layers.&lt;BR /&gt;&lt;BR /&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:53:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-get-featurelayer-to-display-under/m-p/390059#M35988</guid>
      <dc:creator>StephenLead</dc:creator>
      <dc:date>2021-12-11T17:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot get featureLayer to display under DynamicMapServiceLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-get-featurelayer-to-display-under/m-p/390060#M35989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;Also, all graphics layers are always on top of &lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/tiledmapservicelayer.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;TiledMapServiceLayers&lt;/A&gt;&lt;SPAN style="color: #000000; font-family: Verdana;"&gt; and &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/dynamicmapservicelayer.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;DynamicMapServiceLayers&lt;/A&gt;&lt;SPAN style="color: #000000; font-family: Verdana;"&gt;."&lt;BR /&gt;&lt;BR /&gt;So you may need to change the way you're adding these layers, and either use two Feature layers, or two Dynamic layers.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, I try to do the same. I need my ArcGISDynamicMapServiceLayer to be on top of my FeatureLayer, since I need the labels of the ArcGISDynamicMapServiceLayer on top. To make the FeatureLayer transparent by setting the opacity is not the right way, then the colors of the FeatureLayer are not the same any more!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I helped myself so far with another way of labeling, described &lt;/SPAN&gt;&lt;A href="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2009/10/26/Working-with-TextSymbol-in-the-ArcGIS-JavaScript-API.aspx" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var textSymbol = new esri.symbol.TextSymbol("Here be dragons");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; textSymbol.setColor( new dojo.Color([128, 0, 0]));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; textSymbol.setAlign(esri.symbol.TextSymbol.ALIGN_START);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; textSymbol.setAngle(15);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; textSymbol.setFont(font);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var pt=&amp;nbsp; new esri.geometry.Point(x,y,map.spatialReference)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var gra = new esri.Graphic(pt,textSymbol);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.graphics.add(gra);&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But this is not powerful enough for me, since there is no dynamical placement of labels anymore. Meaning the labels are fixed on one point on the map now! So you will find overlapping labels and label parts, cropped by the map border.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Is there any way to display labels from an arcgis javascript api layer with all their advantages on top of a FeatureLayer?&lt;BR /&gt;&lt;BR /&gt;Please assist.&lt;/STRONG&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:53:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-get-featurelayer-to-display-under/m-p/390060#M35989</guid>
      <dc:creator>MarcelKleinmann</dc:creator>
      <dc:date>2021-12-11T17:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot get featureLayer to display under DynamicMapServiceLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-get-featurelayer-to-display-under/m-p/390061#M35990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;A Feature layer is a type of Graphics layer, and according the &lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/graphicslayer.htm"&gt;help file&lt;/A&gt;, "&lt;SPAN style="color: #000000; font-family: Verdana;"&gt;Graphics layers can be reordered within the group of graphics layers. However, the graphics layer in &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/map.htm#graphics"&gt;Map.Graphics&lt;/A&gt;&lt;SPAN style="color: #000000; font-family: Verdana;"&gt; is always on top. Also, all graphics layers are always on top of &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/tiledmapservicelayer.htm"&gt;TiledMapServiceLayers&lt;/A&gt;&lt;SPAN style="color: #000000; font-family: Verdana;"&gt; and &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/dynamicmapservicelayer.htm"&gt;DynamicMapServiceLayers&lt;/A&gt;&lt;SPAN style="color: #000000; font-family: Verdana;"&gt;."&lt;BR /&gt;&lt;BR /&gt;So you may need to change the way you're adding these layers, and either use two Feature layers, or two Dynamic layers.&lt;BR /&gt;&lt;BR /&gt;Steve&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks steve, that has helped me a lot.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jan 2012 13:31:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-get-featurelayer-to-display-under/m-p/390061#M35990</guid>
      <dc:creator>GarethMann</dc:creator>
      <dc:date>2012-01-23T13:31:48Z</dc:date>
    </item>
  </channel>
</rss>

