Select to view content in your preferred language

Table of Contents - Legend Widget for FlexViewer 2.x

122735
664
12-01-2010 07:30 AM
RobertScheitlin__GISP
MVP Emeritus
All,

Here is the next in my line of widgets for the FlexViewer 2.x.

The legend portion of this widget is the same code as my dynamic legend widget so,

IT IS FOR ARCGIS SERVER 10 OR GREATER ONLY

This is just a simple TOC Widget that includes my dynamic legend component.
This widget also includes my enhancement for map service transparency,
right click context menu for zoom to make layer visible, and my scale
dependent renderer for the TOC checkboxes.
Tags (2)
0 Kudos
664 Replies
GISDev1
Deactivated User
Hi,

When I clear my browser cache and launch my FlexViewer, then open the TOC widget, I got following ActionScript error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at widgets.TOC.toc.tocClasses::TocMapLayerItem/createChildren()
at widgets.TOC.toc.tocClasses::TocMapLayerItem()
at widgets.TOC.toc::TOC/registerMapLayer()
at Function/<anonymous>()
at widgets.TOC.toc.utils::MapUtil$/forEachMapLayer()
at widgets.TOC.toc::TOC/registerAllMapLayers()
at widgets.TOC.toc::TOC/commitProperties()
at mx.core::UIComponent/validateProperties()
at mx.managers::LayoutManager/validateProperties()
at mx.managers::LayoutManager/doPhasedInstantiation()
at mx.managers::LayoutManager/doPhasedInstantiationCallback()

If I refresh the FlexViewer and re-launch the TOC widget, it works fine.

Any ideas? Thanks in advance!

Rose


Any news on this?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
GIS Dev,

   Hard to respond to something I can not duplicate.
0 Kudos
GISDev1
Deactivated User
GIS Dev,

   Hard to respond to something I can not duplicate.


Indeed.

For my particular issue with the createChildren error, I tracked it down to a problem REST service (10.1.1) which is identical in almost every way, except for the spatial data, to a similar service which works just fine. The pop-ups had no change on if I got the createChildren error or not. I checked the code that sarthakdatt used in the fix on github (https://github.com/Esri/arcgis-viewer-flex/commit/2c9ea4642711e3fabc49f5cd6d6cf967ada9b2e3), and your TOC V3.3.0 of course already had that fix implemented.

My problem service does return "arcGISDynamicMapServiceLayer.visibleLayers == null"
and that was causing the error. This only occurs in IE, and not other browsers. Both debug flash players are fully up to date.

I added a simple if check for null and all is well now. I have no clue why that one particular service returns null for visible layers in the class, as the service works as expected in all other accounts, and there are default layers that are on in the MXD that show up just fine when turning on the layer in the TOC in Flex. I'm going to look into the issue further when I have more time.
0 Kudos
JeffLegato
Regular Contributor
Robert:

I have read posts where you fixed the group layer issue in version 3.1.5 and above. I am using version 3.2 with Nested groups and am experiencing issued with layers turning on and off.


Robert,

I am experiencing the same issue however I am using 3.3 in the Application Builder. 

I have a service you can use to test...

http://www.sloplanning.org/arcgis/rest/services/Planning/test/MapServer

To duplicate what I am seeing:
1. Load the layer into a flexviewer app
2. Check on the "Land Use" group
3. Zoom in 2 levels and watch it turn off
4. Check it back on and zoom in one more level to see black land use outlines appear
5. Zoom back out until they disappear
6. Notice that the Land Use group is now unchecked

I worked around this behavior by republishing the service with the Land Use group turned on in the MXD.

On another note (but related) a user can't turn on a group if nothing is checked on within it. Is this fixable?

Thanks again for taking some time on this. Much appreciated!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jeff,

   OK, I am not sure I am understanding the instructions... When I check the 'Land Use' on the Land Use Outlines are not visible based on scale. When I zoom in three times they become visible. This is all accurate based on design and scale dependency.
0 Kudos
JeffLegato
Regular Contributor
Jeff,

   OK, I am not sure I am understanding the instructions... When I check the 'Land Use' on the Land Use Outlines are not visible based on scale. When I zoom in three times they become visible. This is all accurate based on design and scale dependency.


Correct, but when I zoom back out they not only disappear, the Land Use group layer becomes unchecked.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jeff,

   Which version of the widget are you using?... I do not see the layer get unchecked using 3.3.
0 Kudos
JeffLegato
Regular Contributor
I downloaded the 3.3 version and am using it with the ArcGIS Viewer for Flex Application builder Version 3.3.  I am attaching a screen shot of the download contents...
[ATTACH=CONFIG]25613[/ATTACH]

I tried using the compiled_FV3.3 widget in the same download but that didn't make any difference. 

Thanks for all you do by the way!  Your time and effort in this benefits us all.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jeff,

   I don't know what to tell you... Here are the screen shots of what I see.

[ATTACH=CONFIG]25619[/ATTACH][ATTACH=CONFIG]25620[/ATTACH]
0 Kudos
JeffLegato
Regular Contributor
Robert,

I was able to publish this temporarily on our public facing server: http://www.sloplanning.org/test/test/

I think you will be able to see what I am experiencing there.  Specifically, it's the Land Use group layer that is having troubles.

Thanks again!
0 Kudos