|
POST
|
There's a zillow api where you can sign up for an id to make REST requests to various web services. The results include a Lat/Long, so you could display them with the Flex API. There's a limit of 1000 per day though, after that I think you have to pay to make more requests.
... View more
01-19-2011
11:54 AM
|
0
|
0
|
389
|
|
POST
|
It wasn't up this morning when Robert posted, but I just submitted my widgets and seems to work fine. Is there a page where we can see what we submitted? Or will it just warn us that the link was already submitted? I only ask, because I almost submitted a widget twice while I had a dozen browser tabs open. Thanks and this is kind of fun.
... View more
01-19-2011
09:16 AM
|
0
|
0
|
1706
|
|
POST
|
There was a case Dasa before the latest release fixed the clearing lod issue where I could have probably worked around it by overriding the map_extentChangeHandler() of Map to check the given extent before doing a super.map_extentChangeHandler(). As far as I can tell, it's a private function.
... View more
01-13-2011
07:29 AM
|
0
|
0
|
986
|
|
POST
|
You can do that because FeatureLayer is a subclass of GraphicsLayer http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/FeatureLayer.html It inherits all the methods/fields of a GraphicsLayer, but some such as clear have been overriden so they don't do anything.
... View more
01-12-2011
07:53 AM
|
0
|
0
|
541
|
|
POST
|
FlexViewer can't natively load shapefile data, but someone made a widget that might help. http://www.arcgis.com/home/item.html?id=bc6a88cf51364d9ea767347954363d7d
... View more
01-12-2011
06:18 AM
|
0
|
0
|
534
|
|
POST
|
If you set up your xml config file to let you know the Layer type, "dynamic", "tiled", etc, you can iterate through your list, create layers, then iterate through the layers to get the layerinfos.
... View more
01-12-2011
06:04 AM
|
0
|
0
|
2085
|
|
POST
|
I have a widget with some functionality that can load services via a config.xml that might help. http://www.arcgis.com/home/item.html?id=ca9e4de998714d07a6bdc59ededa0efc
/**
* Takes URL for a ArcGIS Server Rest directory and
* will attempt to extract the SiteMap.
* @param directory
*/
protected function loadServices(servername:String):void
{
var service:HTTPService = new HTTPService();
var sitemap:String = "/ArcGIS/rest/services/?f=sitemap";
var url:String = "http://" + servername + sitemap;
service.url = url;
service.resultFormat = "e4x";
var token:AsyncToken = service.send();
token.addResponder(new AsyncResponder(onServiceResults_handler, onFault_handler));
}
/**
* Handles the results of accessing the SiteMap.
* @param event
* @param token
*/
protected function onServiceResults_handler(event:ResultEvent, token:Object = null):void
{
var xml:XML = event.result as XML;
var xmlColl:XMLListCollection = new XMLListCollection(xml.children());
var list:Array = [];
var qn:QName = new QName(sitemapNS, "loc");
var sxml:XML;
for each (sxml in xmlColl)
{
var url:String = sxml[qn].text();
var tmp:Array = url.split("/");
var i:uint = tmp.length;
if (tmp[i-1] == "MapServer")
{
var item:ServiceItem = new ServiceItem();
item.serverType = tmp[i-1];
item.name = tmp[i-2];
item.url = url;
list.push(item);
findServiceDetails(item);
}
}
list.sortOn("name");
dataList = new ArrayList(list);
vUrls = new Vector.<String>(list.length);
servicesList.dataProvider = dataList;
}
/**
* Parses <code>ServiceItem</code> object url to find layer details
* in service REST.
* @param item
*/
protected function findServiceDetails(item:ServiceItem):void
{
var jsonurl:String = "?f=json&pretty=false";
var url:String = item.url + jsonurl;
var srv:HTTPService = new HTTPService();
srv.url = url;
srv.resultFormat = "text";
var token:AsyncToken = srv.send();
token.addResponder(new mx.rpc.Responder(onJSONResult_handler, onFault_handler));
function onJSONResult_handler(event:ResultEvent):void {
var data:String = event.result.toString();
// this regex replace can be used to make parsing the JSON faster.
// It removes spaces, but it will mess up service description.
//data = data.replace( /\s/g, '' );
var details:Object = JSON.decode(data);
item.description = details["serviceDescription"];
if (!details["singleFusedMapCache"])
item.type = DYNAMIC;
else
item.type = TILED;
}
}
This will get you as far as loading the individual URL's for each service in a server, like "sampleserver1.arcgisonline.com", then you can create a layers using the URL and pull out the Layer info via layerInfos. I have a function for another tool that does just that.
/**
* Will find all the items that make up a given map service layer.
* @param lyr
*/
protected function findLayerDetails(lyr:Layer):void
{
if (layers)
layers.removeAll();
layers = new ArrayList();
var layerInfos:Array;
layerIDSet = null;
layerIDSet = {};
if (lyr is ArcGISDynamicMapServiceLayer)
layerInfos = ArcGISDynamicMapServiceLayer(lyr).layerInfos;
else if (lyr is ArcGISTiledMapServiceLayer)
layerInfos = ArcGISTiledMapServiceLayer(lyr).layerInfos;
else if (lyr is FeatureLayer) {
var lyrId:int = FeatureLayer(lyr).layerDetails.id;
var lyrName:String = FeatureLayer(lyr).layerDetails.name;
layerIDSet[lyrName] = lyrId;
layers.addItem(lyrName);
}
if (layerInfos)
{
var info:LayerInfo;
for each (info in layerInfos)
{
layerIDSet[info.name] = info.id;
layers.addItem(info.name);
}
}
}
... View more
01-12-2011
05:54 AM
|
0
|
0
|
2085
|
|
POST
|
I have a CollapseContainer skinnable container that I use that can be tweaked via the skin. https://gist.github.com/773635 Here is the Skin I use to collapse the container on the left of the of the page to a small bar. https://gist.github.com/773640 Not at work at the moment, so I can't get a screenshot of how it works, but you pretty much let the skin do the work to resize and move the parts.
... View more
01-10-2011
12:57 PM
|
0
|
0
|
2024
|
|
POST
|
We recently had a need to build a Batch Geocoder tool that we could use to verify some addresses against our internal GeocodeServer service. This started as an AIR application I built in my spare time, but decided to modify it to work with Flexviewer. It's a tool we might use in our internal Flexviewer app, and I thought others might find a use for it. It will let you upload a dbf file of addresses, geocode them, give you the closest address found and the score, then export those results to an Excel file. http://www.arcgis.com/home/item.html?id=c663df2846d04a6b9add92b66c637728
... View more
01-07-2011
11:10 AM
|
0
|
12
|
2494
|
|
POST
|
Have you ever had a user ask if they could just label an item on the map by some arbitrary attribute without manually typing anything in? No? Damn, well I have, sucks for me. Anyway, I had this tool already built as a standalone component, but decided to throw it into a widget so we could use it in a generic Flexviewer app that we have. http://www.arcgis.com/home/item.html?id=c09a6d1fd0514b36a761a29b11b60047 It basically works like this. Select a service from the Map. Select a layer from the selected Service. Select a field from that layer. Click add label and click on a feature in the layer. To get back to a different Service or Layer, click on the corresponding buttons above the list. The tool uses the IdentifyTask so that I could use the tolerance capabilities for point features (big deal for me), so it only works with Services that support Identify. So no FeatureServer services, sorry. If I get around to it, I might be able to add QueryTask functionality for those special use cases, if it seems like a big deal for folks.
... View more
12-28-2010
12:40 PM
|
0
|
0
|
868
|
|
POST
|
You can try wrapping it in a CDATA block visible="<![CDATA[{myMap.scale < 4500}]]>"
... View more
12-27-2010
06:15 AM
|
0
|
0
|
547
|
|
POST
|
The API docs can give you some insight on when you would use FeatureLayer http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/FeatureLayer.html
The feature layer can be used to display features from one single layer of either a Feature Service or a Map Service. The layer can be either a (spatial) layer or a (non-spatial) table. The features in a FeatureLayer can be edited if it is based on a Feature Service.
If the layer supports attachment, the layerDetails (or tableDetails) "hasAttachment" property will be true. If the feature layer is editable and has attachment, you can also add and delete attachments.
So if you want to do editing, use temporal features, FeatureLayer is your choice. FeatureLayer is essentially a GraphicsLayer with some sugar, i.e., built in QueryTask. You wouldn't use DynamicMapServiceLayer directly, as it is a base class. http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/DynamicMapServiceLayer.html But what it does allow you to do is something like if (layer is DynamicMapServiceLayer)
{
// do something to apply to all subclasses
}
//as opposed to writing
if (layer is ArcGISDynamicMapServiceLayer || layer is ArcGISImageServiceLayer || layer is ArcIMSMapServiceLayer || layer is GPResultImageLayer || layer is WMSLayer)
{
// do the same thing
} You can view the Layers in the layers package here, each with some some descriptions http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/package-detail.html
... View more
12-23-2010
10:54 AM
|
0
|
0
|
791
|
|
POST
|
I don't have a widget, but I did make a Magnify component for my projects that could pretty easily be turned into a widget. This is the Skinnable Component https://gist.github.com/753059 This is the TitleWindow with some methods to pass the MagnifyWindow when you move it around the screen. https://gist.github.com/753061 It basically accepts your main map as the source map to know the current location of the window on the screen. You add a "Detailed" layer, in my case I use some high resolution imagery we have in-house. You can then add "Operational" layers to view on top of your "Detailed" layer. All layers have to be Dynamic so that you can zoom in as far as you want. I'll clean it up and add it to my FlexMapTools library at some point, but pretty busy this time of year. Hope that helps.
... View more
12-23-2010
04:48 AM
|
0
|
0
|
1478
|
|
POST
|
You can add an eventListener to each graphic in the arraycollection,then when it gets clicked, save that item so that when you click on delete you can find it in the ArrayCollection. So, something like this. var graphic:Graphic = event.currentTarget as Graphic;
var i:int = arrayCollection.getItemIndex(graphic);
arrayCollection.removeItemAt(i);
... View more
12-14-2010
01:20 PM
|
0
|
0
|
797
|
|
POST
|
I have only done some CF work in my home dev environment, but using CF remote calls in with the current Flex API/Flexviewer should be no different than you did with the 1.x version. Add your CF destinations to your services-config.xml and Flex will handle the rest. In Flashbuilder, if you like the code generation, there is a Connect to ColdFusion option to connect to remote services.
... View more
12-10-2010
07:01 AM
|
0
|
0
|
378
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 2 weeks ago | |
| 2 | 3 weeks ago | |
| 1 | 02-27-2026 06:31 AM | |
| 1 | 01-13-2026 02:15 PM | |
| 1 | 12-31-2025 09:05 AM |
| Online Status |
Offline
|
| Date Last Visited |
a week ago
|