Attribute Table and highlight function

3992
8
Jump to solution
12-21-2015 08:30 AM
RebeccaWatson
Occasional Contributor

I have an issue with the Attribute Table widget that I am stumped on. Any ideas would be much appreciated.

We have a very large numbers of layers in our 5 maps services (just over 200) - only 5 of these are needed in the Attribute Table. To exclude out all the unwanted layers is cumbersome and doesn't work past a certain number of layers, plus we would like some of the layers (that are defined into pipeline types in the application to appear as one tab called Pipelines).

My solution to this was to create another service with just the 5 layers and publish that and then just exclude the 5 main map services and use this special one for the Attribute Table.

However, users might turn off the main services and the data wouldn't disappear because it would also be visible in the special service for the Attribute Table. So we made the special service 99% transparent and that did the trick... the Attribute Table worked well, bar two issues.

1) when the user turns off the layer in the main service, the data is still visible in the attribute table

2) the highlight feature function doesn't work as I'm assuming it has the same transparency as the layer and is therefore not displaying

We can live with the data being visible all the time in the table, but we really need the highlight to work as it is a busy, complex application and even though the zoom part works, you can't always tell which feature is selected.

Perhaps I need a separate highlight function but I'm not sure where in the code the selected item from the datagrid is accessed and zoomed to/highlighted.

I am working with the uncompiled 3.7 version. Does anyone have any suggestions for where I could start with this? Or other ideas to make this highlight work?

Thanks in advance.

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Rebecca,

  The way you can handle this is to make the symbology for the layer you want in the attribute table to be a null style (assuming simplefillsymbol). That way the layer does not show on the map but the selection in the attribute table still does.

Here is an example config.xml

<?xml version="1.0" ?>
<configuration>
    <title>ArcGIS Viewer for Flex</title>
    <logo>assets/images/logo.png</logo>
    <style>
        <colors>0xffffff,0x333333,0x101010,0x0,0xffd700</colors>
        <alpha>0.8</alpha>
        <font name="Verdana"/>
        <titlefont name="Verdana"/>
        <subtitlefont name="Verdana"/>
    </style>
    <!-- replace the following url with your own geometryservice -->
    <geometryservice url="https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer"/>
    <httpproxy>http://gislap183/Proxy/proxy.ashx</httpproxy>
    <widget url="widgets/Navigation/NavigationWidget.swf" config="widgets/Navigation/NavigationWidget.xml" left="10" top="50"/>
    <widget url="widgets/OverviewMap/OverviewMapWidget.swf" config="widgets/OverviewMap/OverviewMapWidget.xml" right="0" bottom="0"/>
    <widget url="widgets/MapSwitcher/MapSwitcherWidget.swf" config="widgets/MapSwitcher/MapSwitcherWidget.xml" right="20" top="55"/>
    <widget url="widgets/HeaderController/HeaderControllerWidget.swf" config="widgets/HeaderController/HeaderControllerWidget.xml" left="0" top="0"/>
    <map attributionvisible="true" esrilogovisible="true" openhandcursorvisible="false" scalebarvisible="true" scalebar="default" zoomslidervisible="false" wraparound180="true" addarcgisbasemaps="true" initialextent="-9604327.547356537 4575750.941837829 -9470486.310829371 4636518.379324462" wkid="102100" top="40" portalurl="https://calhoun.maps.arcgis.com/">
        <basemaps>
            <layer type="tiled" label="Streets" icon="https://calhoun.maps.arcgis.com/sharing/rest/content/items/d8855ee4d3d74413babfb0f41203b168/info/thu..." url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" visible="true"/>
        </basemaps>
        <operationallayers>
            <layer type="dynamic" label="LOJIC LandRecords Louisville" alpha="0.6" copyright="" imageformat="png8" url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_LandRecords_Louisville/M..." visible="true"/>
            <layer type="feature" label="hiddenlayer_Zoning" copyright="" url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_LandRecords_Louisville/M..." mode="onDemand" visible="true">
            <simplerenderer>
              <simplefillsymbol style="null" color="0xFF0000" alpha="1">
                <outline width="0" style="solid" color="0xFF0000" alpha="1"></outline>
              </simplefillsymbol>
            </simplerenderer>
            </layer>
        </operationallayers>
    </map>
    <widgetcontainer layout="float">
        <widget url="widgets/Draw/DrawWidget.swf" config="widgets/Draw/DrawWidget.xml" label="Draw" icon="assets/images/i_draw2.png"/>
        <widget url="widgets/Print/PrintWidget.swf" config="widgets/Print/PrintWidget.xml" label="Print" icon="assets/images/i_print.png"/>
        <widget url="widgets/LayerList/LayerListWidget.swf" config="widgets/LayerList/LayerListWidget_1.xml" label="Layer List" icon="assets/images/i_layers.png"/>
    </widgetcontainer>
    <widgetcontainer paneltype="bottom" initialstate="open">
        <widget url="widgets/AttributeTable/AttributeTableWidget.swf" config="widgets/AttributeTable/AttributeTableWidget.xml" label="Attribute Table" icon="assets/images/TableOpen32.png"/>
    </widgetcontainer>
</configuration>

View solution in original post

8 Replies
JamieThompson2
New Contributor III

Not sure if this information will be helpful, but (in the most recent update) I was trying to utilize some of the highlighting functionality for some different things. In the web appbuilder widgets/AttributeTable there is the Widget.js file. There are two functions that are commented out: onGraphicClick and highlightRow. Also there is some commented out code in the _featureTable.js file.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Jamie,

   Kind of apples and oranges here. Rebecca is talking about the Flex Viewer and you are talking about the Web AppBuilder for JS.

