|
POST
|
David, Never had much success with sending compiled swfs (the issue with API version, SDK version and now flash builder vs flex builder). Are there any issues in your problem window (besides warnings)? Have you run a clean from the project menu?
... View more
06-21-2010
06:46 AM
|
0
|
0
|
876
|
|
POST
|
David, Have you tried to remove the identifyWidget.mxml from your Flex projects list of modules and then add it back?
... View more
06-21-2010
05:57 AM
|
0
|
0
|
876
|
|
POST
|
David, Yep there is one already look here. http://forums.esri.com/Thread.asp?c=158&f=2421&t=291265&mc=6#907415
... View more
06-21-2010
03:56 AM
|
0
|
0
|
876
|
|
POST
|
Brad, I have help with an issue like this before and it tuned out that that person had some swfs in the src folder and you should never have any compiled swfs in your src folder or else those get copied to the bin-debug and/or bin-release folder when you clean. It that your case? If so just delete the swfs from your src folders
... View more
06-18-2010
03:54 PM
|
0
|
0
|
1156
|
|
POST
|
Charlie, In your MapManager.mxml make sure your enableMapAction function looks like this:
//draw tool clicked
private function enableMapAction(event:AppEvent):void
{
var data:Object = event.data;
var tool:String = data.tool;
var status:String = data.status;
drawEndFunction = data.handler;
navToolbar.deactivate();
drawToolbar.activate(tool);
map.panEnabled = false;
map.mapNavigationEnabled = false;
map.rubberbandZoomEnabled = false;
map.zoomSliderVisible = false;
SiteContainer.setStatus(status);
}
... View more
06-18-2010
03:51 PM
|
0
|
0
|
1542
|
|
POST
|
Harold, I don't think you should be look at binding. Why not just add an event listener SiteContainer.addEventListener(AppEvent.SET_STATUS, flashStatus);
private function flashStatus(event:AppEvent):void
{
trace("Well What do we have here")
}
... View more
06-18-2010
06:09 AM
|
0
|
0
|
381
|
|
POST
|
Melony, Yep, I think that you are having the issue I have fixed in the attached code. TocLayerInfoItem.as ////////////////////////////////////////////////////////////////////////////////
//
// Copyright © 2008 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>/FlexViewer/License.txt
//
////////////////////////////////////////////////////////////////////////////////
package com.esri.solutions.flexviewer.components.toc.tocClasses
{
import com.esri.ags.events.ExtentEvent;
import com.esri.ags.layers.LayerInfo;
import com.esri.solutions.flexviewer.SiteContainer;
/**
* A TOC item representing a member layer of an ArcGIS or ArcIMS map service.
* This includes group layers that contain other member layers.
*/
public class TocLayerInfoItem extends TocItem
{
public function TocLayerInfoItem( parentItem:TocItem, layerInfo:LayerInfo)
{
super(parentItem);
_layerInfo = layerInfo;
label = layerInfo.name;
// Set the initial visibility without causing a layer refresh
setVisible(layerInfo.defaultVisibility, false);
SiteContainer.getInstance().controller.map.addEventListener(ExtentEvent.EXTENT_CHANGE,checkExtent);
}
internal static const DEFAULT_MAX:Number = 0;
private var _maxScale:Number = DEFAULT_MAX;
public function set maxScale( value:Number ):void
{
_maxScale = value;
this.scaledependant = true;
if(_maxScale > 0 && _minScale > 0){
if ((SiteContainer.getInstance().controller.map.scale >= _maxScale) &&
(SiteContainer.getInstance().controller.map.scale <= _minScale)){
this.scaledependant = false;
}
} else if (_maxScale > 0 ){
if ((SiteContainer.getInstance().controller.map.scale >= _maxScale)){
this.scaledependant = false;
}
} else if (_minScale > 0 ) {
if ((SiteContainer.getInstance().controller.map.scale <= _minScale)){
this.scaledependant = false;
}
} else {
this.scaledependant = false;
}
}
public function get maxScale():Number
{
return _maxScale;
}
private function checkExtent(evt:ExtentEvent):void{
this.scaledependant = true;
if(_maxScale > 0 && _minScale > 0){
if ((SiteContainer.getInstance().controller.map.scale >= _maxScale) &&
(SiteContainer.getInstance().controller.map.scale <= _minScale)){
this.scaledependant = false;
}
} else if (_maxScale > 0 ){
if ((SiteContainer.getInstance().controller.map.scale >= _maxScale)){
this.scaledependant = false;
}
} else if (_minScale > 0 ) {
if ((SiteContainer.getInstance().controller.map.scale <= _minScale)){
this.scaledependant = false;
}
} else {
this.scaledependant = false;
}
}
internal static const DEFAULT_MIN:Number = 0;
private var _minScale:Number = DEFAULT_MIN;
public function set minScale( value:Number ):void
{
_minScale = value;
this.scaledependant = true;
if(_maxScale > 0 && _minScale > 0){
if ((SiteContainer.getInstance().controller.map.scale >= _maxScale) &&
(SiteContainer.getInstance().controller.map.scale <= _minScale)){
this.scaledependant = false;
}
} else if (_maxScale > 0 ){
if ((SiteContainer.getInstance().controller.map.scale >= _maxScale)){
this.scaledependant = false;
}
} else if (_minScale > 0 ) {
if ((SiteContainer.getInstance().controller.map.scale <= _minScale)){
this.scaledependant = false;
}
} else {
this.scaledependant = false;
}
}
public function get minScale():Number
{
return _minScale;
}
//--------------------------------------------------------------------------
// Property: layerInfo
//--------------------------------------------------------------------------
private var _layerInfo:LayerInfo;
/**
* The map layer info that backs this TOC item.
*/
public function get layerInfo():LayerInfo
{
return _layerInfo;
}
//--------------------------------------------------------------------------
//
// Methods
//
//--------------------------------------------------------------------------
/**
* @private
*/
override internal function setVisible( value:Boolean, layerRefresh:Boolean = true ):void
{
// Set the visible state of all children, but defer the layer refresh
for each (var item:TocItem in children) {
item.setVisible(value, false);
}
// Set the visible state of this item, but defer the layer refresh
super.setVisible(value, false);
// Allow the layer refresh now that all changes have been made
if (layerRefresh) {
refreshLayer();
}
}
}
}
... View more
06-17-2010
06:55 PM
|
0
|
0
|
852
|
|
POST
|
Melony, It is all controlled by the MXD. If you make changes to the min or max scale in the MXD you will have to republish and clear your REST cache before you will see the changes in the TOC though.
... View more
06-17-2010
07:54 AM
|
0
|
0
|
852
|
|
POST
|
Ruy, Here is a functioning version of your test app. There where a couple of major things. 1. You where trying to mix cached base maps with different WKIDs (cant do that with cached map services) 2. You where never calling execute on the query task. <?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:esri="http://www.esri.com/2008/ags"
xmlns:mx="library://ns.adobe.com/flex/halo"
pageTitle="Test query if user clicks within a polygon">
<fx:Declarations>
</fx:Declarations>
<fx:Script>
<![CDATA[
import com.esri.ags.FeatureSet;
import com.esri.ags.Graphic;
import com.esri.ags.SpatialReference;
import com.esri.ags.events.MapEvent;
import com.esri.ags.events.MapMouseEvent;
import com.esri.ags.geometry.MapPoint;
import com.esri.ags.layers.TiledMapServiceLayer;
import com.esri.ags.tasks.QueryTask;
import com.esri.ags.tasks.supportClasses.Query;
import com.esri.ags.utils.WebMercatorUtil;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.events.FlexEvent;
import mx.rpc.AsyncResponder;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.http.HTTPService;
public function onMapClick(event:MapMouseEvent):void
{
const mapPoint:MapPoint = event.mapPoint;
var latString:String = mapPoint.y.toFixed(6);
var longString:String = mapPoint.x.toFixed(6);
latitudeText.text=latString; // "Show the latitude clicked"
longitudeText.text=longString; // "Show the longitude clicked"
var queryTask:QueryTask = new QueryTask();
queryTask.showBusyCursor = true;
queryTask.useAMF = false;
queryTask.url = "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Portland/Portland_ESRI_LandBase_AGO/MapServer/4";
var myQuery:Query = new Query();
myQuery.geometry = mapPoint;
myQuery.spatialRelationship = "esriSpatialRelWithin";
myQuery.returnGeometry = true;
queryTask.execute(myQuery,new AsyncResponder(onResult,onFault));
// Did the user click within a polygon
function onResult(featureSet:FeatureSet, token:Object = null):void
{
if(featureSet.features){
if(featureSet.features.length > 0){
Alert.show("You clicked inside the polygon");
} else {
Alert.show("You clicked outside the polygon");
}
}
}
function onFault(info:Object, token:Object = null):void
{
Alert.show("Error Occured");
}
}
private function layerShowHandler(event:FlexEvent):void
{
// update the LODs/zoomslider to use/show the levels for the selected base map
var tiledLayer:TiledMapServiceLayer = event.target as TiledMapServiceLayer;
myMap.lods = tiledLayer.tileInfo.lods;
}
]]>
</fx:Script>
<s:Panel>
<esri:Map id="myMap" level="4" width="500" height="400" mapClick="onMapClick(event)">
<esri:ArcGISTiledMapServiceLayer
visible="{bb.selectedIndex == 0}"
show="layerShowHandler(event)"
url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Portland/Portland_ESRI_LandBase_AGO/MapServer" />
<esri:ArcGISTiledMapServiceLayer
visible="{bb.selectedIndex == 1}"
show="layerShowHandler(event)"
url="http://server.arcgisonline.com/ArcGIS/rest/services/NGS_Topo_US_2D/MapServer" />
<esri:ArcGISTiledMapServiceLayer
visible="{bb.selectedIndex == 2}"
show="layerShowHandler(event)"
url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer" />
</esri:Map>
<s:ButtonBar id="bb" selectedIndex="0" right="5" top="5">
<s:ArrayCollection>
<fx:Array>
<fx:String>Streets</fx:String>
<fx:String>U.S. Topo</fx:String>
<fx:String>Imagery</fx:String>
</fx:Array>
</s:ArrayCollection>
</s:ButtonBar>
</s:Panel>
<s:Panel x="501">
<s:VGroup width="100" height="400">
<s:Label id="lblLatitude" text="Latitude"/>
<s:TextInput id="latitudeText" text="" width="75"/>
<s:Label id="lblLongitude" text="Longitude"/>
<s:TextInput id="longitudeText" text="" width="75"/>
</s:VGroup>
</s:Panel>
</s:Application>
... View more
06-16-2010
06:51 PM
|
0
|
0
|
342
|
|
POST
|
ST S, Attached is my PrintWidget where I do exactly what you are trying to do. I have a couple of other thing going on in my code but I think you can look at it and learn what you need to get your working. One of the big things about my print widget is it maintains the maps aspect ration or crop the map in any way. So if you are using a wide screen laptop then your map image will be wide and narrow. I also embed my logo in the widget itself and grab it from there.
... View more
06-16-2010
06:08 PM
|
0
|
0
|
330
|
|
POST
|
Royce, Not sure what your exact situation is but normally when you see an id like "ArcGISDynamicMapServiceLayer22" that means that the API has to assign a generic name for you because one was not defined in code.
... View more
06-16-2010
05:46 PM
|
0
|
0
|
480
|
|
POST
|
Melony, Are you having issues with layer that have a minscale and maxscale defined? I have seen this issue and have a fix for it.
... View more
06-16-2010
05:41 PM
|
0
|
0
|
852
|
|
POST
|
Jesse, There is no user interface for this widget so you will not see it. You need to set the widget to preload. Check and see what you set the scalethreshold to in the xml file because you will not see tips until you meet that threshold.
... View more
06-16-2010
05:38 PM
|
0
|
0
|
378
|
|
POST
|
Jon, 1. Just add this line under line 164 of the LiveMapsWidget.mxml dynlayer.name = NameTxt.text; 2. The issue you are likely having is that the WMS portion of code is try to use the proxy url and you do not have you development environment configured properly to work with the proxy page. Easy solution comment out this line @ line 186 wmslayer.proxyURL = configData.proxy
... View more
06-16-2010
05:31 PM
|
0
|
0
|
228
|
|
POST
|
Sandeep, OK, so the issue is in your subtitle Make sure your config.xml does not have <subtitle>Public School Projects in USA<br/>Click on the tools below to access</subtitle> it should have <subtitle>Public School Projects in USA<br/>Click on the tools below to access</subtitle>
... View more
06-16-2010
12:13 PM
|
0
|
0
|
1210
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-06-2020 05:32 AM | |
| 1 | 07-10-2018 05:49 AM | |
| 9 | 01-28-2022 10:58 AM | |
| 1 | 03-28-2022 06:20 AM | |
| 1 | 01-30-2019 07:38 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-01-2025
05:12 AM
|