Solved! Go to Solution.
Michelle,
So you are sure that you added the agslib-3.0-2012-06-06.swc to the libs folder?
Michelle,
So you are sure that you added the agslib-3.0-2012-06-06.swc to the libs folder?
Michelle,
What and why are you adding to the index.mxml?
Michelle,
You should post that code as many package names have changed.
<!-- /////////////////////////////////////////////////////////////////////////// // Copyright (c) 2010-2011 Esri. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /////////////////////////////////////////////////////////////////////////// --> <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:viewer="com.esri.viewer.*" xmlns:managers="com.esri.viewer.managers.*" xmlns:esri="http://www.esri.com/2008/ags" initialize="onAppPreinitialize(event)" pageTitle="Hydrographic & Impairment Statistics Viewer"> <!-- ArcGIS API 3.0 --> <!-- Adobe SDK 4.6 --> <fx:Style source="defaults.css"/> <fx:Metadata> [ResourceBundle("ViewerStrings")] </fx:Metadata> <fx:Script> <![CDATA[ //import Globals.*; import com.esri.ags.FeatureSet; import com.esri.ags.Graphic; import com.esri.ags.Map; import com.esri.ags.geometry.Extent; import com.esri.ags.tasks.QueryTask; import com.esri.ags.tasks.supportClasses.Query; import com.esri.ags.utils.GraphicUtil; // import com.esri.ags.symbols import mx.controls.Alert; import mx.core.FlexGlobals; import mx.events.BrowserChangeEvent; import mx.events.FlexEvent; import mx.managers.BrowserManager; import mx.managers.IBrowserManager; import mx.rpc.AsyncResponder; import mx.utils.URLUtil; private var params:Object = null; private var queryTask:QueryTask = new QueryTask(null); private var query:Query = new Query(); private var featureExtent:Extent = null; private var bm:IBrowserManager; public var featureSet:FeatureSet [Bindable] private var NPS_List_ID:String = null; private var Park:String = null; //private var NPS_List_ID:String = "GOGA_CAR2011303020070615132740_OLEMA CREEK"; [Bindable] private var Unit_Code:String; private var queryURLS:Array = new Array("http:...rest/services/NRSS/HIS_Dissolved/MapServer/0", "http://...rest/services/NRSS/HIS_Dissolved/MapServer/1", "http://...rest/services/NRSS/HIS_Dissolved/MapServer/2", "http://...rest/services/NRSS/HIS_Dissolved/MapServer/3"); /** * Listen application preinitialize handler */ protected function onAppPreinitialize(event:FlexEvent):void { params = getURLParameters(); configureQuery(); /* for (var i:int = 0; i<queryURLS.length; ++i) { configureQuery(url); } */ } private function getURLParameters():Object { var result:URLVariables = new URLVariables(); try { if (ExternalInterface.available) { // Use JavaScript to get the search string from the current browser location. // Use substring() to remove leading '?'. // 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) { result.decode(search); } } } catch (error:Error) { Alert.show(error.toString()); } return result; } private function configureQuery():void { if (params["NPS_List_ID"]) { // Configure the query task queryTask = new QueryTask(null); queryTask.useAMF = false; NPS_List_ID = params["NPS_List_ID"]; // TODO: Need to iterate all layers or add query param based on initial table //queryTask.url = queryURLS; queryTask.url = "http://...rest/services/NRSS/HIS_Dissolved/MapServer/0"; //new Array("http://...rest/services/NRSS/HIS_Dissolved/MapServer/0", //"http://...rest/services/NRSS/HIS_Dissolved/MapServer/1", //"http://...rest/services/NRSS/HIS_Dissolved/MapServer/2", //"http://...rest/services/NRSS/HIS_Dissolved/MapServer/3"); // "http://...rest/services/NRSS/HIS_Dissolved/MapServer/0"; // TODO: SHould be an array //dynamically insert the 1, 2, 3, 4 from an array into the url above? query.where = "NPS_LIST_ID = '" + NPS_List_ID + "'"; query.returnGeometry = true; // public function SimpleLineSymbol(style:"solid", color: 0xff0000, alpha:1, width:5); } else if (params["Park"]) { // Configure the query task queryTask = new QueryTask(null); queryTask.useAMF = false; Park = params["Park"]; // TODO: Need to iterate all layers or add query param based on initial table //queryTask.url = queryURL queryTask.url = "http://...rest/services/NPSData/NPS_Boundaries_WebMercator_labelfree/MapServer/0"; query.where = "UNIT_CODE = '" + Park + "'"; query.returnGeometry = true; // public function SimpleLineSymbol(style:"solid", color: 0xff0000, alpha:1, width:5); } else {trace("ERROR: NPS_List_ID or Park not detected."); } } private function queryPark():void { queryTask = new QueryTask(null); queryTask.useAMF = false; queryTask.url = "http://...rest/services/NPSData/NPS_Boundaries_WebMercator_labelfree/MapServer/0"; query.where = "UNIT_CODE = '"+ Globals.Unit_Code +"'"; query.returnGeometry = true; function onResult(featureSet:FeatureSet, token:Object = null):void { trace("Number of features: " + featureSet.features.length); // Set map extent to extent of Park features var graphicsExtent:Extent = GraphicUtil.getGraphicsExtent(featureSet.features); // GraphicUtil.getGraphicsExtent(queryURLS:Array); if (graphicsExtent) { trace(mapManager.map.extent); trace(graphicsExtent); //Zoom out by 25% mapManager.map.extent = graphicsExtent.expand(1.5); trace(mapManager.map.extent); } } function onFault(info:Object, token:Object = null):void { trace("query issue"); Alert.show(info.toString(), "ERROR: Problem querying park extent from service."); } } protected function onMapCreationComplete(event:FlexEvent):void { if (params["NPS_List_ID"] != null) { // Execute serivce query for impairment // queryTask.execute(query, new AsyncResponder(onResult, onFault)); queryTask.execute(query, new AsyncResponder(onResult, onFault)); // Extract unit code from NPS_List_ID Unit_Code = NPS_List_ID.substring(0,4); Globals.Unit_Code = Unit_Code; Globals.NPS_List_ID = params["NPS_List_ID"]; } else if (params["Park"] != null) { queryTask.execute(query, new AsyncResponder(onResult, onFault)); //Extract unit code from NPS_List_ID //Unit_Code = NPS_List_ID.substring(0,4); //Globals.Unit_Code = Unit_Code; } function onResult(featureSet:FeatureSet, token:Object = null):void { trace("Number of features: " + featureSet.features.length); // Set map extent to extent of NPS_List_ID features var graphicsExtent:Extent = GraphicUtil.getGraphicsExtent(featureSet.features); // GraphicUtil.getGraphicsExtent(queryURLS:Array); if (graphicsExtent) { //trace(mapManager.map.extent); //trace(graphicsExtent); //Zoom out by 25% mapManager.map.extent = graphicsExtent.expand(1.5); //trace(mapManager.map.extent); } } function onFault(info:Object, token:Object = null):void { //trace("query issue"); Alert.show(info.toString(), "ERROR: Problem querying impairment from service."); } } ]]> </fx:Script> <viewer:ViewerContainer id="viewerContainer"> <viewer:configManager> <managers:ConfigManager id="configManager"/> </viewer:configManager> <viewer:dataManager> <managers:DataManager id="dataManager"/> </viewer:dataManager> <viewer:mapManager> <managers:MapManager id="mapManager"/> </viewer:mapManager> <viewer:uiManager> <managers:UIManager id="uiManager"/> </viewer:uiManager> <viewer:widgetManager> <managers:WidgetManager id="widgetManager"/> </viewer:widgetManager> </viewer:ViewerContainer> </s:Application>
Michelle,
I don't see anywhere in the code that you even need that import at all as there is no code using symbols. Try deleting that line all together.
I just removed the aforementioned line of code and it doesn't seem to be affecting anything.Do you mean that you still get the first error image you provided or is it only the second error image now?
Michelle,
So when you say Do you mean that you still get the first error image you provided or is it only the second error image now?