|
POST
|
James, If you look at the code in the LayerListWidget.mxml you will see that it adds all map services that are used in your map except for basemaps and any layers you include in the excludelayer list.
... View more
08-26-2010
01:25 PM
|
0
|
0
|
1089
|
|
POST
|
Bjorn, I also have a friend that is having this issue and he has 101 bookmarks in his xml and I have verified that there is no syntax error in the xml. What is happening is that the mx repeater is taking longer than the 15 timeout default that flash player has for scripts to run and then it just bombs with several different errors depending on where it gets to in the rendering. So there definitely seems like there is a limit to the amount of data the bookmark widget can use.
... View more
08-26-2010
01:19 PM
|
0
|
0
|
1793
|
|
POST
|
Sangeetha, Here is a sample app where you draw a polygon on the map and the length of the sides are alerted back to you. <?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:mx="library://ns.adobe.com/flex/mx"
xmlns:esri="http://www.esri.com/2008/ags"
pageTitle="Basic usage of DrawTool" creationComplete="init()">
<s:layout>
<s:VerticalLayout paddingBottom="5"/>
</s:layout>
<fx:Style>
@namespace mx "library://ns.adobe.com/flex/mx";
mx|ToolTip
{
font-size: 14;
}
</fx:Style>
<fx:Script>
<![CDATA[
import com.esri.ags.events.DrawEvent;
import com.esri.ags.events.GeometryServiceEvent;
import com.esri.ags.geometry.Geometry;
import com.esri.ags.geometry.MapPoint;
import com.esri.ags.geometry.Polygon;
import com.esri.ags.geometry.Polyline;
import com.esri.ags.tasks.supportClasses.LengthsParameters;
import com.esri.ags.tasks.supportClasses.LinearUnit;
import mx.controls.Alert;
import spark.events.IndexChangeEvent;
protected function GeoServe_lengthsCompleteHandler(event:GeometryServiceEvent):void
{
var distArr:Array = event.result as Array;
var dist:Number
var distTxt:String = "";
for each(dist in distArr){
distTxt += "Side Length: " + dist.toString() + "\n";
}
Alert.show(distTxt);
}
protected function init():void
{
drawTool.activate(DrawTool.POLYGON);
}
protected function drawTool_drawEndHandler(event:DrawEvent):void
{
var geom:Geometry = event.graphic.geometry;
var plArr:Array = [];
var poly:Polygon = geom as Polygon;
var mpArr:Array = poly.rings[0];
var mp:MapPoint;
var pl:Polyline;
for (var i:int = 1; i < mpArr.length; i++)
{
var pla:Array = [];
pla.push(mpArr[i - 1]);
pla.push(mpArr);
pl = new Polyline([pla],myMap.spatialReference);
plArr.push(pl);
}
var lengthsParameters:LengthsParameters= new LengthsParameters();
lengthsParameters.geodesic = true;
lengthsParameters.polylines = plArr;
GeoServe.lengths(lengthsParameters);
}
]]>
</fx:Script>
<fx:Declarations>
<!-- Symbol for all line shapes -->
<esri:SimpleLineSymbol id="sls"
color="0x00FF00"
width="3"/>
<!-- Symbol for all polygon shapes -->
<esri:SimpleFillSymbol id="sfs"
color="0xFFFFFF"
style="diagonalcross">
<esri:outline>
<esri:SimpleLineSymbol color="0x00FF00" width="2"/>
</esri:outline>
</esri:SimpleFillSymbol>
<esri:DrawTool id="drawTool"
fillSymbol="{sfs}"
graphicsLayer="{myGraphicsLayer}"
lineSymbol="{sls}"
map="{myMap}"
drawEnd="drawTool_drawEndHandler(event)"/>
<esri:GeometryService id="GeoServe" lengthsComplete="GeoServe_lengthsCompleteHandler(event)"
url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"/>
</fx:Declarations>
<esri:Map id="myMap" level="3">
<esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"/>
<esri:GraphicsLayer id="myGraphicsLayer"/>
</esri:Map>
</s:Application>
... View more
08-25-2010
08:31 PM
|
0
|
6
|
4150
|
|
POST
|
Ruth, you need to do some diagnostic work on your end as that message could be coming for any numerous map services. So my suggestion is remove map services one my one till you find the culprit. Then we can go from there.
... View more
08-25-2010
07:00 PM
|
0
|
0
|
799
|
|
POST
|
Matt, they must be getting ready to release as they are talking about adding fixes to the 2.1 version when they speak of fixes.
... View more
08-25-2010
06:49 PM
|
0
|
0
|
2051
|
|
POST
|
James, To adjust the CSS files you have to have the Source code for the FlexViewer and adjust the values in the CSS and then have them recompile to swf.
... View more
08-25-2010
01:52 PM
|
0
|
0
|
1207
|
|
POST
|
James, Yep, by default the FlexViewer 2.0 use blackgold.css and you would change the background-color. Application
{
background-color: #333333; /* behind the map. Spark default is #FFFFFF; */
/* affects only non-Modules : HTMLPopup (SplashWidget and "About") */
color: black;
/* affects only title/subtitle (unless .BannerTitle is in this file) and non-Modules : HTMLPopup (SplashWidget and "About") */
font-size: 12;
}
... View more
08-25-2010
12:18 PM
|
0
|
0
|
1207
|
|
POST
|
Rich, There are alot of people out there that know flex better than me, like Mansour, Dasa, and other API team members. I got my start in programming well over a decade ago in Visual Basic, then Avenue (ArcView 3 proprietary language). I then moved to .Net and to JavaScript. I would say that JavaScript is the closest to Flex syntax. Anyway I have always been one to look at samples and have to know why they work and follow every path the code takes to see why it does what it does. I guess interrogating code is what I am best at, and what make me a successful programmer. So my best advice is don't just copy and paste code interrogate the codes logic and figure out why it does what it does. Also Google is one of my best friends 🙂
... View more
08-25-2010
12:11 PM
|
0
|
0
|
572
|
|
POST
|
Dan, Yep, you need ArcGIS Server 10 to use drawingInfos. Let's break down what this line is doing ServiceLayer(layer).addEventListener(DetailsEvent.GET_ALL_DETAILS_COMPLETE,function(event:DetailsEvent):void{getAllDetailsResult(event,lname)}); Basically I am adding an event listener to the layer that is listening for the GET_ALLDETAILS_COMPLETE event. The GET_ALLDETAILS_COMPLETE is needed to get the layerDetails objects from all the layers in the map service for that layer, because LayerDetails is where drawinginfos come from. So once the event is fired I launch a function called getAllDetailsResult and pass is not only the results of the GET_ALLDETAILS_COMPLETE but also a variable called lname. This inline function trick is what developers use when they want a send something along with the original event dispatcher.
... View more
08-25-2010
09:31 AM
|
0
|
0
|
645
|
|
POST
|
Philipp, SFV 1.3 Widgets will not work in FlexViewer 2.0 with out updating to the new viewers framework changes. You will have to recode the widget to use com.esri.viewer.BaseWidget now.
... View more
08-25-2010
08:41 AM
|
0
|
0
|
572
|
|
POST
|
Jason, You have your LiveMapsWidgets coming up with the legend from the start right? Can you instead have it open to the TOC and then let the user switch to the legend?
... View more
08-25-2010
08:07 AM
|
0
|
0
|
2072
|
|
POST
|
Luke, In the API all layer have an event called UPDATE_END that you can listen for.
... View more
08-25-2010
03:27 AM
|
0
|
0
|
389
|
|
POST
|
danj, Here is a link to a Dynamic Legend Widget for the FlexViewer2.0 that utilizes the createSwatch method so even if you are not using the FlexViewer2.0 you can still look at my code and see how to do it for yourself. http://www.arcgis.com/home/item.html...b557bf64136af6
... View more
08-24-2010
04:07 PM
|
0
|
0
|
645
|
|
POST
|
James, The CSS is where you would do this if you are talking about a FlexViewer App (either 1.3 or 2.0). But if you are just talking a non Flex Viewer app than you can just set the backgroundColor of the Application element.
... View more
08-24-2010
03:51 PM
|
0
|
0
|
1207
|
|
POST
|
Jeremy, Nope it is no where near that simple the widget is developed and dependent on the FlexViewer 2.0 framework and will not work independent of it. But I did provide the source code so a developer could look at and copy the code over to a non FV2.0 app.
... View more
08-24-2010
03:47 PM
|
0
|
0
|
3602
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-14-2020 11:36 AM | |
| 17 | 05-17-2021 01:51 PM | |
| 1 | 07-06-2020 05:32 AM | |
| 1 | 07-10-2018 05:49 AM | |
| 9 | 01-28-2022 10:58 AM |
| Online Status |
Offline
|
| Date Last Visited |
06-08-2026
06:27 AM
|