|
POST
|
mei76, What you are attempting to do is just a simple spatial query. Look at this example http://resources.esri.com/help/9.3/arcgisserver/apis/flex/samples/index.html?sample=ShowPointsWithinMapExtent It is querying points based on the current maps extent but the principle is the same for your requirements instead of the using the map extent geometry as the spatial portion of the query you would just pass the water catchment polygon to the query and the query would be using the hydrological features as the layer to query.
... View more
06-03-2010
06:37 AM
|
0
|
0
|
1043
|
|
POST
|
jmuguy, Here is an example that I got working from yours. I changed a couple of things. <mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:esri="http://www.esri.com/2008/ags"
layout="vertical" styleName="plain"
pageTitle="GeometryService">
<mx:Script>
<![CDATA[
import com.esri.ags.events.GeometryServiceEvent;
import com.esri.ags.Graphic;
import com.esri.ags.tasks.FeatureSet;
import com.esri.ags.events.QueryEvent;
import com.esri.ags.tasks.Query;
import mx.controls.Alert;
import mx.rpc.AsyncResponder;
import mx.utils.ObjectUtil;
private var graphics1:Array;
private var graphics2:Array;
private function queryCities():void
{
cursorManager.setBusyCursor();
graphics1 = new Array();
var query:Query = new Query();
query.geometry = myMap.extent;
query.where = "OBJECTID <> 0";
query.outFields = ["NAME"];
query.returnGeometry = true;
queryCitiesTask.execute(query,new AsyncResponder(queryCitiesResult,onFault));
function queryCitiesResult(result:FeatureSet,token:Object=null):void
{
for each(var g:Graphic in result.features)
{
graphics1.push(g);
}
queryProvince();
}
}
private function queryProvince():void
{
graphics2 = new Array();
var query:Query = new Query();
query.geometry = myMap.extent;
query.where = "STATE_NAME like '%"+txtInput.text+"%'";
query.outFields=["STATE_NAME"];
query.returnGeometry = true;
queryProvinceTask.execute(query,new AsyncResponder(queryProvinceResult,onFault));
function queryProvinceResult(result:FeatureSet,token:Object = null):void
{
var g:Graphic = result.features[0];
graphics2.push(g);
callLater(doRelate,null);
}
}
private function doRelate():void
{
geoService.relation(graphics1,graphics2,GeometryService.SPATIAL_REL_WITHIN,null);
}
private function onFault(info:Object,token:Object = null):void
{
Alert.show(info.toString(),"ERROR");
cursorManager.removeBusyCursor();
}
private function onRelationComplete(event:GeometryServiceEvent):void
{
var relation:Array = event.relations;
myGraphicsLayer.clear();
//trace(ObjectUtil.toString(relation));
for(var i:int=0;i<relation.length;i++)
{
var g:Graphic = relation.graphic1;
myGraphicsLayer.add(g);
}
cursorManager.removeBusyCursor();
}
]]>
</mx:Script>
<esri:GeometryService id="geoService" fault="onFault(event)" relationComplete="onRelationComplete(event)" url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"/>
<esri:QueryTask id="queryCitiesTask" url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/3"/>
<esri:QueryTask id="queryProvinceTask" url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5"/>
<mx:HBox horizontalAlign="center" width="100%">
<mx:Label id="lab" text="Please input the name" fontWeight="bold"/>
<mx:TextInput id="txtInput" text="Alabama"/>
<mx:Button id="btnQuery" label="Query" click="queryCities()"/>
</mx:HBox>
<esri:Map id="myMap" scaleBarVisible="false" logoVisible="false">
<esri:ArcGISDynamicMapServiceLayer url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer"/>
<esri:GraphicsLayer id="myGraphicsLayer"/>
</esri:Map>
</mx:Application>
... View more
06-03-2010
06:20 AM
|
0
|
0
|
684
|
|
POST
|
Ramkumar, The Banner.mxml is not a module in the project so it will not get it's own swf file compiled. Once you add the Banner.mxml to your SFV project in the src\com\esri\solutions\flexviewer\components folder and then build the project that is it. If you are copying the files over to a webserver than you need to export a release build and copy all the files from the bin-release or to your web server.
... View more
06-03-2010
05:55 AM
|
0
|
0
|
304
|
|
POST
|
Brad, Zahid is correct, it is best just to have your own basemaps when working with your own specific projection. One thing to add to what Zahid said though is you can use ESRI base maps in WGS 1984 that are cached as long as you add them as dynamic map services and not tiled. If you add a cached map service as a dynamic map service then the cache is ignored and ArcGIS Server will reproject on the fly. That being said you have to either specify the Extent with the UTM Spatial Reference or ensure you add your UTM map service as the first layer. The preformance of this app would be hindered though as ArcGIS Server will have to reproject evry map call.
... View more
06-03-2010
04:20 AM
|
0
|
0
|
1412
|
|
POST
|
jmuguy, So the documentation for the 1.3 API states public function relation(graphics1:Array, graphics2:Array, spatialRelationship:String, comparisonString:String = null, responder:IResponder = null):AsyncToken so is your geoService.relation(graphics1,graphics2,GeometrySe rvice.SPATIAL_REL_WITHIN,null); graphics1 and graphics2 of type array or are they graphics if they are just graphics then change to this geoService.relation([graphics1],[graphics2],GeometryService.SPATIAL_REL_WITHIN,null);
... View more
06-02-2010
05:40 PM
|
0
|
0
|
684
|
|
POST
|
Tom, The URL of a query has to have the number of the layer that is to be queried at the end. http://station-01-09/ArcGISServer/rest/services/M3/MapServer needs to be something like http://station-01-09/ArcGISServer/rest/services/M3/MapServer/2
... View more
06-02-2010
11:24 AM
|
0
|
0
|
1501
|
|
POST
|
James, This is very possible you just need these changes. In your config.xml In your LivemapsWidget.mxml
//in init
layerRepeater.dataProvider = getLayers(configData.configWidgets[getId()].livemap);
private function getLayers(livemap:String):Array
{
var layerArray:Array = new Array();
for(var i:Number = map.layerIds.length -1; i >= 0; i--)
{
var layer:Layer = map.getLayer(map.layerIds);
if(!(layer is GraphicsLayer) && layer.name == livemap){ //** added this condition to filter for only livemap
layerArray.push(layer);
toc.includeLayers = livemap;
}
}
return layerArray;
} Your configManager.as
//=================================================
//widgets
var configWidgets:Array = [];
var wList:XMLList = configXML..widget;
for (i = 0; i < wList.length(); i++)
{
var wLabel:String =wList.@label;
var wIcon:String = wList.@icon;
var wConfig:String = wList.@config;
var wPreload:String = wList.@preload;
var wUrl:String = wList;
var wLiveMap:String = wList.@livemap;
var widget:Object =
{
id: i,
label: wLabel,
icon: wIcon,
config: wConfig,
preload: wPreload,
url: wUrl,
livemap: wLiveMap
}
configWidgets.push(widget);
}
configData.configWidgets = configWidgets; The visible layers is a bit more difficult. I have worked on this but have trouble with the toc overriding the ones you want visible with the mapservices default visibility.
... View more
06-02-2010
10:15 AM
|
0
|
0
|
473
|
|
POST
|
khokhar_umair, If you have the source for the Parcel Notification widget in your SFV project then I should be building it when you either debug or run it. Because you are receiving the error you listed tells me that it is not actually rebuilding the ParcelNoticationWidget.swf. The is a common issue when Flex builder encounters an error in the MXML it will not rebuild the swf and when you run or debug you are actually using the old (the one that came with the source code) swf. Do you have the Flash Player debug version? Have you run a "clean" from the project menu. What does your problems window say?
... View more
06-02-2010
08:56 AM
|
0
|
0
|
1555
|
|
POST
|
khokhar_umair, It appears that you have some items in your Sample Flex Viewer that were built using the 3.3 and the 3.2 SDK for Flex. All of the widgets you use in the SFV have to be built using the same Adobe Flex SDK version as well as the same AGS Flex API version. The easy way to ensure this is to always build the whole SFV projects and any widgets you are using. The Parcel notification widget is a pretty good widget but is very complicated and many people have issues getting it setup initially.
... View more
06-02-2010
08:14 AM
|
0
|
0
|
1555
|
|
POST
|
Justin, This can be accomplished by adding LODs to the map. Here is an in depth thread on this. http://forums.esri.com/Thread.asp?c=158&f=2421&t=280475&mc=34#msgid869364
... View more
06-02-2010
07:21 AM
|
0
|
0
|
340
|
|
POST
|
Brendan, This would be possible using something like Flex iFrame but if I remember correctly the issue is more a violation of the google api usage. I vaguely recall that the Streetview had to be opened in a separate window than your application to be compliant.
... View more
06-02-2010
06:33 AM
|
0
|
0
|
610
|
|
POST
|
James, This seems to be a common Flex SDK issue. Here is the workaround. private function searchLayerChangedText():void
{
var i:Number = cboLayerText.selectedIndex;
txtLabelText.text = configSearchText.textlabel;
if (configSearchText.dropdown != "")
{
var ddStr:String = configSearchText.dropdown;
dropdownArr = [];
dropdownArr = ddStr.split(",");
ddVis = true;
DropDownSel.dataProvider = new ArrayCollection(dropdownArr);
DropDownSel.dropdown.dataProvider = new ArrayCollection(dropdownArr);
txtSearch.visible = false;
txtSearch.includeInLayout = false;
} else {
ddVis = false;
DropDownSel.dataProvider = [];
txtSearch.visible = true;
txtSearch.includeInLayout = true;
}
} Notice you have to set the dropdown.dataProvider as well as the normal dataProvider of the combobox.
... View more
06-01-2010
12:00 PM
|
0
|
0
|
467
|
|
POST
|
Carmen, ESRI has still not worked out the point system in this new forum as well as other important issues like actually getting and email notification when someone replys to a watched thread.:(
... View more
06-01-2010
10:22 AM
|
0
|
0
|
445
|
|
POST
|
jmuguy, Here is a sample. The Application: <?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:esri="http://www.esri.com/2008/ags">
<esri:Map id="map" navigationClass="com.esri.ags.samples.MyNavigation">
<esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"/>
</esri:Map>
</mx:Application> The MyNavigation.as File package com.esri.ags.samples
{
import com.esri.ags.controls.Navigation;
import mx.core.UIComponent;
import mx.controls.Spacer;
public class MyNavigation extends Navigation
{
public function MyNavigation()
{
navigationSliderClass = MyNavigationSlider;
}
override protected function addZoomInZoomOutComponents(
zoomInButton:UIComponent,
zoomOutButton:UIComponent
):void
{
zoomOutButton.toolTip = "zoom way out";
zoomInButton.toolTip = "zoom way in";
addChild( new Spacer());
addChild( zoomOutButton );
addChild( zoomInButton );
addChild( new Spacer());
}
}
}
... View more
06-01-2010
10:18 AM
|
0
|
0
|
634
|
|
POST
|
James, The Original and my enhanced Draw widget are expecting a SR that is in Meters not feet. Change the SR to the UTM WKID for your area.
... View more
06-01-2010
05:09 AM
|
0
|
0
|
442
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-06-2020 05:32 AM | |
| 1 | 07-10-2018 05:49 AM | |
| 9 | 01-28-2022 10:58 AM | |
| 1 | 03-28-2022 06:20 AM | |
| 1 | 01-30-2019 07:38 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-01-2025
05:12 AM
|