Select to view content in your preferred language

Multiple definition queries with multiple popups

2512
5
04-10-2014 07:47 AM
TylerDunn2
Regular Contributor
Just curious if anyone has a solution to my issue. I'm making a Wards map for my city and I'm trying to do it using 2 different sets of Wards; Wards_Top (35% transparency, turns off at 20,001) and Wards_Bottom (80% transparency, turns on at 20,000). For each Ward I have a separate popup config. When I try running this as a dynamic service with a definition in the <sublayer>, it will only read the first definition and not the others (example, when I open the map, only Ward 4 shows, none of the others). Anyone have a suggestions besides coding in the layers 4 times? I'd like to keep the TOC and legend uncluttered and make the whole layer on/off able.

Here's an example of the code:

<layer label="Wards" type ="dynamic" visible="true" alpha="0.65"                 
                   url="https://gis.cityofthornton.net/arcgis/rest/services/Webmaps/Wards_Top/MapServer">
   <sublayer id="0" definitionexpression="WARD = 1" popupconfig="popups/PopUp_Ward1.xml"/>
                        <sublayer id="0" definitionexpression="WARD = 2" popupconfig="popups/PopUp_Ward2.xml"/>
   <sublayer id="0" definitionexpression="WARD = 3" popupconfig="popups/PopUp_Ward3.xml"/>
   <sublayer id="0" definitionexpression="WARD = 4" popupconfig="popups/PopUp_Ward4.xml"/>
</layer>

<layer label="Wards" type ="dynamic" visible="true" alpha="0.20"                 
                   url="https://gis.cityofthornton.net/arcgis/rest/services/Webmaps/Wards_Bottom/MapServer">
   <sublayer id="0" definitionexpression="WARD = 1" popupconfig="popups/PopUp_Ward1.xml"/>
                        <sublayer id="0" definitionexpression="WARD = 2" popupconfig="popups/PopUp_Ward2.xml"/>
   <sublayer id="0" definitionexpression="WARD = 3" popupconfig="popups/PopUp_Ward3.xml"/>
   <sublayer id="0" definitionexpression="WARD = 4" popupconfig="popups/PopUp_Ward4.xml"/>
</layer>
Tags (2)
0 Kudos
5 Replies
RobertScheitlin__GISP
MVP Emeritus
Tyler,

   Why are all your sublayer ids zero?.. Sublayer are for setting certain properties like popups for specific sublayers in a map service based in the id number corresponding with the sublayer id of the map service.
0 Kudos
TylerDunn2
Regular Contributor
Within my map service, the id for the wards layer is "0". My understanding was that I needed to use "0" since it's a dynamic service, and a sublayer id="0" is going to call the layer with an id of 0.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Tyler,

  OK I see your confusion. Each sublayer in a map service can only have ONE popup/defenition query.
0 Kudos
TylerDunn2
Regular Contributor
okay so the best way around this would be to republish the service with a separate layer showing each ward (using a definition query) in the .mxd (Ward 1, Ward 2 etc). Then when doing the sublayers, call each sublayer by the new id number?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Tyler,

   That is a good approach.
0 Kudos