POST
|
Over night, one of my tools stopped working when it makes a call for a Remove Overlap task. . I can't think of any changes that have been made which would affect this, and everything looks good in my code. I am wondering if anyone has any insight on the error I am receiving? Thanks in advance! Image below. [ATTACH=CONFIG]18207[/ATTACH]
... View more
10-04-2012
11:06 AM
|
0
|
0
|
728
|
POST
|
Hello everyone, I am trying to get mouseover tips working in my flex viewer...example here: http://help.arcgis.com/en/webapi/flex/samples/index.html#/InfoWindow_on_MouseOver/01nq0000001q000000 Could someone explain how to best incorporate this code into the viewer? What widget does it go in, or somewhere else? Does ESRI have a page I am missing with instructions on how best to use their samples? Thanks in advance Sean
... View more
08-24-2012
03:10 PM
|
0
|
0
|
497
|
POST
|
Tried that out and got the same error: File not found: file:/C:/Users/228972/Adobe%20Flash%20Builder%204.5/flexviewer-3.0pr/bin-debug/index.html That does create the bin-debug folder properly, but no index.html for some reason. Is index.html created on import or when you first compile the project? Thanks for the help!
... View more
05-09-2012
09:17 AM
|
0
|
0
|
245
|
POST
|
Hello all, I am having some trouble creating a new Flexviewer instance, and I am not sure why. My guess is that I am missing something straightforward. I possibly have two problems. A. I CAN create a v.2.5 Flexviewer on my C: drive. B. I Cannot create a v.3.0 Flexviewer on my C: drive. I get an error on trying to run it stating: "File not found: file:/C:/Users/228972/Adobe%20Flash%20Builder%204.5/TestViewer/bin-debug/index.html" C. I cannot create either on my network drive, where I would like to have it. When I click to import, it does not ask me which SDK version I would like to use. It fails to add the new viewer to the Package Explorer, and puts a subset of the files into the appropriate folder, but not all of them. It leaves out the folders .settings and bin-debug. Any help is much appreciated!
... View more
05-08-2012
04:14 PM
|
0
|
4
|
721
|
POST
|
Hi Sean, It is possible that you need to install the BA Server Upload Components onto the desktop machine. Try installing them from DVD #3 from the BA Server media. If this is not the case, I can describe how to manually upload them to BA Server for you. Let me know how it goes. Chris Thanks Chris! I'll give that a shot. I'd love to know how to manually upload them anyways, if you don't mind.
... View more
04-27-2012
08:32 AM
|
0
|
0
|
506
|
POST
|
Hello all! I have been trying to upload custom business analyst reports, and am having trouble. The only instructions I have found are either out of date or don't work properly. I am getting stuck when I am told to right click on Default Project in ArcCatalog and click upload project. That option is greyed out, and I can't find any info on why that would be except some permissions issues I don't think are a problem (but could be). I have successfully done this in the past, and I can see a few custom reports on the server when I use the getReportTemplates task. They work fine, I just don't recall how I did it. I feel like this is not the way I originally accomplished this task, and I did not have to tangle with permissions/IIS, etc, as I recall. Is there a second method? I swear I figured this out and uploaded multiple reports in an hour last time I tried, but now it's a puzzle.
... View more
04-26-2012
02:56 PM
|
0
|
3
|
3616
|
POST
|
Chris...thank you so much for the time you put into this. It's obvious you did a ton of work and I really appreciate it. I think there may be something wrong with our BAServer...although I cannot guess what. When I switch the client.url to our own, instead of the normal results, it acts as if it completed the task correctly but zooms in to a ridiculously large scale dead center off the west coast of Africa. With your server it works perfectly. When I put our respective server names into a web browser, they take me to identical screens (except for the map name). Based on that simple diagnostic mine is running fine. Has the remove overlap task listed correctly, etc. Is there a known reason my BA server client would behave like that?
... View more
04-13-2012
03:57 PM
|
0
|
0
|
1418
|
POST
|
So has anyone ever gotten this to work independently? Even directly copying ESRI code I get results, but they have a size of zero. I honestly don't care who or how, I just want to see this implemented so I know the function isn't broken, my current theory. This post is now the second top hit on google when searching for this call, so A. It shows how few people have done this and B. It would be nice if we knew if it was functional, and if so, why the example no longer seems to work so others might see it.
... View more
04-11-2012
04:17 PM
|
0
|
0
|
1418
|
POST
|
What I removed for brevity: <fx:Script>
<![CDATA[
import com.esri.ags.FeatureSet;
import com.esri.ags.Graphic;
import com.esri.ags.events.DrawEvent;
import com.esri.ags.geometry.Geometry;
import com.esri.ags.geometry.Polygon;
import com.esri.ags.utils.GraphicUtil;
import com.esri.bacore.BATaskCompletedEvent;
import com.esri.bacore.TaskResultOutput;
import com.esri.bacore.client.BAClient;
import com.esri.baserver.Boundaries;
import com.esri.baserver.OverlapRemoverOverlapMethod;
import com.esri.baserver.OverlapRemoverWeightMethod;
import com.esri.baserver.sampleviewer.BASExampleClient;
import com.esri.baserver.sampleviewer.Geofence;
import com.esri.baserver.tasks.tradeareas.RemoveOverlapParameters;
import com.esri.baserver.tasks.tradeareas.RemoveOverlapTask;
import mx.controls.Alert;
import mx.rpc.Responder;
import mx.rpc.events.FaultEvent;
//----------------------------------
// Internal variables
//----------------------------------
// Drawn trade area polygon 1
private var _tradeArea1 : Polygon;
// Drawn trade area polygon 1
private var _tradeArea2 : Polygon;
// Flag to distinct first and second trade area draw.
private var _drawSecond : Boolean = false;
// Initial map extent.
private var _initialExtent : Extent;
//----------------------------------
// Initializing
//----------------------------------
... View more
03-28-2012
11:44 AM
|
0
|
0
|
1418
|
POST
|
Ok, so right now I am trying to get the service working by adapting the example application here: http://baserver.esri.com/BAS_Flex/SamplesExplorer.html?sample=RemoveOverlap The only code I have changed is adding my client, removing the "attribute" call for the fill symbols which was apparently retired, and the resultHandler function, which IS being triggered by the task. I feel like my resultHandler task should be putting something on screen. The label does display "taskResultOutput" (line 285). If I don't comment out the lines which make the map extent equal to the result output(281-282), the program hangs. I have taken out the imports and variable declarations to make the post fit. They are identical to the sample above. <?xml version="1.0" encoding="utf-8"?>
<s:Application
xmlns:esri="http://www.esri.com/2008/ags"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
pageTitle="Example - Using Esri Business Analyst Server API for Flex to execute a Remove Overlap task."
creationComplete="startSample()">
<!--
This sample takes user-drawn trade areas and executes the Remove Overlap task
to remove the overlap (cannibalization) between trade areas.
<fx:Script>
<![CDATA[
//----------------------------------
// Initializing
//----------------------------------
/**
* Initialize the polygon draw at sample creating
*/
private function startSample():void
{
_initialExtent = map.extent;
lblGuide.text = "This sample demonstrates setting up multiple trade or service areas " +
"and removing any overlaps between them. To begin, draw a polygon area " +
"to represent the first of two sample trade area polygons.";
drawToolbar.activate(DrawTool.POLYGON);
}
//----------------------------------
// Drawing
//----------------------------------
/**
* Event handler for draw completing event;
* capture the graphics from draw tollbar,
* add the graphics to Map and create an object
* based on graphic drawn.
*/
private function onDrawEnd(event:DrawEvent):void
{
var graphic:Graphic = event.graphic;
graphic.autoMoveToTop = false;
map.extent = _initialExtent;
tradeAreasLayer.add(graphic);
// Capture the polygon geometry from the draw toolbar.
if (event.graphic.geometry is Polygon) {
if (!_drawSecond) {
_tradeArea1 = Polygon(event.graphic.geometry);
_tradeArea1.spatialReference = map.extent.spatialReference;
_drawSecond = true;
drawToolbar.deactivate();
drawToolbar.fillSymbol = sfs2;
drawToolbar.lineSymbol = sls2;
drawToolbar.activate(DrawTool.POLYGON);
lblGuide.text = "Now draw your second and last sample trade area polygon. " +
"In order to best view the results, " +
"be sure that your second area overlaps the first.";
}
else {
_tradeArea2 = Polygon(event.graphic.geometry);
_tradeArea2.spatialReference = map.extent.spatialReference;
_drawSecond = true;
drawToolbar.fillSymbol = sfs2;
drawToolbar.lineSymbol = sls2;
drawToolbar.deactivate();
executeTask();
lblGuide.text = "Task is executing. Please wait."
}
}
}
//----------------------------------
// Executing the task
//----------------------------------
/**
* Executes the task.
*/
private function executeTask():void
{
if(_tradeArea1 && _tradeArea2){
//create the parameters used by this task
var params : RemoveOverlapParameters = createParameters();
cursorManager.setBusyCursor();
//Get a static reference to a singleton instance of the BAServerClient class.
//Instructions for how to create the BAServerClient class is provided at the top of this file.
var client : BAClient = new BAServerClient;
client.url = "http://MYSERVERNAME/ArcGIS/baserver/REST/services/DefaultMap/BAServer";
var task :RemoveOverlapTask = new RemoveOverlapTask(client);
task.execute(params, new mx.rpc.Responder(resultHandler, faultHandler));
}
else{
Alert.show("The polygon is not set.");
}
}
/**
* Creates parameters of the task.
*/
private function createParameters() : RemoveOverlapParameters
{
var params : RemoveOverlapParameters = new RemoveOverlapParameters();
params.outputSpatialReference = map.extent.spatialReference;
params.overlapMethod = OverlapRemoverOverlapMethod.GRID;
params.weightMethod = OverlapRemoverWeightMethod.USE_AREA;
params.areaLinkField = "AREA_ID";
// features - from drawn polygon
var features:Array = new Array();
var attr1:Object = {
OID:1,
AREA_ID:"1_1",
STORE_ID:"1",
RING:1,
RING_DEFN:"5",
AREA_DESC:"Area 1",
SALES : "100",
COUNT : "3"};
var feature1:Graphic = new Graphic(_tradeArea1, null, attr1);
features.push(feature1);
var attr2:Object = {
OID:2,
AREA_ID:"2_1",
STORE_ID:"2",
RING:1,
RING_DEFN:"5",
AREA_DESC:"Area 2",
SALES : "300",
COUNT : "5"};
var feature2:Graphic = new Graphic(_tradeArea2, null, attr2);
features.push(feature2);
var fs:FeatureSet = new FeatureSet(features);
fs.geometryType = Geometry.POLYGON;
fs.spatialReference = _tradeArea1.spatialReference;
params.boundaries = new Boundaries( fs );
return params;
}
/**
* Result handler for the successful completion of the task execution.
*/
private function resultHandler(event:BATaskCompletedEvent, token:Object=null):void
{
var taskResultOutput : TaskResultOutput = event.result;
//draw the features on the map
var fs : FeatureSet = taskResultOutput.recordSet;
var g : Graphic = fs.features[0];
tradeAreasLayer.add(g);
//if(fs){
//tradeAreasLayer.clear();
//resultLayer.clear();
// add the resulting features to map
//for (var i:Number = 0; i < fs.features.length; i++) {
//var g : Graphic = fs.features;
// set tooltip from attributes
//g.toolTip = fs.features.attributes["AREA_DESC"];
//g.autoMoveToTop = false;
//tradeAreasLayer.add(g);
//}
//zoom to the feature extent
//map.extent =
// GraphicUtil.getGraphicsExtent(resultLayer.graphicProvider.source as Array).expand(1.25);
//}
cursorManager.removeBusyCursor();
lblGuide.text = String(taskResultOutput);//"Task complete. The trade areas with the removed overlapping areas are displayed."
}
/**
* Generalized fault handler for an asynchronous failed task execution.
*/
private function faultHandler(event:FaultEvent, token:Object=null):void
{
var message:String = "An error occurred while executing the underlying Web Service request.";
message += " Please try again later.";
Alert.show(message, "Error");
cursorManager.removeBusyCursor();
lblGuide.text = "Task failed.";
resultLayer.clear();
tradeAreasLayer.clear();
map.extent = _initialExtent;
}
]]>
</fx:Script>
<fx:Declarations>
<!-- Set symbol for polygon draw 1 -->
<esri:SimpleLineSymbol id="sls" style="solid" color="0xFF0000" width="1" alpha="1"/>
<esri:SimpleFillSymbol id="sfs" alpha="0.6" color="0xFF0000">
<esri:SimpleLineSymbol color="#F00000" width="4" alpha="1" style="solid"/>
</esri:SimpleFillSymbol>
<!-- Set symbol for polygon draw 2 -->
<esri:SimpleLineSymbol id="sls2" style="solid" color="0x00FF00" width="1" alpha="1"/>
<esri:SimpleFillSymbol id="sfs2" alpha="0.6" color="0x00FF00">
<esri:SimpleLineSymbol color="#F00000" width="4" alpha="1" style="solid"/>
</esri:SimpleFillSymbol>
<!-- Control to user draw -->
<esri:DrawTool id="drawToolbar"
map="{map}"
lineSymbol="{sls}"
fillSymbol="{sfs}"
drawEnd="onDrawEnd(event)" />
<!-- Set renderer for Spatial Overlay output feature class -->
<esri:SimpleFillSymbol id="bFill" alpha="0.5" color="0x0000FF"/>
<esri:SimpleFillSymbol id="gFill" alpha="0.5" color="0x00FF00"/>
<esri:SimpleFillSymbol id="rFill" alpha="0.5" color="0xFF0000"/>
<esri:UniqueValueRenderer id="uniqueValueRenderer" field="STORE_ID">
<esri:UniqueValueInfo value="1" symbol="{bFill}"/>
<esri:UniqueValueInfo value="2" symbol="{gFill}"/>
<esri:UniqueValueInfo value="3" symbol="{rFill}"/>
</esri:UniqueValueRenderer>
</fx:Declarations>
<s:controlBarContent>
<s:Label width="100%"
id="lblGuide"
color="#6E6F00"
fontSize="12" />
</s:controlBarContent>
<!-- Map control -->
<esri:Map id="map">
<esri:extent>
<esri:Extent xmin="-13051515.8843363" ymin="4020082.2778777" xmax="-13030416.9436797" ymax="4043380.91587083">
<esri:SpatialReference wkid="3857"/>
</esri:Extent>
</esri:extent>
<esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
<!-- Graphics Layer to draw both user input and resulting features-->
<esri:GraphicsLayer id="tradeAreasLayer" renderer="{uniqueValueRenderer}"/>
<esri:GraphicsLayer id="resultLayer" renderer="{uniqueValueRenderer}"/>
</esri:Map>
</s:Application>
... View more
03-28-2012
11:43 AM
|
0
|
0
|
1418
|
POST
|
I have been trying to get the remove overlap task working for the past few days, and have not had any luck. I was wondering if anyone has gotten this working or has an example? I have been trying both as a widget and adapting the ESRI example: http://baserver.esri.com/BAS_Flex/SamplesExplorer.html?sample=RemoveOverlap It seems to return a feature set, but I cannot for the life of me get it to display any of the featureset.features on a graphics layer. Verr strange.
... View more
03-26-2012
03:28 PM
|
0
|
8
|
3828
|
POST
|
Sean, Both dynamic labeling and Actual Annotation Feature classes will display in the Map as Long are the layer is specified as other than feature. Quick response, thanks! Now I feel bad for being snarky!
... View more
03-12-2012
01:42 PM
|
0
|
0
|
804
|
POST
|
Michael, A published map with annotation works fine in a map service when you add the map service as a dynamic layer. You can see this in may flex site including my own. http://gis.calhouncounty.org/flexviewer2.0/ Could someone clarify this response a bit? Is the word annotation being used to mean normal labeling or labels converted to annotation before being uploaded? I assume the latter but can;t be positive. If I change my layer type from feature to dynamic, will it work as stated or is there more difference to a feature vs. dynamic layer that's not explained? I am about to spend an hour trying things that could be answered in three sentences.
... View more
03-12-2012
01:31 PM
|
0
|
0
|
804
|
POST
|
A merge graphics function would pretty much be the greatest thing ever. I have needed this on at least 5 seperate occasions of only using the flex viewer for 9 months.
... View more
03-12-2012
12:56 PM
|
0
|
0
|
282
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|