|
POST
|
You could try and wrap your request in a try ... catch block to catch the Security exception, or you could attempt to download the policy file to see if it exists before you load the layer using URLLoader and using its events for example: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLLoader.html?filter_flex=4.1&filter_flashplayer=10.1&filter_air=2 Thanks Michael, I've actually tried both your suggestions and got stumped on both accounts. With the try/catch block... I put "map.addLayer(layer)" in the try section and the catch never got triggered, even though I still got the crossdomain.xml exception at runtime. So I'm not to sure which code should be going in there. In terms of the URLLoader example, I tried a solution based on that exact example and was having an issue with the load taking so long... The error event would eventually fire but only after a lengthy URL load timeout window... by that time, the app is up and the user is interacting, which would lead to a mess of code changes to enable and disable various controls that are linked to that map service. In other words, if you have to wait the 30+/- seconds for the request to timeout (looking for the non existent server) all kinds of goofiness ensues because the user is already into the app and interacting. -Royce
... View more
12-28-2010
02:17 PM
|
0
|
0
|
687
|
|
POST
|
I've got a reference to a map service that is hosted by an external agency and today their server was down. LayerEvent.LOAD_ERROR fires but too late... after the crossdomain.xml security exception is thrown (because it can't be loaded if no server is present). I'm not quite sure the best way to handle this and hoping someone has dealt with this and can offer some suggestions. Thanks, -Royce
... View more
12-28-2010
12:47 PM
|
0
|
4
|
1119
|
|
POST
|
Mehul, that worked great. I was able to remove a couple fields from the AttributeInspector using similar method to your example... setting the visible property on the fieldInspectors to false. Now, I'd like to programmatically populate the values of those "hidden" fields of newly created features before they get committed back to the database. What would be your suggestion for doing so? Thanks, -Royce
... View more
12-23-2010
01:44 PM
|
0
|
0
|
1000
|
|
POST
|
Thanks. I'll give it a try. Looks like the piece I was looking for was this, Which certainly seems straightforward enough: var attributeInspector: AttributeInspector = myEditor.attributeInspector; attributeInspector.featureLayers = [incidentsAreas] attributeInspector.fieldInspectors = [fieldInspector2,fieldInspector1] Basically, just grab a reference to the default attributeInspector and reassign some new FieldInspectors. Nice. Will post back with results. -r
... View more
12-23-2010
09:46 AM
|
0
|
0
|
1000
|
|
POST
|
I've got an app with Editor and default AttributeInspector but would like to basically do what this Attribute Inspector (edit) sample does in terms of a custom AttributeInspector. However, the sample only updates existing features and isn't wired to an Editor. Is there a way to simply point existing Editor to a custom AttributeInspector? I would like to remove (or possibly just disable) a couple fields from the Attribute Inspector and populate those programatically when a new feature is created or when an existing feature is updated.
... View more
12-22-2010
12:46 PM
|
0
|
14
|
4261
|
|
POST
|
Is there ability to change the legend symbol "patch"? For example, for line features, instead of a straight horizontal line, can we choose a zig zag line? For polys, instead of a rectangle, use a rounded shape? I know, the masses are never satisfied.
... View more
12-13-2010
08:03 AM
|
0
|
0
|
455
|
|
POST
|
This works for me too: <?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:esri="http://www.esri.com/2008/ags">
<esri:Map id="map">
<esri:WMSLayer id="weatherMap" url="http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi">
<esri:visibleLayers>
<s:ArrayList>
<fx:String>nexrad-n0r</fx:String>
</s:ArrayList>
</esri:visibleLayers>
</esri:WMSLayer>
</esri:Map>
</s:Application> Can you show more of your Map code like what is the base layer and what is the Map's extent and spatial reference? I played my moron card for the day. I forgot about ye old spatial reference. Base layer is in state plane. Thanks for your time guys.
... View more
12-08-2010
12:48 PM
|
0
|
0
|
311
|
|
POST
|
Trying to get WMSLayer to work using the following mxml. Does anyone have the trick? In the console window I get this repeating message until I kill the session. [SWF] /cgi-bin/wms/nexrad/n0r.cgi - 0 bytes after decompression
<esri:WMSLayer id="weatherMap" url="http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi"
visibleLayers="{new ArrayList(['nexrad-n0r'])}" />
... View more
12-08-2010
12:19 PM
|
0
|
3
|
705
|
|
POST
|
Not sure the cause, but if I create a new Flash Builder project/application, add a map instance and go to Design View, it works. The problem must lie somewhere in my current project which is upgraded/imported from an api 1.3/sdk 3.5 project. I am using 2.1 api and 4.1 sdk so I'm not sure what details under the hood are borked. It definitely only occurs in components that contain a Map instance. Odd. I'll try to look into it as time permits.
... View more
12-02-2010
07:06 AM
|
0
|
0
|
250
|
|
POST
|
I thought this was fixed upon 2.0 release but Map doesn't seem to be compatible with Design View again. I'm using SDK 4.1, API 2.1. Thanks, -Royce
... View more
12-01-2010
01:43 PM
|
0
|
2
|
624
|
|
POST
|
Maybe you already know, but that is what the Bookmark Widget in the ArcGIS Viewer for Flex does. Thanks Bjorn, I've not actually looked at the viewer for some time but perhaps should at some point. -r
... View more
09-16-2010
12:39 PM
|
0
|
0
|
757
|
|
POST
|
I created a singleton class: "ApplicationSettings.as"...
package org.larimer
{
import flash.net.SharedObject;
public class ApplicationSettings
{
// module level vars
private static var _instance:ApplicationSettings;
private var _so:SharedObject;
// constructor
public function ApplicationSettings(enforcer:SingletonEnforcer)
{
_so = SharedObject.getLocal("applicationSettings");
}
public static function getInstance():ApplicationSettings
{
if(ApplicationSettings._instance == null)
{
ApplicationSettings._instance = new ApplicationSettings(new SingletonEnforcer());
}
return _instance;
}
// public properties
// scale
public function get scale():Number
{
return _so.data.scale;
}
public function set scale(value:Number):void
{
_so.setProperty("scale", value);
}
//more properties
...
}
}
class SingletonEnforcer{}
Then reference the class in the various components: private var _applicationSettings:ApplicationSettings = ApplicationSettings.getInstance(); To persist the map scale property: _applicationSettings.scale = map.scale; To retrieve the scale upon app load: map.scale = _applicationSettings.scale; That's the basic concept. Map scale is an easy property to deal with but that's the idea. Good luck, -r
... View more
09-16-2010
12:37 PM
|
0
|
0
|
757
|
|
POST
|
Ok, the SharedObject class works very well. I created an "ApplicationsSettings" class that sets/gets all the appropriate values throughout the app. That class then manages the SharedObject. Then when the app loads in subsequent sessions, it checks the applicationsSettings properties and applies them where needed. I now have an app that holds all the map settings (scale, layers turned on, map center, other settings) between sessions, if the user turns that feature on. When the user turns that off, the app clears the SharedObject (through the ApplicationSettings class) and sets all app settings back to defaults. Next SharedObject task... bookmarks. Very nice. Thanks again Dasa. -r
... View more
09-15-2010
02:22 PM
|
0
|
0
|
757
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-21-2020 10:08 AM | |
| 1 | 05-30-2018 02:39 PM | |
| 5 | 02-13-2015 10:07 AM | |
| 3 | 12-03-2019 09:48 AM | |
| 1 | 10-22-2015 01:15 PM |
| Online Status |
Offline
|
| Date Last Visited |
03-24-2021
06:29 PM
|