|
POST
|
Sandra, Ok this line is the culprit refreshLayer("BMP Locations",30000); so is "BMP Locations the exact map service id/Label that you have in your config.xml?
... View more
06-24-2010
07:31 AM
|
0
|
0
|
1336
|
|
POST
|
Melony, The way I am doing it in the sample is I am passing an array of Layer objects and not an array of strings like you were. The array of strings will work also if those are the EXACT ids of the layers in your code.
... View more
06-24-2010
07:00 AM
|
0
|
0
|
2122
|
|
POST
|
Sandra, Sorry that was suppose to be CODE]if (!xParam == ""){
... View more
06-24-2010
06:56 AM
|
0
|
0
|
1336
|
|
POST
|
Sandra, Here is your code fixed. Just replace the MapLoadComplete function in your MapManger.mxml with this one. //map load complete
private function mapLoadComplete(event:MapEvent):void
{
SiteContainer.dispatchEvent(new AppEvent(AppEvent.LAYER_LOADED, false, false, null));
try
{
if (ExternalInterface.available)
{
var result:URLVariables = new URLVariables();
var urlSubstring:String = ExternalInterface.call("window.location.search.substring", 1);
if (urlSubstring && urlSubstring.length > 0)
{
result.decode(urlSubstring);
// Parse URL
var xParam:String;
var xExt:String;
if (result["BMPID"])
xParam = result.BMPID;
if (result["EXT"])
xExt = result.EXT;
if (!xParam = ""){
var timer:Timer = new Timer(4000, 1);
timer.addEventListener(TimerEvent.TIMER_COMPLETE, timerComplete);
timer.start();
}
if (!xExt == ""){
var extArray:Array = xExt.split(",");
var extent:Extent = new Extent(Number(extArray[0]), Number(extArray[1]), Number(extArray[2]), Number(extArray[3]),map.spatialReference);
map.extent = extent;
}
function timerComplete( event:TimerEvent ):void
{
timer.removeEventListener(TimerEvent.TIMER_COMPLETE, timerComplete);
var id:Number = SiteContainer.getInstance().getWidgetId("Search");
var bWidget:IBaseWidget = SiteContainer.getInstance().widgetManager.getWidget(id) as IBaseWidget;
if (bWidget){
var bWidg:BaseWidget = bWidget.getInstance();
var vSW:SearchWidget = bWidg as SearchWidget;
vSW.querybmpid(xParam);
} else {
var bWidget2:IBaseWidget;
bWidget2 = SiteContainer.getInstance().widgetManager.getWidget(id) as IBaseWidget;
var vSW2:SearchWidget = bWidget2 as SearchWidget;
vSW2.querybmpid(xParam);
}
}
}
}
}
catch (error:Error){}
refreshLayer("BMP Locations",30000);
//uncomment if you are using my enhanced draw widget
//map.addLayer(drawgLayer);
}
... View more
06-24-2010
06:27 AM
|
0
|
0
|
1336
|
|
POST
|
David, Sorry I can't say I'm interested in developing such a specialized widget (to many other thing on my plate). As far as the CAD data if it is not georeferenced than does it even overlay with your data in the correct location?
... View more
06-24-2010
05:53 AM
|
0
|
0
|
491
|
|
POST
|
Sandra, I guess I will need you MapManger.mxml also. Line 587 in your SearchWidget.mxml that the error references is telling me that the querybmpid function is not receiving the query parameter (10572)
... View more
06-24-2010
05:48 AM
|
0
|
0
|
1336
|
|
POST
|
Sandra, Can you attach your SearchWidget.mxml and the URL that you are using for this?
... View more
06-24-2010
05:16 AM
|
0
|
0
|
1336
|
|
POST
|
Melony, Here is an example of how to get it working. <?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" xmlns:maplib="com.esri.maplib.*"
pageTitle="Flex TOC Sample"
layout="horizontal"
paddingTop="0" paddingBottom="0" paddingLeft="0" paddingRight="0"
horizontalGap="0"
>
<mx:Panel title="Map Content" width="300" height="100%">
<maplib:TOC width="100%" height="100%" map="{map}" useLayerFadeEffect="true" excludeGraphicsLayers="true" excludeLayers="{[AerialMap,TopoMap,StreetMap]}"/>
</mx:Panel>
<esri:Map id="map">
<!-- base maps -->
<esri:ArcGISTiledMapServiceLayer id="AerialMap" visible="true" url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer"/>
<esri:ArcGISTiledMapServiceLayer id="TopoMap" visible="false" url="http://server.arcgisonline.com/ArcGIS/rest/services/NGS_Topo_US_2D/MapServer"/>
<esri:ArcIMSMapServiceLayer id="IMSWorld" visible="false" serviceHost="http://www.geographynetwork.com" serviceName="ESRI_World"/>
<esri:ArcGISTiledMapServiceLayer id="StreetMap" visible="false" url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"/>
<!-- base map overlays -->
<esri:ArcGISTiledMapServiceLayer visible="true" url="http://server.arcgisonline.com/ArcGIS/rest/services/Reference/ESRI_Transportation_World_2D/MapServer"/>
<esri:ArcGISTiledMapServiceLayer visible="false" url="http://server.arcgisonline.com/ArcGIS/rest/services/Reference/ESRI_Boundaries_World_2D/MapServer"/>
<esri:ArcGISTiledMapServiceLayer visible="false" url="http://server.arcgisonline.com/ArcGIS/rest/services/Reference/ESRI_BoundariesPlacesAlt_World_2D/MapServer"/>
<esri:ArcGISTiledMapServiceLayer visible="true" url="http://server.arcgisonline.com/ArcGIS/rest/services/Reference/ESRI_BoundariesPlaces_World_2D/MapServer"/>
<!-- thematic overlays -->
<esri:ArcGISDynamicMapServiceLayer visible="false" url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer"/>
<esri:GraphicsLayer visible="true">
<esri:Graphic>
<esri:geometry>
<esri:MapPoint x="-117.195533" y="34.057058"/>
</esri:geometry>
<esri:symbol>
<esri:SimpleMarkerSymbol style="diamond" color="0x33FF00" alpha="0.8" size="18"/>
</esri:symbol>
</esri:Graphic>
</esri:GraphicsLayer>
</esri:Map>
</mx:Application>
... View more
06-24-2010
04:59 AM
|
0
|
0
|
2122
|
|
POST
|
Guys, Here is the solution.
//Add this to the init function
callLater(expandTOC);
//Add this function
private function expandTOC():void
{
toc.openItems = toc.dataProvider.source;
for each(var item:TocMapLayerItem in toc.openItems) {
if (item.isTopLevel())
toc.expandItem(item,true,true,true,null);
}
}
... View more
06-23-2010
05:36 AM
|
0
|
0
|
1532
|
|
POST
|
David, You would not want a widget with a user interface on the screen for this ability to use a definition query on one layer though (at least I would not). You can easily add code like the sample demonstrates to the MapManager.mxml and then you would not have a need for a widget.
... View more
06-23-2010
04:09 AM
|
0
|
0
|
1645
|
|
POST
|
Ian, You can actually do it all in the MapManager.mxml in the mapLoadComplete function. I have setup the url parameter as "sTitle" so it would look like (http://gislap134/flexviewer/index.html?sTitle=hi%20world). private function mapLoadComplete(event:MapEvent):void
{
SiteContainer.dispatchEvent(new AppEvent(AppEvent.LAYER_LOADED, false, false, null));
try
{
if (ExternalInterface.available)
{
var result:URLVariables = new URLVariables();
// See http://livedocs.adobe.com/flex/3/langref/flash/external/ExternalInterface.html
var search:String = ExternalInterface.call("location.search.substring", 1);
if (search && search.length > 0 && search != "debug=true")
{
result.decode(search);
var xUrlParam:String;
if (result["sTitle"]){
xUrlParam = result.sTitle;
SiteContainer.getInstance().controller.banner.subtitle = xUrlParam;
}
}
}
}
catch (error:Error){}
}
... View more
06-22-2010
06:57 PM
|
0
|
0
|
1482
|
|
POST
|
Dasa, I ran my test from my local machine in Flex Builder 3 using 3.4 SDK and requiring Flash Player 10.0. The output url folder is not configured to a virtual directory so it is running from the C drive. I know it still won't work for him if he deploys it to a web server unless my sets up the proxy, but my point was it is a ArcGISDynamicMapServiceLayer Sofoo should be using.
... View more
06-22-2010
06:19 PM
|
0
|
0
|
1107
|
|
POST
|
David, Nope I don't see much sense in creating a widget for this as one would probably only use a definition query in very limited circumstances.
... View more
06-22-2010
04:27 PM
|
0
|
0
|
1645
|
|
POST
|
Sofoo, Funny this code works fine for me. <?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"
pageTitle="DrawToolbar"
styleName="plain">
<mx:Script>
<![CDATA[
import com.esri.ags.geometry.MapPoint;
import mx.events.ItemClickEvent;
import mx.controls.Alert;
import com.esri.ags.events.MapMouseEvent;
import com.esri.ags.Graphic;
import com.esri.ags.events.DrawEvent;
import com.esri.ags.events.GraphicEvent;
]]>
</mx:Script>
<esri:Map id="myMap" >
<esri:extent>
<esri:Extent xmin="-119.65" ymin="34.43" xmax="-119.7" ymax="34.45">
<esri:SpatialReference wkid="4326"/>
</esri:Extent>
</esri:extent>
<esri:ArcGISTiledMapServiceLayer id="tiledStreetMap" url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"/>
<esri:ArcGISDynamicMapServiceLayer id="parcels" url="http://www.cirgis.org/ArcGIS/rest/services/County_ParcelsWGS84/MapServer"/>
</esri:Map>
<mx:TraceTarget includeCategory="true" includeLevel="true"/>
<!-- The output from TraceTarget is available when running Debug within Flex Builder -->
</mx:Application> As far as the proxy look at this thread where Dasa answers that question. http://forums.esri.com/thread.asp?c=158&f=2421&t=263931
... View more
06-22-2010
04:24 PM
|
0
|
0
|
1107
|
|
POST
|
V, There were three issues in the code. 1. The most important the url to the geocode service was incorrect (GeocodedServer is suppose to be GeocodeServer) 2. import com.esri.ags.tasks.AddressCandidate; is now import com.esri.ags.tasks.supportClasses.AddressCandidate; 3. This line + candidate.address.toString() + "\n" is supose to be + candidate.address.Address + "\n"
... View more
06-22-2010
04:13 PM
|
0
|
0
|
1617
|
| 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
|