|
POST
|
Rhett. This is exactly what I did at first and it worked great in my samples. But when I started on the real one I found that I could only exclude whole map services. Robert is correct I am talking about the MapSwitcherWidget. But I am not tied to it. Where is this TOCWidget? Maybe I can use it or just use the code inside of it that is making the exclude work. Edit: I found the widget - Roberts. Robert it looks like you give toc.excludelayers a Object that is the layer name, and id array, and basemap false? Any hint into how you made this work would be great. Thanks
... View more
01-29-2013
04:21 AM
|
0
|
0
|
1741
|
|
POST
|
Someone before me was able to do that - looks like they used this. toc.hideTopLevelItems = hideTopLevelItems; public function set hideTopLevelItems( value:Boolean ):void { _hideTopLevelItems = value; // Propagate this property to child TOC components for each (var toc:TOC in _childTocs) { toc.hideTopLevelItems = _hideTopLevelItems; } }
... View more
01-25-2013
06:31 AM
|
0
|
0
|
1741
|
|
POST
|
Robert. I then can change toc.categories to stop it from showing a tree nest structure right? I am guessing it will still show Map Service name -> Group Name -> Layer Name
... View more
01-25-2013
06:21 AM
|
0
|
0
|
2504
|
|
POST
|
Thanks a lot. I looked at it briefly but I wanted a different UI. Then when i hit the just one layer of a map service issue I had looked at so much stuff I forgot about it. Looks promising. But the issue I see is that it loads feature layers as /FeatureServer/0 but then they are not dynamically rendered like they are with /MapServer (at least if you say MapServer/0 they are not since they you have to say type feature not dynamic). I need to show one layer (sublayer) out of a MapServer in the TOC. So tell it - in this Map Service just put this sublayer in the TOC. Some of our Map Service have 190+ layers and I just want one of those - and since it has 103K polygons it needs to be dynamic. Maybe I can edit that in...
... View more
01-25-2013
06:14 AM
|
0
|
0
|
2504
|
|
POST
|
Thanks this is really close. Is this available in AS? The mxml seems static. I am thinking I would make the TOC just like in ArcMap. So I start with a empty TOC and Map (do not let the code load in the layers from the config.xml). Then when the user clicks on a layer name (which is a sublayer) I then tell the TOC/Map to add that sub layer. In other words the user click tells TOC to go ahead and load sublayer 0 of map service X. (But do not load (or just not show) in the TOC say sublayer 1 of map service X)
... View more
01-25-2013
05:49 AM
|
0
|
0
|
2504
|
|
POST
|
It looks like on demand mode just limits the features to the current extent. The problem is all of these are national layers and I am sure people will turn them on at the national (US) scale often. Zoomed in they are not that slow but full extent the browser can not even load all 100K features. There must be a way because you can make just one layer of a map visible. I am going to look into how the checkbox makes just one layer of the map visible.
... View more
01-25-2013
04:01 AM
|
0
|
0
|
2504
|
|
POST
|
Is there a way to use sublayers for this? So I can have the TOC display just one sublayer of a layer? This would also allow a user to reorder the draw order of sublayers.
... View more
01-24-2013
11:50 AM
|
0
|
0
|
2504
|
|
POST
|
I want to access one layer of a map service to show it in a list. I do not want to add it as a layer using /MapServer/0 in config.xml because then I lose the dynamic display properties that the /MapServer provides. (The layer has 100,000 features so it blows up as a feature layer.) Can I get at it in a Map Service or is there a way to add a just layer in config.xml that is dynamic display wise? Have tried many things. One was to publish a new map service each time but then there are so many map services the server bogs. Second was to use setMaxAllowableOffset as in this post http://forums.arcgis.com/threads/49416-maxAllowableOffset-on-operationalLayers. But the ZOOM_END does not seem to be firing in 3.1. This blog post http://blogs.esri.com/esri/arcgis/2011/06/13/feature-layers-can-generalize-geometries-on-the-fly/ says that this concept is what ArcGIS Online does. In the end all I want to do it be able to list layers multiple times, in multiple places, without having to create another Map Service all the time. In other words granular control over how and where layers (not whole maps) are listed while still keeping the dynamic display properties). Concept: Kinda like ArcGIS Online where I am building a map up from multiple layers, each of which may be in a different map service. Any ideas would be very appreciated, this has been struggled with for some time. thanks
... View more
01-24-2013
10:39 AM
|
0
|
22
|
5511
|
|
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
|
1953
|
|
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
|
2117
|
|
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
|
4211
|
|
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
|
7363
|
|
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
|
670
|
|
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
|
4630
|
|
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
|
1165
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 3 weeks ago | |
| 2 | 3 weeks ago | |
| 1 | 4 weeks ago | |
| 1 | 4 weeks ago | |
| 2 | 03-23-2026 03:44 PM |
| Online Status |
Online
|
| Date Last Visited |
4 hours ago
|