|
POST
|
In the code 1 section that codes sets up a listener for ALL layers - you just want A and B so adjust accordingly. On Code 2 section I do not know how. There is code in TOCMapLayerItem.as of setVisible(layer.visible, true); so that may work if you are in that file. I think there is a .visible property in the layer somewhere. Search the forums I am sure it is on there. Or just look through all the properties of the layer object and find it and try it. Flex can be a lot of trial and error when you start. Like I said I am new so that is all the help I got.
... View more
09-10-2013
01:19 PM
|
0
|
0
|
1412
|
|
POST
|
That is what the show event does. You are just setting up the event listener in the init. Then the procedure you create is called when the event happens (in this case when the box is checked).
... View more
09-10-2013
07:45 AM
|
0
|
0
|
1412
|
|
POST
|
I set mine in the Init of a custom widget. For you I think you could put it in either files Init section and it should get run when Flex is loading the map. Anywhere it will get run on startup should work. Sorry I am not that experienced at flex yet.
... View more
09-09-2013
12:57 PM
|
0
|
0
|
1412
|
|
POST
|
The code was in the last post of the thread. Not sure what else you need. Look at the top of the thread for the code to make a layer visible - In your case I would probably setup a Show listener on layer B and then on that event make layer A visible. And then setup a Show listener on layer B to turn on A. Then add 2 listeners on the Hide event (I think it is called hide) to do that same things but turn off the visible. The code is layerlist .addEventListener(FlexEvent.SHOW, mapLayerAddHandler2, false, 0, true); where mapLayerAddHandler2 is your function. j would be the index of the A layer and B layer. If you do not know the index you can look it up. I have seen the code to lookup the layer index somewhere on the forum but I can not find it now. If your layers do not become visible try to add this to refresh the TOC toc.validateNow() Hope that helps.
... View more
09-09-2013
09:25 AM
|
0
|
0
|
1412
|
|
POST
|
This thread should help you. http://forums.arcgis.com/threads/89934-LayerList-Widget-Turn-on-Sublayers?p=319435
... View more
09-09-2013
07:26 AM
|
0
|
0
|
1412
|
|
POST
|
Just an update. I ended up getting pretty much all that i wanted out of XMLPad Pro (it is free).
... View more
08-20-2013
12:55 PM
|
0
|
0
|
781
|
|
POST
|
I prefer the URL method listed above but you can also use the Attachment Manger and attach the files directly into the geodatabase.
... View more
08-13-2013
10:09 AM
|
0
|
0
|
1203
|
|
POST
|
In one version of mine i did add code to TOC.itemrender - in the createchildern function i think. But in another version I setup a listener on the Show of a layer. This might work best for you since you want to take action when a layer is checked (made visible). You can set the listener for just the layers you want. The code for this is layerlist .addEventListener(FlexEvent.SHOW, mapLayerAddHandler2, false, 0, true); where mapLayerAddHandler2 is your function. I wanted my procedure to run whenever any layer, except basemaps, were made visible. That code looks like this. for (var j:int = 0; j < layerlist.length; j++) { if (toc.basemapLayers.getItemIndex(layerlist .id) == -1) { layerlist .addEventListener(FlexEvent.SHOW, mapLayerAddHandler2, false, 0, true); } } Hope that helps.
... View more
08-07-2013
09:33 AM
|
0
|
0
|
862
|
|
POST
|
I did something similar to expand children. If you have one child then ask it for the parent. Then ask the parent what other children it has. Like this toc.dataProvider.source.children .layerInfo.name
... View more
08-06-2013
07:20 AM
|
0
|
0
|
862
|
|
POST
|
So from the code it looks like this adds the shapefile data to Flex locally and does not send or store any data on any server correct? Has anyone ever seen a widget like this to add a Layer (or Layers) from a REST service? We would like a way for users to add a REST data layer to our Flex app to see with our data (just like a shp file). Thanks
... View more
07-10-2013
08:46 AM
|
0
|
0
|
1781
|
|
POST
|
When I had to do this I just "cheated" and used a global var. It was just so much easier.
... View more
05-03-2013
06:05 AM
|
0
|
0
|
899
|
|
POST
|
Same way as the chart. Read the data into an array then assign that array as the data provider of the tree control.
... View more
04-30-2013
07:10 AM
|
0
|
0
|
455
|
|
POST
|
The basics are to read the data into an array in the proper format, then give that array to the chart. Not sure what you are charting with. Esri chart widget, Flex charting directly, or something like FusionCharts?
... View more
04-29-2013
10:24 AM
|
0
|
0
|
614
|
|
POST
|
If i type this into Chrome it grabs the file and "downloads" it for me. It may help you. file:///C:/windows/system32/notepad.exe
... View more
04-17-2013
12:47 PM
|
0
|
0
|
1211
|
|
POST
|
I did this by adding and if statement to the CreateChildren function in TOCMapLayerItem.as. I kept a global var of layers and sublayers I wanted and checked against that in the if statement. I did this because my TOC was dynamic. For your case you could just read from a xml and check against it. Put the if statement around layerInfos.push(layerInfo); Hope that helps. http://forums.arcgis.com/threads/76052-A-way-to-access-a-layer-inside-a-map-service-without-accessing-it-as-a-feature-layer?p=268843#post268843
... View more
04-09-2013
06:42 AM
|
0
|
0
|
784
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | yesterday | |
| 1 | yesterday | |
| 1 | 12-06-2022 11:50 AM | |
| 1 | Monday | |
| 1 | a week ago |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|