AnsweredAssumed Answered

JavaScript API: Layering of Tile layers between Feature layers?

Question asked by bjvanmet on May 12, 2015
Latest reply on May 28, 2015 by bjvanmet

Hi all,


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 between two Feature layers. The problem is that all feature layers get put into one 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?


According to the documentation, the Graphics Layer is: "A layer that contains one or more Graphic features. Each map contains a GraphicsLayer by default, accessible using the 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. However, the graphics layer in is always on top. Also, all graphics layers are always on top of TiledMapServiceLayers and DynamicMapServiceLayers."




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  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.


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.


Thanks in advance to anyone who points me in the right direction or at least determines that there is no direction at all.