POST
|
I haven't done this, but I do save visible layers when user close the appliaction and load them when the user opens it again. The code I use for saving och loading visible layers might help you. Saving visible layers to SharedObjects: settingsSO = SharedObject.getLocal("HlsbgSettings");
var map:Map = ViewerContainer.getInstance().mapManager.map
acVisLayers = new ArrayCollection();
MapUtil.forEachMapLayer(map, function(layer:Layer):void {
var layVisAc:ArrayCollection;
if (layer is ArcGISDynamicMapServiceLayer) {
layVisAc = ArcGISDynamicMapServiceLayer(layer).visibleLayers;
} else if (layer is ArcIMSMapServiceLayer) {
layVisAc = ArcIMSMapServiceLayer(layer).visibleLayers;
} else if (layer is ArcGISTiledMapServiceLayer) {
layVisAc = ArcGISTiledMapServiceLayer(layer).visibleLayers;
}
var lvisObj:Object = {
name: layer.name,
visible: layer.visible,
visarray: layVisAc
}
acVisLayers.addItem(lvisObj);
});
settingsSO.data[VISLAYERS] = acVisLayers;
settingsSO.flush();
visible layers from SharedObjects: settingsSO = SharedObject.getLocal("HlsbgSettings");
if (settingsSO.size > 0) {
var acVisLayers:ArrayCollection = settingsSO.data.vislayers as ArrayCollection;
if (acVisLayers.length > 0){
MapUtil.forEachMapLayer(map, function(layer:Layer):void {
var cLayId:int = 0;
for(var i:Number=0; i < acVisLayers.length -1;i++)
{
if(acVisLayers.name == layer.name)
{
cLayId = i;
break;
}
}
if (layer is ArcGISDynamicMapServiceLayer) {
layer.visible = acVisLayers[cLayId].visible;
ArcGISDynamicMapServiceLayer(layer).visibleLayers = acVisLayers[cLayId].visarray;
} else if (layer is ArcIMSMapServiceLayer) {
layer.visible = acVisLayers[cLayId].visible;
ArcIMSMapServiceLayer(layer).visibleLayers = acVisLayers[cLayId].visarray;
} else if (layer is ArcGISTiledMapServiceLayer) {
layer.visible = acVisLayers[cLayId].visible;
}
});
}
}
} (The code is actually from something Robert Scheitlin wrote for SFV 1.3 that I've modified just a little bit to work in my SFV 2.1)
... View more
02-22-2011
10:16 PM
|
0
|
0
|
254
|
POST
|
Thanks for this! I already have a copy XY contextmenu, and a tool for GoTo XY, and don't really need the projecting. But still this one is very useful because now I can use this widget with a few modifications instead of adding a lot of code in the main application like mapmanager and other files which i try to avoid as much as possible. Great work! thanks again.
... View more
02-18-2011
02:46 AM
|
0
|
0
|
1680
|
POST
|
If you're using och spatial reference where the distance is equal to sqrt((x1-x2)^2 + (y1-y2)), you could use that and some mouseEvents (like MouseEvent.MOUSE_MOVE and MapMouseEvent.MAP_CLICK) and event.stageX, event.stageY along with toMapFromStage.
... View more
02-17-2011
06:56 AM
|
0
|
0
|
129
|
POST
|
Maybe this sample is what you're looking for? http://help.arcgis.com/en/webapi/flex/samples/index.html?sample=NavigationTools
... View more
02-17-2011
06:38 AM
|
0
|
0
|
163
|
POST
|
The idea has crossed my mind, I think that would be great enhancement to the splash screen. I guess on of the problem is that if you don't want it to show, you don't want the widget to load at all, which probably means that you can't add all the code to the widget it self.
... View more
01-25-2011
08:49 PM
|
0
|
0
|
500
|
POST
|
I have a question about the saving part. When the dialog for saving the file opens the user can either just accept to default file name with the extension .txt and everything is fine. But I'm guess many users want to change the name and probably won't add the extension because they're expecting the correct extension to be added anyway. But it doesn't cause you're not saving the file as a specific file type, and then you wont be able to open it when the file filter does exists in the opening dialog. I googled this and I didn't find anything official from Adobe, but in some forums people are saying that it is impossible to specify file type when saving because it could be a security risk (to save exe-files for example). Is there anyone who has looked into to this and found some solution or do I just have to accept that this is how it works?? It's exactly the same thing in the PDFWidget when saving the pdf file. It annoys me.
... View more
01-21-2011
05:03 AM
|
0
|
0
|
455
|
POST
|
I've only tested on one other computer that had the problems, but the default viewer seems to work. I also tested to compile the sourcecode of the 2.1 Viewer that my application is based on and that also worked. So I guess I must have screwed up the code somewhere. It's difficult to find out where when everything works fine on my computer (and some others).
... View more
01-18-2011
10:03 PM
|
0
|
0
|
435
|
POST
|
I haven't really solved the problem yet, and now I'm having really weird problems which I don't know if they're related to the problems above. However, we released our customized FlexViewer in our organisation yesterday, and for some reason it just doesn't work on some computers. The weird thing is that on a few computers an older version works but not the new one (just made some small changes and added a couple of more widgets between those versions). And that the new version might actually work if you open it twice. I tested this on two different computers that had problems, opening the link to my application i get a blank window (we're using firefox 3.6) the status bar shows "reading fpdownload.adobe.com" but nothing happens. (My messages is in swedish so I'm not sure if it actually says "reading" or if something similar). But if I leave that firefox-window as it is and open a new one, then the application works in the new window, and I can go to the first one and refresh and it will work. After closing all windows i have to do the same thing again. I really can't understand what is causing this, is there anyone who do? I guess it isn't a FlexViewer och ArcGIS API for flex problem so maybe I should be asking somewhere else, does anyone has some tips on where to turn? could it be a flex issue or a flashplayer issue or something else?
... View more
01-18-2011
04:49 AM
|
0
|
0
|
435
|
POST
|
I wanted this functionality in my customized FlexViewer 2.1, and thought I could try this code from Robert. I copied the changes that Robert made to the files, and pasted the into the corresponding places in my code and then step by step got rid of the errors (caused by using SFV 1.3 code in SFV 2.1). Then I was actually surprised to see that it seems to be working fine; extent, turned on layers and even the check-boxes in my TOC. I would also like to be able to save which widget that are open, does anyone know how to do that? I'm guessing the first thing I need to know is how to programatically identify which widget that are opened and closed and then programatically open widgets.
... View more
01-07-2011
01:21 AM
|
0
|
0
|
1031
|
POST
|
You could use the change event of the comboBox, something like this: <mx:ComboBox id="cbxTeam" prompt="select a team" selectedIndex="-1" dropdownWidth="150" horizontalCenter="0" top="20" change="doTeamQuery()" > The doTeamQuery function will fire up when user selects an item (that isn't already selected).
... View more
12-29-2010
09:26 PM
|
0
|
0
|
269
|
POST
|
Since you already have a slider working for one basemap, you could try something like this: Change the maximum of the slider to 2 and use this code on the change event. if (fader.value < 1){ basemap3.alpha = 0; basemap1.alpha = 1 - fader.value; }else{ basemap1.alpha = 0; basemap3.alpha = fader.value - 1; } With this code you need all of your basemaps to be visible and basemap1 ans basemap3 need to be on top of basemap2. (fader is the id of the slider). This was just a quick test (I only use basemaps in my application), there's probably a lot of improvements to do, but it's a start.
... View more
12-09-2010
10:16 PM
|
0
|
0
|
359
|
POST
|
Thanks, but that doesn't help me. I have a working printing functionality, but just like David described above I think it would be nice to be able to print in a larger format that is larger than the screen size (and not just get an small picture that is re-sized which doesn't look good at all). Tony mentioned using "the export method (rest) on each mapservice, you can pass in whatever extents you want." And this is what I'm asking about, if anyone has tried that successfully.
... View more
12-08-2010
09:48 PM
|
0
|
0
|
1302
|
POST
|
In the HeaderControllerWidget.mxml change the height of <s:Group id="headerGroup" .... > So you need to change to source-code and recompile, it's not configurable in any xml file.
... View more
12-08-2010
09:32 PM
|
0
|
0
|
311
|
POST
|
Has anyone tried this method for printing? If I would try something like that, would it be possible to include graphicLayers and scalebar and things like that from the FlexViewer??
... View more
12-07-2010
09:29 PM
|
0
|
0
|
1302
|
POST
|
Have you looked at this sample http://help.arcgis.com/en/webapi/flex/samples/index.html?sample=FeatureLayerClustering ? maybe that is something you can use...
... View more
11-25-2010
09:09 PM
|
0
|
0
|
212
|
Title | Kudos | Posted |
---|---|---|
1 | 10-14-2015 01:59 AM | |
1 | 06-13-2024 12:31 AM | |
2 | 03-28-2024 01:07 AM | |
1 | 03-27-2024 04:09 AM | |
1 | 06-13-2024 12:22 AM |
Online Status |
Offline
|
Date Last Visited |
Friday
|