|
POST
|
You should put your query filter into the Search cursor = featureLayer.Search(queryFilter, False)
... View more
06-20-2012
07:40 AM
|
0
|
0
|
1778
|
|
POST
|
Since you've already queried the feature layer to get the feature selection, why not use that instead of querying the feature layer again? If featureSelection.SelectionSet.Count() = 0 Then MsgBox("can't find PID") End If
... View more
06-19-2012
06:01 AM
|
0
|
0
|
821
|
|
POST
|
After you add the layer to the map, you'll have to refresh the active view. My.ArcMap.Document.ActiveView.Refresh() The button is getting disabled because My.ArcMap.Application is being evaluated as nothing. Why? I'm not sure. This probably leads to the question of why the button isn't disabled when you start the application. With Add-ins, you have to set the onDemand tag in the config.esriaddinx to False to make the Enabled state of the button work upon startup. See here for more information about delayed loading.
... View more
06-15-2012
10:18 AM
|
0
|
0
|
1632
|
|
POST
|
You can use AddLayerToActiveView(My.ArcMap.Document.ActiveView, "D:\Contours.lyr")
... View more
06-15-2012
09:39 AM
|
0
|
0
|
1632
|
|
POST
|
What you want to do is cycle through all the fields for the feature to get their values
dim i as integer
for i = 0 to pF.Fields.FieldCount - 1
if pF.Fields.Field(i).Type < 6 then 'this line adds only the numeric, text, and date field attributes, not the Shape or OID field or other types
ListBox3.AddItem pF.Value(i)
end if
next
... View more
06-15-2012
06:28 AM
|
0
|
0
|
2918
|
|
POST
|
I'm able to get the formatted date for my date field [SUR_DATE] in the label using the line FormatDateTime([SUR_DATE]) To drop the year, I had use the syntax Month( [SUR_DATE] ) & "/" & Day([SUR_DATE])
... View more
06-12-2012
12:14 PM
|
0
|
0
|
2155
|
|
POST
|
Glad to help. Don't forget to mark the question as answered.
... View more
06-07-2012
06:57 AM
|
0
|
0
|
882
|
|
POST
|
Take a look at this post for an example for an add-in
... View more
06-06-2012
10:18 AM
|
0
|
0
|
882
|
|
POST
|
When you add a field with a reserved name by code or through the tool, it automatically adds an underscore to it. In your desktop test, were you adding that field to a feature class stored in that particular geodatabase?
... View more
06-05-2012
12:05 PM
|
0
|
0
|
3627
|
|
POST
|
What type of geodatabase are you creating the feature class? "Public" is deemed as a reserved word in some different types. See this link for a full list of the reserved words for the different RDBMS.
... View more
06-05-2012
10:50 AM
|
0
|
0
|
3627
|
|
POST
|
Sorry, I glossed over the part about this being a Flex Viewer problem. Please note that there's a forum dedicated to the Flex Viewer and questions related to that should go there.
... View more
06-05-2012
07:40 AM
|
0
|
0
|
1274
|
|
POST
|
I've modified this sample to pass in a parameter in the URL. To use it, your URL would look like http://yoursite/testing/URLTest.html?id=Illinois Without the parameter(?id=Illinois), it defaults to California.
<?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"
pageTitle="FeatureLayer and its definitionExpression">
<!--
Problem:
How to search a layer for certain features and display the results on a map?
Solution:
The easiest way is to use "FeatureLayer" and modifying the definitionExpression property
based on the user input.
This sample use FeatureLayer and simply updates its definitionExpression when
user clicks the "Search" button (or hits enter in the text box), the definitionExpression
is then updated on the FeatureLayer which will request its new features.
Note that the busy cursor is shown while the definitionExpression is being updated.
Tip 1: if you wanted to use a different symbol, specify a symbol or renderer on the feature layer.
Tip 2: if you want to add a toolTip, listen to the graphicAdd event and add the tooltip at that time.
-->
<s:layout>
<s:VerticalLayout gap="10"
horizontalAlign="center"
paddingBottom="20"
paddingLeft="20"
paddingRight="20"
paddingTop="20"/>
</s:layout>
<fx:Script>
<![CDATA[
import com.esri.ags.events.LayerEvent;
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
private function doSearch():void
{
// fLayer.layerDetails.displayField
fLayer.definitionExpression = "STATE_NAME like '" + qText.text + "'";
}
// the following four functions are 'just' error handling and showing/hiding the busy cursor
protected function fLayer_updateStartHandler(event:LayerEvent):void
{
this.cursorManager.setBusyCursor();
}
protected function fLayer_updateEndHandler(event:LayerEvent):void
{
if (event.fault)
{
trace("updateEnd: " + event.fault); // maybe a badly formatted query?
}
else if (event.updateSuccess == false)
{
trace(event.type + ": " + event.updateSuccess + " ... unexpected failure");
}
else // things seem OK
{
if (FeatureLayer(event.layer).numGraphics < 1)
{
Alert.show("Sorry, found no such features, please try something else");
}
}
this.cursorManager.removeBusyCursor();
}
protected function fLayer_faultHandler(event:FaultEvent):void
{
Alert.show(event.fault.faultString + "\n\n" + event.fault.faultDetail, "FeatureLayer Fault " + event.fault.faultCode);
}
protected function fLayer_loadErrorHandler(event:LayerEvent):void
{
Alert.show(event.fault.faultString + "\n\n" + event.fault.faultDetail, "FeatureLayer Load Error " + event.fault.faultCode);
}
private function getURLParameters():Object
{
var result:URLVariables = new URLVariables();
try
{
if (ExternalInterface.available)
{
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 loading_Event():void
{
var params:Object = getURLParameters();
if (params["id"])
{
qText.text = params.id;
}
else
{
qText.text = "California";
}
doSearch();
}
]]>
</fx:Script>
<s:Panel height="60"
backgroundColor="0xB2BFC6"
title="Query a layer (search for U.S. states)">
<s:layout>
<s:HorizontalLayout/>
</s:layout>
<s:TextInput id="qText"
width="100%"
enter="doSearch()"
text="California"
toolTip="You may use % as a wildcard, e.g., New%"/>
<s:Button click="doSearch()" label="Search"/>
</s:Panel>
<esri:Map id="myMap">
<esri:extent>
<esri:Extent xmin="-14305000" ymin="2748000" xmax="-6815000" ymax="7117000">
<esri:SpatialReference wkid="102100"/>
</esri:Extent>
</esri:extent>
<esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Physical_Map/MapServer"/>
<esri:FeatureLayer id="fLayer"
fault="fLayer_faultHandler(event)"
load="{loading_Event()}"
loadError="fLayer_loadErrorHandler(event)"
mode="snapshot"
updateEnd="fLayer_updateEndHandler(event)"
updateStart="fLayer_updateStartHandler(event)"
url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5"/>
</esri:Map>
</s:Application>
... View more
06-05-2012
05:52 AM
|
0
|
0
|
1274
|
|
POST
|
The ShapeType property doesn't return an esriShapeType constant, but rather an esriGeometryType constant. Your code should be if (pFC.getShapeType() == esriGeometryType.esriGeometryPolygon) but there is no constant for a PolygonZ
... View more
06-05-2012
04:52 AM
|
0
|
0
|
755
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-04-2025 06:39 AM | |
| 1 | 05-01-2026 08:26 AM | |
| 1 | 04-10-2026 12:01 PM | |
| 1 | 04-13-2026 09:11 AM | |
| 1 | 10-11-2023 06:18 AM |
| Online Status |
Offline
|
| Date Last Visited |
2 weeks ago
|