<?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: JavaScript API: Layering of Tile layers between Feature layers? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-layering-of-tile-layers-between/m-p/640326#M59766</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, since there doesn't appear to be a way to do what I need from the API, so I just decided to hijack the layer I wanted out of the DOM. I use jQuery all the time, so that is what this is written in. Basically, I made an empty copy of the '#map_gc' SVG element container and placed it before the layer I wanted to put it under. I then copied it's attributes (overflow, hight, width, and style). Finally, I used the append command (similar to appendChild) to remove the graphics layer(which was the feature layer of parcels) I wanted and add it to the new SVG container. Not included in this example but on my TO-DO list is to set an event handler to re-copy the attributes when the map resizes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that this is written to only run once. I think I will have to put some of this code into a function if the feature layer is to be removed from and added back to the map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var reordered = false;&lt;/P&gt;&lt;P&gt;midlandParcelsLayer.on('update-end', function(){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(reordered == false){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $('#map_midlandStreetsLayer' ).before( '&amp;lt;svg id="map_gc_parcels"&amp;gt;&amp;lt;/svg&amp;gt;' );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $('#map_gc_parcels').attr('overflow', $('#map_gc').attr('overflow'));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $('#map_gc_parcels').attr('width', $('#map_gc').attr('width'));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $('#map_gc_parcels').attr('height', $('#map_gc').attr('height'));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $('#map_gc_parcels').attr('style', $('#map_gc').attr('style'));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $('#map_gc_parcels' ).append( $('#midlandParcelsLayer_layer') );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; reordered = true;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This appears to be working. I can pan, zoom, click on parcels to open popups and everything acts as one would hope. Hopefully this helps others &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/104387_Capture.PNG" style="width: 620px; height: 222px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 May 2015 18:37:38 GMT</pubDate>
    <dc:creator>BryanVan_Meter</dc:creator>
    <dc:date>2015-05-28T18:37:38Z</dc:date>
    <item>
      <title>JavaScript API: Layering of Tile layers between Feature layers?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-layering-of-tile-layers-between/m-p/640319#M59759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm new to the GIS world and am building a map viewer for displaying land parcels among other things. We have to port our Flex API based applications to the JavaScript API, and it was looking good until I had to place a Tile layer &lt;EM&gt;between&lt;/EM&gt; two Feature layers. The problem is that &lt;SPAN style="text-decoration: underline;"&gt;all&lt;/SPAN&gt; feature layers get put into &lt;SPAN style="text-decoration: underline;"&gt;one&lt;/SPAN&gt; SVG element called the "Graphics Layer". To be more specific, we have a transparent tile layer(s) of Streets, Lakes, etc that need to be placed above the parcel lines, yet below marker icons, etc. Should be no big deal, right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to the documentation, the Graphics Layer is: "&lt;EM&gt;A layer that contains one or more &lt;A href="https://developers.arcgis.com/javascript/jsapi/graphic-amd.html"&gt;Graphic&lt;/A&gt; features. Each map contains a GraphicsLayer by default, accessible using the &lt;A href="https://developers.arcgis.com/javascript/jsapi/map-amd.html#graphics"&gt;Map.graphics&lt;/A&gt; property. You can create your own graphics layers and add them to the map. Graphics layers can be reordered within the group of graphics layers. &lt;STRONG&gt;However, the graphics layer in &lt;A href="https://developers.arcgis.com/javascript/jsapi/map-amd.html#graphics"&gt;Map.graphics&lt;/A&gt; is always on top. Also, all graphics layers are always on top of &lt;A href="https://developers.arcgis.com/javascript/jsapi/tiledmapservicelayer-amd.html"&gt;TiledMapServiceLayers&lt;/A&gt; and &lt;A href="https://developers.arcgis.com/javascript/jsapi/dynamicmapservicelayer-amd.html"&gt;DynamicMapServiceLayers&lt;/A&gt;&lt;/STRONG&gt;.&lt;/EM&gt;"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/99370_Capture.PNG" style="width: 620px; height: 363px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the record, I'm not a GIS guy. I'm a web developer working for a GIS company. So one thing I've noticed in terms of the HTML that is generated is that when I&amp;nbsp; add multiple tile layers, they are created inside their own DIV containers which makes for easy reordering of Tile Layers. Feature layers on the other hand all get lumped into one SVG object. This makes it IMPOSSIBLE to shuffle a tile layer between two feature layers as you can't exactly put a 'div' element between two 'g' elements within the SVG element.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, am I just missing something? Does anyone know of a work around for this? If I could have more than one "Graphics layer" container, and by that I mean more than one SVG container to assign feature layers to, I would at least have some way to set classes, add z-indexes, or preferably use the API methods for reordering layers. To me this seems like a pretty basic idea, which makes me thing that I MUST be missing something.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance to anyone who points me in the right direction or at least determines that there is no direction at all.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 May 2015 21:22:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-layering-of-tile-layers-between/m-p/640319#M59759</guid>
      <dc:creator>BryanVan_Meter</dc:creator>
      <dc:date>2015-05-12T21:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript API: Layering of Tile layers between Feature layers?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-layering-of-tile-layers-between/m-p/640320#M59760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Bryan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe we can tackle the problem but first looking at what you are trying to achieve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you want parcel lines -&amp;gt; below a transparent tiled layer -&amp;gt; below a marker layer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the reason for having it in this order? Maybe we can move away from having them in a specific order?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tim &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 12:22:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-layering-of-tile-layers-between/m-p/640320#M59760</guid>
      <dc:creator>TimWitt2</dc:creator>
      <dc:date>2015-05-13T12:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript API: Layering of Tile layers between Feature layers?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-layering-of-tile-layers-between/m-p/640321#M59761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;"...So you want parcel lines -&amp;gt; below a transparent tiled layer -&amp;gt; below a marker layer." &amp;lt;--&lt;/EM&gt; Correct&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the interest in my little dilemma.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This layer order was easy to achieve with the Flex API (or so my boss tells me). Layers could just be ordered regardless of type. One would think that's how the JS API should be as well?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me get you a "few" screen shots &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This first screen shot is of an implementation I put together in Leaflet. Everything is working as it should in this screen shot. (For the record, I had to 'hack' at this a bit to make it work like this, but it works great)&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="99367" alt="Capture2.PNG" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/99367_Capture2.PNG" style="width: 620px; height: 378px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another screen shot of the Leaflet implementation, zoomed out one more level where the park has a transparent green overlay:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="99569" alt="Capture3.PNG" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/99569_Capture3.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I'll show the screen shots of the esri JS API version. This first one is how the layers stack normally.&lt;IMG __jive_id="99570" alt="Capture4.PNG" class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/99570_Capture4.PNG" style="width: 620px; height: 376px;" /&gt;&lt;/P&gt;&lt;P&gt;And zoomed out one more level so you can see the park overlay that appears (more on this later):&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="99575" alt="Capture6.PNG" class="image-5 jive-image" src="https://community.esri.com/legacyfs/online/99575_Capture6.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, to get around this, the only thing I could think of was to set z-indexes of layers in CSS and assign 'pointer-events: none;' to the transparent tile layer so users can click through it. While this worked for me in Leaflet, it is obviously not how ESRI intended things to be (and by that I mean having to hack things to work correctly). Notice the buildings are on top of some of the markers. This is less than ideal.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="99571" alt="Capture5.PNG" class="image-4 jive-image" src="https://community.esri.com/legacyfs/online/99571_Capture5.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;Zoom out one more level, and the park overlay makes things even uglier:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="99576" alt="Capture7.PNG" class="image-6 jive-image" src="https://community.esri.com/legacyfs/online/99576_Capture7.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;Currently, this is the only set of marker icons we have on any our maps, so the idea of redrawing all of those layers (streets, buildings, overlays, etc in multiple counties in our state) as a Feature layer makes my employer cringe in terms of time and effort.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 14:05:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-layering-of-tile-layers-between/m-p/640321#M59761</guid>
      <dc:creator>BryanVan_Meter</dc:creator>
      <dc:date>2015-05-13T14:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript API: Layering of Tile layers between Feature layers?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-layering-of-tile-layers-between/m-p/640322#M59762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bryan,&lt;/P&gt;&lt;P&gt;Are all the layers published in one service? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 14:26:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-layering-of-tile-layers-between/m-p/640322#M59762</guid>
      <dc:creator>RickeyFight</dc:creator>
      <dc:date>2015-05-13T14:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript API: Layering of Tile layers between Feature layers?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-layering-of-tile-layers-between/m-p/640323#M59763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Most come from ArcGIS online. Features are from services3.arcgis.com, and tiles are from tiles.arcgis.com.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 15:10:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-layering-of-tile-layers-between/m-p/640323#M59763</guid>
      <dc:creator>BryanVan_Meter</dc:creator>
      <dc:date>2015-05-13T15:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript API: Layering of Tile layers between Feature layers?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-layering-of-tile-layers-between/m-p/640324#M59764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you publish those to ArcGIS Online? Or are they from somebody else outside of your organization?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 18:12:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-layering-of-tile-layers-between/m-p/640324#M59764</guid>
      <dc:creator>TimWitt2</dc:creator>
      <dc:date>2015-05-13T18:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript API: Layering of Tile layers between Feature layers?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-layering-of-tile-layers-between/m-p/640325#M59765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Our guys publish them, but not me personally. I'm the Web UI developer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 18:43:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-layering-of-tile-layers-between/m-p/640325#M59765</guid>
      <dc:creator>BryanVan_Meter</dc:creator>
      <dc:date>2015-05-13T18:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript API: Layering of Tile layers between Feature layers?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-layering-of-tile-layers-between/m-p/640326#M59766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, since there doesn't appear to be a way to do what I need from the API, so I just decided to hijack the layer I wanted out of the DOM. I use jQuery all the time, so that is what this is written in. Basically, I made an empty copy of the '#map_gc' SVG element container and placed it before the layer I wanted to put it under. I then copied it's attributes (overflow, hight, width, and style). Finally, I used the append command (similar to appendChild) to remove the graphics layer(which was the feature layer of parcels) I wanted and add it to the new SVG container. Not included in this example but on my TO-DO list is to set an event handler to re-copy the attributes when the map resizes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that this is written to only run once. I think I will have to put some of this code into a function if the feature layer is to be removed from and added back to the map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var reordered = false;&lt;/P&gt;&lt;P&gt;midlandParcelsLayer.on('update-end', function(){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(reordered == false){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $('#map_midlandStreetsLayer' ).before( '&amp;lt;svg id="map_gc_parcels"&amp;gt;&amp;lt;/svg&amp;gt;' );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $('#map_gc_parcels').attr('overflow', $('#map_gc').attr('overflow'));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $('#map_gc_parcels').attr('width', $('#map_gc').attr('width'));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $('#map_gc_parcels').attr('height', $('#map_gc').attr('height'));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $('#map_gc_parcels').attr('style', $('#map_gc').attr('style'));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $('#map_gc_parcels' ).append( $('#midlandParcelsLayer_layer') );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; reordered = true;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This appears to be working. I can pan, zoom, click on parcels to open popups and everything acts as one would hope. Hopefully this helps others &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/104387_Capture.PNG" style="width: 620px; height: 222px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2015 18:37:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-layering-of-tile-layers-between/m-p/640326#M59766</guid>
      <dc:creator>BryanVan_Meter</dc:creator>
      <dc:date>2015-05-28T18:37:38Z</dc:date>
    </item>
  </channel>
</rss>