JamieThompson2
New Contributor III

I failed to realize that, thanks for pointing that out!

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Rebecca,

  The way you can handle this is to make the symbology for the layer you want in the attribute table to be a null style (assuming simplefillsymbol). That way the layer does not show on the map but the selection in the attribute table still does.

Here is an example config.xml

<?xml version="1.0" ?>
<configuration>
    <title>ArcGIS Viewer for Flex</title>
    <logo>assets/images/logo.png</logo>
    <style>
        <colors>0xffffff,0x333333,0x101010,0x0,0xffd700</colors>
        <alpha>0.8</alpha>
        <font name="Verdana"/>
        <titlefont name="Verdana"/>
        <subtitlefont name="Verdana"/>
    </style>
    <!-- replace the following url with your own geometryservice -->
    <geometryservice url="https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer"/>
    <httpproxy>http://gislap183/Proxy/proxy.ashx</httpproxy>
    <widget url="widgets/Navigation/NavigationWidget.swf" config="widgets/Navigation/NavigationWidget.xml" left="10" top="50"/>
    <widget url="widgets/OverviewMap/OverviewMapWidget.swf" config="widgets/OverviewMap/OverviewMapWidget.xml" right="0" bottom="0"/>
    <widget url="widgets/MapSwitcher/MapSwitcherWidget.swf" config="widgets/MapSwitcher/MapSwitcherWidget.xml" right="20" top="55"/>
    <widget url="widgets/HeaderController/HeaderControllerWidget.swf" config="widgets/HeaderController/HeaderControllerWidget.xml" left="0" top="0"/>
    <map attributionvisible="true" esrilogovisible="true" openhandcursorvisible="false" scalebarvisible="true" scalebar="default" zoomslidervisible="false" wraparound180="true" addarcgisbasemaps="true" initialextent="-9604327.547356537 4575750.941837829 -9470486.310829371 4636518.379324462" wkid="102100" top="40" portalurl="https://calhoun.maps.arcgis.com/">
        <basemaps>
            <layer type="tiled" label="Streets" icon="https://calhoun.maps.arcgis.com/sharing/rest/content/items/d8855ee4d3d74413babfb0f41203b168/info/thu..." url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" visible="true"/>
        </basemaps>
        <operationallayers>
            <layer type="dynamic" label="LOJIC LandRecords Louisville" alpha="0.6" copyright="" imageformat="png8" url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_LandRecords_Louisville/M..." visible="true"/>
            <layer type="feature" label="hiddenlayer_Zoning" copyright="" url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_LandRecords_Louisville/M..." mode="onDemand" visible="true">
            <simplerenderer>
              <simplefillsymbol style="null" color="0xFF0000" alpha="1">
                <outline width="0" style="solid" color="0xFF0000" alpha="1"></outline>
              </simplefillsymbol>
            </simplerenderer>
            </layer>
        </operationallayers>
    </map>
    <widgetcontainer layout="float">
        <widget url="widgets/Draw/DrawWidget.swf" config="widgets/Draw/DrawWidget.xml" label="Draw" icon="assets/images/i_draw2.png"/>
        <widget url="widgets/Print/PrintWidget.swf" config="widgets/Print/PrintWidget.xml" label="Print" icon="assets/images/i_print.png"/>
        <widget url="widgets/LayerList/LayerListWidget.swf" config="widgets/LayerList/LayerListWidget_1.xml" label="Layer List" icon="assets/images/i_layers.png"/>
    </widgetcontainer>
    <widgetcontainer paneltype="bottom" initialstate="open">
        <widget url="widgets/AttributeTable/AttributeTableWidget.swf" config="widgets/AttributeTable/AttributeTableWidget.xml" label="Attribute Table" icon="assets/images/TableOpen32.png"/>
    </widgetcontainer>
</configuration>
RebeccaWatson
Occasional Contributor

Hi Robert,

As ever, thanks for the help. I've just returned from Christmas and New Year holidays and have the usual pile up of emails to get through, but as soon as I clear the decks I will have a go at this and let you know how I get on.

Update: ok, I've taken a look at your solution and unfortunately we deal almost exclusively in polylines.

A bit more info. We have a standalone dynamic service published called Attributes which is solely used for the attribute table - as explained this is because our main services are just too complex to work with for the Attribute Table. This simplified service has 6 layers - 5 are lines and one is a point dataset.

I tried what you suggested with the point layer, by making it null inside and an outline width = 0 and that has done the trick with that particular layer. I'm thinking if I can set up a scheduled task that buffers the lines a tiny bit then I can use those as my data for the service it could possibly work. I'll look into that and see how I get on.

Thanks,

Rebecca

0 Kudos
RebeccaWatson
Occasional Contributor

Hi Robert,

Setting up a scheduled task to create small buffers around the lines and then setting these up as you suggest has worked - the lines are now highlighted when the user clicks - thanks for this guidance.

There is one remaining issue - the buffer has to be quite small to work well, but this makes the highlight quite difficult to see. Is there a way to change the highlight style so that it has more weight?

Thanks again,

Rebecca

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Rebecca,

   As the Attribute Widget is not open sources I do not know how to get to and change the feature selection symbology.

0 Kudos
RebeccaWatson
Occasional Contributor

Ah, that'll be why I can't find it! You've saved me a lot of searching. I'm satisfied that the result we have will work even if it isn't optimal - it's certainly a major improvement on no highlight.  Thanks for your help again.

Best wishes,

Rebecca

0 Kudos