|
POST
|
Shaning, Now a days you have to carefully read the threads and see if they are talking about the Sample Flex Viewer (which your mod to my code was made for) or as Zahid is asking about the ArcGIS Viewer for Flex 2.0 Beta.
... View more
07-09-2010
10:12 AM
|
0
|
0
|
1102
|
|
POST
|
Yep. Just like it says. The FeatureLayer works with a new features of ArcGIS Server 10 only.
... View more
07-09-2010
10:09 AM
|
0
|
0
|
1116
|
|
POST
|
Zahid, Here is my 2.0 banner.mxml <?xml version="1.0" encoding="utf-8"?>
<!--
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2010 ESRI
//
// All rights reserved under the copyright laws of the United States.
// You may freely redistribute and use this software, with or
// without modification, provided you include the original copyright
// and use restrictions. See use restrictions in the file:
// <install location>/License.txt
//
////////////////////////////////////////////////////////////////////////////////
-->
<mx:Canvas xmlns:mx ="http://www.adobe.com/2006/mxml"
xmlns:s ="library://ns.adobe.com/flex/spark"
xmlns:flash ="flash.filters.*"
minWidth ="550"
minHeight ="70"
creationComplete="Init()">
<mx:Script>
<![CDATA[
import com.esri.ags.Map;
import com.esri.ags.SpatialReference;
import com.esri.ags.geometry.MapPoint;
import com.esri.viewer.AppEvent;
import com.esri.viewer.ViewerContainer;
import flash.filters.GlowFilter;
import mx.resources.ResourceBundle;
import widgets.ClassicController.ClassicControllerWidget;
private var _map:Map;
private var _logo:String;
private var _Width:Number;
/**
* The logo that is used to brand the application at the controller area.
*
* @param value the relative URL points to the logo image file.
*/
public function set logo(value:String):void
{
_logo = value;
if (value != "")
{
imgLogo.visible = true;
imgLogo.includeInLayout = true;
}
else
{
imgLogo.visible = false;
imgLogo.includeInLayout = false;
}
}
//init
private function Init():void
{
_map = ViewerContainer.getInstance().mapManager.map;
_map.addEventListener(MouseEvent.MOUSE_MOVE,mouseMoveHandler);
}
private function mouseMoveHandler(event:MouseEvent):void
{
const mapPoint:MapPoint = _map.toMapFromStage(event.stageX, event.stageY);
mapXY = "X: "+ mapPoint.x.toFixed(4) + ", Y: " + mapPoint.y.toFixed(4);
}
/**
* @private
*/
[Bindable]
public function get logo():String
{
return _logo;
}
/**
* The title displayed in the banner.
*/
[Bindable]
public var title:String;
/**
* The maps XY coordinates in the banner.
*/
[Bindable]
public var mapXY:String = " ";
/**
* The subtitle displayed in the banner.
*/
[Bindable]
public var subtitle:String;
/**
* The current/activated tool status displayed in the banner.
*/
[Bindable]
public var status:String;
/**
* Displayed the maps xy coordinates on the banner.
*/
[Bindable]
public var DisplayXY:Boolean=true;
private function nlsString(nlsToken:String):String
{
return resourceManager.getString('ControllerStrings', nlsToken);
}
public function logoClick():void
{
var controler:ClassicControllerWidget;
if (vBox.visible){
setStyle("backgroundAlpha", 0.0);
vBox.visible = false;
_Width = this.width;
this.minWidth = 65;
this.width = 65;
this.verticalScrollPolicy = "off";
this.horizontalScrollPolicy = "off"
controler = parent.parent as ClassicControllerWidget;
controler.menuContainer.visible = false;
BorderCont.styleName = "ClassicBannerCanvasHidden";
} else {
setStyle("backgroundAlpha", 0.6);
this.minWidth = 500;
this .width = _Width;
this.verticalScrollPolicy = "auto";
this.horizontalScrollPolicy = "auto"
vBox.visible = true;
controler = parent.parent as ClassicControllerWidget;
controler.menuContainer.visible = true;
BorderCont.styleName = "ClassicBannerCanvas";
}
}
]]>
</mx:Script>
<mx:Metadata>
[ResourceBundle("ControllerStrings")]
</mx:Metadata>
<s:BorderContainer id="BorderCont" width="100%" height="70" styleName="ClassicBannerCanvas" >
<s:layout>
<s:VerticalLayout gap="0" />
</s:layout>
<s:HGroup width="100%" gap="0" verticalAlign="middle">
<mx:Spacer width="10" />
<mx:Image id="imgLogo"
source="{logo}"
maintainAspectRatio="true"
maxHeight="50"
maxWidth="70"
horizontalAlign="left"
verticalAlign="top"
visible="false"
includeInLayout="false"
click="logoClick()" toolTip="Click Here to Hide/Show Banner">
<mx:filters>
<flash:DropShadowFilter color="#000000" distance="5" alpha="1" blurX="5" blurY="5"/>
</mx:filters>
</mx:Image>
<mx:Spacer width="5" />
<mx:VBox id="vBox" verticalGap="0" horizontalAlign="left" width="100%" >
<mx:HBox width="100%" verticalAlign="top">
<mx:Label styleName="ClassicBannerTitle" text="{title}"/>
<mx:VBox verticalGap="1" horizontalAlign="right" width="100%" >
<mx:HBox width="100%" horizontalAlign="right">
<mx:Label styleName="ClassicBannerStatus" text="{mapXY}"/>
</mx:HBox>
</mx:VBox>
</mx:HBox>
<mx:HRule styleName="ClassicBannerRule" width="100%" />
<mx:HBox width="100%" verticalAlign="top">
<mx:Label styleName="ClassicBannerSubtitle" text="{subtitle}"/>
<mx:HBox width="100%" horizontalAlign="right">
<mx:Label styleName="ClassicBannerStatus" text="{nlsString('current_action') + status}"/>
</mx:HBox>
</mx:HBox>
</mx:VBox>
<mx:Spacer width="10" />
</s:HGroup>
<mx:Spacer height="15"/>
</s:BorderContainer>
</mx:Canvas>
... View more
07-09-2010
08:08 AM
|
0
|
0
|
1102
|
|
POST
|
Natasha, Yep you missed a couple of steps from the older thread.
//Add to the BaseWidget.as
/**
* Added by me
* so that I could get the widget instance
*/
public function getInstance():BaseWidget
{
return _Widget;
}
//Add to the IBaseWidget.as
/**
* Used to get a refference to this widget for code
*/
function getInstance():BaseWidget;
//Add to the WidgetManagerDocked.mxml
public function getWidget(id:Number):IBaseWidget
{
var widget:IBaseWidget;
var label:String = configData.configWidgets[id].label;
var icon:String = configData.configWidgets[id].icon;
var config:String = configData.configWidgets[id].config;
var url:String = configData.configWidgets[id].url;
if (widgetTable.containsKey(id))
{
widget = widgetTable.find(id) as IBaseWidget;
widget.setState("maximized");
var wObj:DisplayObject = widget as DisplayObject;
scrollToWidget(wObj);
}
else
{
//module loaded
if (moduleTable.containsKey(url))
{
var modInfo:IModuleInfo = moduleTable.find(url) as IModuleInfo;
widget = modInfo.factory.create() as IBaseWidget;
widget.setId(id);
widget.setTitle(label);
widget.setIcon(icon);
widget.setConfig(config);
widget.setConfigData(configData);
widget.setMap(map);
var widgetDO:DisplayObject = widget as DisplayObject;
widgetBox.addChild(widgetDO);
widgetTable.add(id, widget);
}
else
{
return null;
loadWidget(id, url);
}
}
return widget;
}
... View more
07-09-2010
08:04 AM
|
0
|
0
|
1557
|
|
POST
|
Joshua, There is not tolerance built in for the point graphical search so you have to add one on your own like this: private function searchDrawEnd(event:DrawEvent):void
{
event.target.deactivate();
var geom:Geometry = event.graphic.geometry;
if(geom.type == Geometry.MAPPOINT)
{
//Expand the point by 5 pixels
var point:MapPoint = geom as MapPoint;
var xMin:Number = map.toScreen(point).x - 2.5;
var yMin:Number = map.toScreen(point).y - 2.5;
var xMax:Number = map.toScreen(point).x + 2.5;
var yMax:Number = map.toScreen(point).y + 2.5;
var mp1:MapPoint = map.toMap(new Point(xMin,yMin));
var mp2:MapPoint = map.toMap(new Point(xMax,yMax));
var ext:Extent = new Extent(mp1.x, mp1.y, mp2.x, mp2.y);
var pA:Array = [];
var pPoly:Polygon = new Polygon(null,geom.spatialReference);
pA.push(new MapPoint(ext.xmin,ext.ymin,geom.spatialReference));
pA.push(new MapPoint(ext.xmin,ext.ymax,geom.spatialReference));
pA.push(new MapPoint(ext.xmax,ext.ymax,geom.spatialReference));
pA.push(new MapPoint(ext.xmax,ext.ymin,geom.spatialReference));
pA.push(new MapPoint(ext.xmin,ext.ymin,geom.spatialReference));
pPoly.addRing(pA);
queryFeaturesGraphical(pPoly);
} else {
queryFeaturesGraphical(geom);
}
}
... View more
07-09-2010
07:13 AM
|
0
|
0
|
672
|
|
POST
|
Casey, This is a Flash Player 10.1 issue in IE and Dasa has reported the Bug to Adobe.
... View more
07-09-2010
06:00 AM
|
0
|
0
|
2125
|
|
POST
|
Josh, Make sure you are making your changes to the xml and/or mxml files under the src folder and not the bin-debug folder.
... View more
07-08-2010
11:15 AM
|
0
|
0
|
617
|
|
POST
|
Paul, The way ESRI handles it in their viewer is to set the maps scale to some predetermined value and center the maps extent on the MapPoint.
... View more
07-08-2010
06:33 AM
|
0
|
0
|
1073
|
|
POST
|
Susan Try changing the Query to OBJECTID IN (238,456,251,485,425,456,362,194,456,380,135,98,441,545,466,239,136,546,541,552,339,85,504,216,399,257,138,433,311,308,510,401,79,452,278,199,536,176,275,512,162,365,332,426,54,438,237,404,503,52,122,182,427,446,487,475,422,490,97,451,1,488,478,274,364,508,556,338,537,498,547,483,405,206,233,307,177,395,459)
... View more
07-07-2010
01:45 PM
|
0
|
0
|
2223
|
|
POST
|
Michael, It should be as simple as
Application {
backgroundColor: #a1af7f;
color: white;
}
... View more
07-07-2010
12:12 PM
|
0
|
0
|
793
|
|
POST
|
Tony, Both the circle and the exporting and importing graphics are available in this widget I created http://resources.esri.com/arcgisserver/apis/flex/index.cfm?fa=codeGalleryDetails&scriptID=16634
... View more
07-07-2010
12:06 PM
|
0
|
0
|
2125
|
|
POST
|
Don, I don't think it was to hard. The big thing is if you are migrating your custom widgets and want to use mainly Spark then you have to get rid of your repeaters and switch to data groups, which force you to develop item renderers for the datagroup. I went ahead and took the time to migrate all my widgets to the new Spark components all except for my TOC widget. I had to fix serveral things in the Beta Viewer, like data messaging, the infopopupwidget, lots of css, issues with the tooltips and header widgets appearing below docked widgets, etc. There no time like to present to dive in as this is the direction everyone needs to go.
... View more
07-07-2010
07:17 AM
|
0
|
0
|
5381
|
|
POST
|
Ken, Thanks for the headsup I was able to get this error in IE 7 when I got home on a slower internet connection...? IE 7 must be do things in a strange order as the offending line of code what just a simple line telling the graphicsLayer to be visible. Hum... Anyway I have put some checks in there now to be sure the graphicsLayer for all my widgets that use graphicsLayers are not null before I try to use them. Great new look, Robert. However, I am getting a Flash error when opening your custom header version.
... View more
07-06-2010
03:53 PM
|
0
|
0
|
5382
|
|
POST
|
Bjorn, Thanks I was trying to figure out how to get it on there.
... View more
07-06-2010
02:11 PM
|
0
|
0
|
3750
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-14-2020 11:36 AM | |
| 16 | 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 |
4 weeks ago
|