|
POST
|
In my case with the nested layers if I did that it would take up half the screen. Plus some layer names are really long (I know bad UI but that is how it has to be.) It was also be nice that if you hovered the mouse it would show it to you similar to what the windows file browser does. It would also be nice if MapSwitcher was sizable. I guess I just keep running into that the viewer is really just for small maps of a few layers.
... View more
01-24-2013
09:59 AM
|
0
|
0
|
1489
|
|
POST
|
Seems like this would be important and in there but it is not. How would I add this to the code? Tried wrapping it in the MapSwitcher but no luck. Thanks
... View more
01-24-2013
06:30 AM
|
0
|
7
|
1653
|
|
POST
|
I had tried the registry MS thing a number of ways with no luck. I was able to get a copy of the new 10.1 SP1 install and that worked! Now if I can get the ports opened up.. Even with windows firewall off still no one can get in. Thanks.
... View more
01-07-2013
08:15 AM
|
0
|
0
|
3362
|
|
POST
|
I am getting the attached error when trying to install ArcServer 10.1. "Error 1606. Could not access network location NOT_INSTALLED\Lib\site-packages" I am able to give a dir, un, etc then right after Computing space requirements i get the error. Searching around it seems to be a registry Windows error. But I can not find anything in there about it. This is a brand new machine. ArcGIS Desktop and the background 64 bit have been installed. I am not installing over a network and do have admin rights. Any help is appreciated. Thanks [ATTACH=CONFIG]20450[/ATTACH]
... View more
01-04-2013
09:51 AM
|
0
|
9
|
6514
|
|
POST
|
Ok here you are. It works by using toc.excludelayers. At the beginning all layers are in the exclude. Then when a user wants to add a layer I actually remove it from the exclude list I have. To remove from the TOC I add it back to the list of excluded layers. The Visibility check boxes in both TOCs do stay synced, order is also synced when using the base code (my application gets around this but be careful if you do not want this) . First I made a copy of MapSwitcherWidget and called it MapSwitcherWidget2. I then had to change a few other files to allow the drag and drop mostly. Overall very few changes to the original code. There is still test code in here commented out. If I missed anything or questions just let me know. ------------------------------ Drag and Drop Code (and other code parts are seen here also) in MapSwitcherWidget2.mxml private function dragDropHandler(event:DragEvent):void { /*Alert.show(event.dragSource.dataForFormat('text') as String);*/ if (templist.getItemIndex(event.dragSource.dataForFormat('text')) != -1) { templist.removeItemAt(templist.getItemIndex(event.dragSource.dataForFormat('text'))); } } private function dragEnterHandler(event:Event):void { var dropTarget:Button=Button(event.currentTarget); // Accept the drop. DragManager.acceptDragDrop(dropTarget); } /* drop on the toc button itself because of the autohide - i later took out the autohide and then moved this to the border container*/ <s:HGroup id="mapLayersContainer" gap="9"> <s:Button id="opLayersButton" height="100%" label="{opLayerListButtonLabel}" rollOut="startHideTimer()" rollOver="opLayerListButton_rollOverHandler(event)" visible="false" dragEnter="dragEnterHandler(event)" dragDrop="dragDropHandler(event)"/> in TocItemRenderer.as protected function onCheckBoxMouseMove(event:MouseEvent):void { // Get the drag initiator component from the event object. var dragInitiator:CheckBoxIndeterminate=CheckBoxIndeterminate(event.currentTarget); // Get the color of the drag initiator component. // Create a DragSource object. var ds:DragSource = new DragSource(); ds.addData(event.currentTarget.owner.data.label, 'text'); // Call the DragManager doDrag() method to start the drag. DragManager.doDrag(dragInitiator, ds, event); } ** just added one line here for a mouse move listener override protected function createChildren():void { super.createChildren(); // Create a checkbox child component for toggling layer visibility. if (!_checkbox) { _checkbox = new CheckBoxIndeterminate(); _checkbox.addEventListener(MouseEvent.CLICK, onCheckBoxClick); _checkbox.addEventListener(MouseEvent.DOUBLE_CLICK, onCheckBoxDoubleClick); _checkbox.addEventListener(MouseEvent.MOUSE_DOWN, onCheckBoxMouseDown); _checkbox.addEventListener(MouseEvent.MOUSE_UP, onCheckBoxMouseUp); _checkbox.addEventListener(MouseEvent.MOUSE_MOVE, onCheckBoxMouseMove); addChild(_checkbox); } if (!_layerMenuImage) { _layerMenuImage = new Image(); _layerMenuImage.source = contextCls; _layerMenuImage.height = 11; _layerMenuImage.width = 11; _layerMenuImage.setStyle("verticalAlign", "middle"); _layerMenuImage.buttonMode = true; addChild(_layerMenuImage); this._layerMenuImage.addEventListener(MouseEvent.CLICK, onLayerMenuImageClick); this._layerMenuImage.addEventListener(MouseEvent.DOUBLE_CLICK, onLayerMenuImageDoubleClick); } } Changed this so it used the text instead of the checkbox for the drag. The drop handler is where it ignores draggin the checkbox or down arrow (these can be dragged but then you have to change the code to get the name of the layer). protected function onTOCItemMouseMove(event:MouseEvent):void { // Get the drag initiator component from the event object. var dragInitiator:TocItemRenderer=TocItemRenderer(event.currentTarget); // Get the color of the drag initiator component. if ('text' in event.target) { // Create a DragSource object. var ds:DragSource = new DragSource(); ds.addData(event.target.text, 'text'); // Call the DragManager doDrag() method to start the drag. DragManager.doDrag(dragInitiator, ds, event); } } public function TocItemRenderer() { super(); addEventListener(MouseEvent.CLICK, itemClickHandler); addEventListener(MouseEvent.MOUSE_MOVE, onTOCItemMouseMove); } --------------------- Remove Layer Code Added in MapSwitcherWidget /* Added by me */ In the initTOC function /* Added for remove button */ AppEvent.addListener("removefromtoc", removeFromWorkingTOC); /* Added by me */ private function removeFromWorkingTOC(event:AppEvent):void { templist.addItem(event.data); } In TOCLayerMenu.mxml (or anywhere you put the button) /* added by me */ public function removeFromListLabel_clickHandler(event:MouseEvent):void { AppEvent.dispatch("removefromtoc", _layer.id); } -------------------- Save Layers TOC (same code is shown in Drag and Drop also /* Added by me */ public var myFileReference2:FileReference = new FileReference(); protected function SaveTOC_clickHandler(event:MouseEvent):void { var myFileReference:FileReference = new FileReference(); myFileReference.save(templist, "filename.txt"); } /* Added by me */ protected function LoadTOC_clickHandler(event:MouseEvent):void { myFileReference2.browse([new FileFilter("TXT File", "*.txt")]); myFileReference2.addEventListener(Event.SELECT, onFileSelected); } /* Added by me */ protected function onFileSelected(e:Event):void { myFileReference2.addEventListener(Event.COMPLETE, onFileLoaded); myFileReference2.load(); } /* Added by me */ protected function onFileLoaded(e:Event):void { var tempArrayC:ArrayCollection = new ArrayCollection(myFileReference2.data.toString().split(',')); templist = tempArrayC; toc2.excludeLayers = templist; } private function mapLayerAddHandler2(event:Event):void { /*Alert.show(templist.getItemIndex(event.currentTarget.id)as String);*/ /*Alert.show(templist[0]);*/ if (templist.getItemIndex(event.currentTarget.id) != -1) { templist.removeItemAt(templist.getItemIndex(event.currentTarget.id)); } /*event.currentTarget.id*/ /*toc2.excludeLayers = templist;*/ /*toc2.map = map; /* toc2.isMapServiceOnly = false; //gotta get this from the config file toc2.excludeLayers = getExcludeLayers(); toc2.basemapLayers = getBasemapLayers(); toc2.excludeGraphicsLayers = true; if (expandLayerItems) { toc2.expandLayerItems(); } */ } <s:VGroup top="100"> <s:Label id="SaveTOC" text="Save TOC to File.." click="SaveTOC_clickHandler(event)"/> <s:Label id="LoadTOC" text="Load TOC from File.." click="LoadTOC_clickHandler(event)"/> </s:VGroup> -------------------------
... View more
01-02-2013
08:18 AM
|
0
|
0
|
463
|
|
POST
|
I have now finished adding Auto Add to Working Set TOC on Visible Checkbox Check in other TOC Ability to add to the Working Set TOC by drag and drop from other TOC A button to remove a layer from the Working Set TOC A Save Current Working Set TOC feature that saves the current state to a local txt file A Load a Saved Working Set TOC feature that loads a saved TOC state from a local txt file I will give the code changes required if anyone wants them. It has not been cleaned up at all. Thanks for all the help.
... View more
01-02-2013
07:37 AM
|
0
|
0
|
3314
|
|
POST
|
I meant in the viewer application. The Widgets tab that has the icons for each widget. The new ones are not in there.
... View more
12-19-2012
06:59 AM
|
0
|
0
|
927
|
|
POST
|
Thanks Anthony. Not exactly sure what you mean though. I have been trying to code the ability to drag a layer from the main large TOC to the Working Set TOC but have not been able to figure it out. It never lets me drag anything. I do not see in your code how that works. I see the part of the map accepting the drag but nothing that allows the drag. It is just beyond me as a newbie I guess. I have it working where a user checks the visible box in the main TOC and it shows up in working set. I am now looking into a way to remove a layer from the Working Set TOC (through an icon or menu item I guess). I also am going to try and find a way to save the list of layers out to a users computer and then be able to add the list back in (saving the session state of the Working TOC basically). Thanks
... View more
12-19-2012
06:56 AM
|
0
|
0
|
3314
|
|
POST
|
Do we need to add the new widgets in manually to the viewer? I see them in the source code but they do not show up as options in the new viewer. Thanks
... View more
12-18-2012
11:36 AM
|
0
|
3
|
2306
|
|
POST
|
I am at a large govt agency so all the servers are handled by an outside contractor and I do not get to have much insight into this. It sounds like they are trying just one large machine but as a former server room guy I have my doubts, lets just say that. I did end up creating a "Working Set TOC". It automatically adds any layer that is made visable during the session. I might also add a Add To option in the main large TOC. The dragging is a cool idea but probably beyond my capabilities as a new Flex guy (I might look into it as a challenge). If you want to see how I got this Working Set TOC to work I posted the code as part of this post - http://forums.arcgis.com/threads/72877-Why-is-Legend-Widget-still-updating?p=255217#post255217 We do have plans for a search function, the autocomplete would be cool, I will have to look into it. We want to add the saving of session info but the policy people will not let us. Thanks for the ideas.
... View more
12-14-2012
05:34 AM
|
0
|
0
|
3314
|
|
POST
|
EDIT: Made it more efficient by only setting listeners for nonbasemap layers. Well I finally found a way to do it. I tried this before I thought but now it works. This shows you how to listen for changes in Layer Visibility and also allows for a "Working Set TOC". This Working Set has just the layers that have been turned on for the current session. It basically adds an event for every layer to listen for FLEX.Show (showing the layer). It also builds a start list that contains all the exclude layers and all the map layers so that the TOC starts blank. Then when the show event kicks it removes that layer from the list of layers to exclude. All checkmarks and such sync in the two TOCs. The move up and down also syncs though, which i do not want. I will work on that. Hope it helps someone. If this is wrong let me know. This is my first Flex work. 1. Copy the MapSwitcherWidget, paste and rename as MapSwitcherWidget2. 2. Add a line so that it compiles the MapSwitcherWidget2 3. In the new MapSwitcherWidget2 modify the initTOC and add a function. These are the changes /* Added by me */ private function mapLayerAddHandler2(event:Event):void { templist.removeItemAt(templist.getItemIndex(event.currentTarget.id)); } private function initTOC(expandLayerItems:Boolean = false):void { toc2.map = map; /* this will also stop layers from being listed */ toc2.isMapServiceOnly = false; //gotta get this from the config file /*toc2.excludeLayers = getExcludeLayers();*/ toc2.basemapLayers = getBasemapLayers(); templist = getExcludeLayers(); var layerlist:ArrayCollection = map.layers as ArrayCollection; for (var j:int = 0; j < layerlist.length; j++) { if (toc2.basemapLayers.getItemIndex(layerlist .id) == -1) { layerlist .addEventListener(FlexEvent.SHOW, mapLayerAddHandler2, false, 0, true); } templist.addItem(layerlist .id); }
... View more
12-07-2012
09:57 AM
|
0
|
0
|
981
|
|
POST
|
I have gone through every line of every file that has to do with the TOC and legend and I still can not find the spot where the legend knows a layer has been turned on. Anyone know where this happens? It is not an event listener since it still works without it somehow.
... View more
12-06-2012
08:47 AM
|
0
|
0
|
981
|
|
POST
|
I am not sure if this will help but when I did a Python Excel script there was a way to check the Excel "cell_type" which is equal to 0 when the cell is blank.
... View more
12-05-2012
12:04 PM
|
0
|
0
|
1335
|
|
POST
|
I thought I was getting this figured out but it is not doing what I thought. In the LegendWidget there is the code map.addEventListener(MapEvent.LAYER_ADD, mapLayerAddHandler, false, 1); map.addEventListener(MapEvent.LAYER_REMOVE, mapLayerRemoveHandler, false, 1); If I comment out this code the legend still updates itself. How does it do this? If I comment out the line myLegend.map = map; after these lines that does stop it from updating the legend. So maybe there is another event buried in the map? Not sure why there would be two. I want to know because I want to add a layer to a second TOC when it is checked in the first one. I thought I would create this event and then work on how to add it to the second TOC (which may be tough since it seems to always connect to the map). Thanks doug
... View more
12-05-2012
11:10 AM
|
0
|
2
|
1367
|
|
POST
|
Thanks Brian. This is actually exactly what we have now. But it is still getting really long with the 300 or layers in there so far. We are looking into a "See More" button to limit the number of layers displayed in each subcategory. Only bummer there is that we will then have to add each layer one by one to the list instead adding the whole map at once. I looked at UI options all day Friday but did not see anything I wanted. Maybe using carousels or as someone drills down the current structure appears at the top. But nothing seems to be a good fit so far. The idea I have now is to leave the TOC like yours and then create a "Working Layers" widget. This would be a TOC for just the current session. That way people do not have to go hunting back through the huge list just to toggle layers. Whenever a layer is turned on in the big list it automatically gets added to the Working Set. A user could also click Add to Working Set in the TOC without turning it on. Anyone done anything like this? Thanks
... View more
12-03-2012
08:08 AM
|
0
|
0
|
3314
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 3 weeks ago | |
| 1 | 11-26-2025 06:23 AM | |
| 3 | 4 weeks ago | |
| 1 | 11-04-2025 02:29 PM | |
| 1 | 11-25-2025 08:12 AM |
| Online Status |
Online
|
| Date Last Visited |
an hour ago
|