|
POST
|
I Have the same problem, but the solution doesn't work for me. Using the suggested code results in an error: 1120: Access of undefined property numberOfStyleColors. I'm currently still in Flexviewer 2.1, maybe that's the reason?
... View more
05-05-2011
04:46 AM
|
0
|
0
|
1137
|
|
POST
|
Jay, I'm not sure which problem you're referring to, I've mentioned at lest two in this thread 😃 First post was about the application didn't work at all on some computors even though they had flash player 10 or higher installed. I haven't done anything to solve this, but haven't heard of that problem from anyone for a long time now. Second post was about not being able to open the application at first but it worked when I opened a second browser window. That was something in my changes to my mapmanager.mxml, I don't know exactly what because I didn't got any errors in flashbuilder, but I changed back to some older code and rewrote it a bit different and got it working after that. Maybe this wasn't very helpful but it's all I can say.
... View more
04-19-2011
11:07 PM
|
0
|
0
|
1147
|
|
POST
|
Any plans to add support for WFS in the API and the Flex Viewer? I would like to see that.
... View more
04-06-2011
07:03 AM
|
0
|
0
|
1448
|
|
POST
|
Shannaka, I guess normally you could use the fetchSharedData() in the init function, I use it a bit later because I call a few other functions in my init functions that creates some components and set there values based on info in the config file. But the important thing is that you've added the eventlistenter ( ViewerContainer.addEventListener(AppEvent.DATA_SENT, sharedDataUpdated); ) before you call fetchSharedData(), it's used just to trigger that event.
... View more
03-20-2011
11:47 PM
|
0
|
0
|
2180
|
|
POST
|
Thanks for all your help Robert! After I added the call to fetchSharedData() in widget2 it works great.
... View more
03-17-2011
01:12 AM
|
1
|
0
|
2180
|
|
POST
|
Robert, I added the event listener to the init of widget2 and the function to that event listener. But still it doesn't work, the function never runs. My knowledge about AppEvents are limited, but I'm thinking that the event listener is added after the event is dispatched and therefor nothing happens. But if this code work for you, I guess it should work for me to, but it doesn't... What's the difference between AppEvent.DATA_PUBLISH and AppEvent.DATA_SENT? The data that is added from addSharedData in widget1 has to be stored somewhere, is there no way to access it from widget2 without any event listeners??
... View more
03-16-2011
12:28 AM
|
0
|
0
|
2180
|
|
POST
|
Robert, No I still can't achieve all I want. If I Have my two widgets open then there is no problem for widget1 to send data to widget2 that uses the data to perform a findtask. But If widgets2 is not loaded it loads but don't perform any findtask. I want it to load and receive the data and perform the findtask. If widget2 is loaded once and then closed so the state of the widget is closed it works fine, but the problem is when the widget never have been opened/loaded during the session. I've tried to use some fetchSharedData() code at the creationComplete event for widget2 to see if there is any data with my key in shareddata, but I can't fetch any data, don't know how to use the fetchSharedData. (I saw another thread about a bug in Datamanager.as, made that change but it didn't changed anything for me).
... View more
03-15-2011
05:28 AM
|
0
|
0
|
2180
|
|
POST
|
Thanks Robert! That was it, I didn't see that part in any code in previous posts.
... View more
03-11-2011
05:15 AM
|
0
|
0
|
940
|
|
POST
|
Hi! This thread helped me to communicate between widgets, I'm sending a graphic from one widget to another which use the graphic as input to an identifyTask. This works fine as long as both widgets are opened. If the user haven't opened the second widget yet I want to open that widget and send the graphic. I can open the widget (but I have to hardcode the widget id, the getWidgetId function doesn't work for me, but that's another question I asked in another thread). But if the widget is just opened it obviously didn't had time to add the eventlister and litsen to the AppEvent.DATA_PUBLISH, so nothing happens, the user has to do the same request again. Any ideas how to accomplish to open a widget and sending data to it at the same time (or at least without any user input after the widget is loaded??
... View more
03-11-2011
05:09 AM
|
0
|
0
|
2180
|
|
POST
|
Hi, I'm trying to use this code to open a widget from another, I've added the code to my ViewerContainer, but when I'm trying to access the ViewerContainer.getWidgetId function from another widget I get an error. 1061: Call to a possibly undefined method getWidgetId through a reference with static type Class. What could I be doing wrong here, it is a public function and I have an import for com.esri.viewer.ViewerContainer in my widget but still I can't get to that function.
... View more
03-10-2011
11:35 PM
|
0
|
0
|
940
|
|
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
|
599
|
|
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
|
4216
|
|
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
|
417
|
|
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
|
386
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-29-2025 02:59 AM | |
| 1 | 01-13-2025 02:57 AM | |
| 2 | 04-14-2025 04:49 AM | |
| 2 | 09-18-2025 05:51 AM | |
| 1 | 08-28-2025 12:21 AM |
| Online Status |
Offline
|
| Date Last Visited |
03-23-2026
05:14 AM
|