|
POST
|
Glad to help. Don't forget to click the check mark on the post that answered your question.
... View more
02-22-2013
09:37 AM
|
0
|
0
|
977
|
|
POST
|
Don't you need to pass in the application? GetCaption(ArcMap.Application);
... View more
02-22-2013
08:50 AM
|
0
|
0
|
977
|
|
POST
|
Neil, Theoretically that should happen, but my applications have the StartPosition property set to CenterParent for the forms. I set the form's owner using your code and yet the forms appear randomly on the page. I have to use the following sub to center my forms before I show them.
Public Sub CenterForm(ByVal form As System.Windows.Forms.Form, ByVal m_application As ESRI.ArcGIS.Framework.IApplication)
Dim pWinPos As ESRI.ArcGIS.Framework.IWindowPosition
Dim CenterX As Short
Dim CenterY As Short
pWinPos = m_application
CenterX = (pWinPos.Width / 2) + pWinPos.Left
CenterY = (pWinPos.Height / 2) + pWinPos.Top
form.Location = New System.Drawing.Point(CenterX - form.Width / 2, CenterY - form.Height / 2)
form.StartPosition = Windows.Forms.FormStartPosition.Manual
End Sub
... View more
02-20-2013
09:37 AM
|
0
|
0
|
1852
|
|
POST
|
Have you tried running this manually in ArcMap by putting the string equivalents into the tool? Whenever I have problems with programming geoprocessing tools, I run them in ArcMap and examine the results to make sure I'm putting the correct inputs into the tool's properties. Also, do you need the double slashes in the output feature class property?
... View more
02-20-2013
07:09 AM
|
0
|
0
|
538
|
|
POST
|
I made a slight modification to the Adding Graphics sample and it seems to work properly. Maybe it's because I used the graphic layer's click event and event.target instead of event.currentTarget
<?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="Adding graphics using MXML and/or ActionScript">
<s:layout>
<s:VerticalLayout horizontalAlign="center" paddingTop="3"/>
</s:layout>
<fx:Script>
<=!=[=C=D=A=T=A=[
import com.esri.ags.SpatialReference;
import com.esri.ags.symbols.PictureMarkerSymbol;
private function addSomeMarkers():void
{
// This is just to show how to add markers
// using ActionScript code as opposed to MXML tags.
var myGraphicMarker:Graphic = new Graphic(new MapPoint(1447100, 7477200, new SpatialReference(102100)),
new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_DIAMOND, 22, 0x009933));
myGraphicMarker.toolTip = "Marker added with ActionScript";
myGraphicsLayer.add(myGraphicMarker);
// PictureMarker - embedded image
[Embed('assets/globe.png')]
var picEmbeddedClass:Class;
var pictureMarker:PictureMarkerSymbol = new PictureMarkerSymbol(picEmbeddedClass);
var myGraphicPic:Graphic = new Graphic(new MapPoint(-411000, 4924000, new SpatialReference(102100)));
myGraphicPic.symbol = pictureMarker;
myGraphicsLayer.add(myGraphicPic);
var myPolyline:Polyline = new Polyline(
[[
new MapPoint(-1726185, 9543036),
new MapPoint(34923, 6920940),
new MapPoint(1874303, 6255632),
new MapPoint(1835168, 6255632),
new MapPoint(1913439, 6138225)
]], new SpatialReference(102100));
var myGraphicLine:Graphic = new Graphic(myPolyline);
myGraphicLine.symbol = new SimpleLineSymbol(SimpleLineSymbol.STYLE_DASH, 0xDD2222, 1.0, 4)
myGraphicsLayer.add(myGraphicLine);
var myPolygon:Polygon = new Polygon(
[[
new MapPoint(2352491, -1992338),
new MapPoint(2332923, -2461967),
new MapPoint(2646009, -2266288),
new MapPoint(3076503, -2324992),
new MapPoint(3272181, -2520670),
new MapPoint(3506996, -2559806),
new MapPoint(3702675, -3049003),
new MapPoint(3370021, -3675175),
new MapPoint(2763416, -4046965),
new MapPoint(2117676, -4144804),
new MapPoint(1961133, -3890422),
new MapPoint(2000269, -3655607),
new MapPoint(1667615, -3185978),
new MapPoint(1550208, -2422831),
new MapPoint(1334961, -1953202),
new MapPoint(2352491, -1992338)
]], new SpatialReference(102100));
var myGraphicPolygon:Graphic = new Graphic();
myGraphicPolygon.geometry = myPolygon;
myGraphicPolygon.symbol = new SimpleFillSymbol(
SimpleFillSymbol.STYLE_SOLID, // fill style
0xFF0000, // fill color
0.7 // fill alpha
);
myGraphicPolygon.toolTip = "Polygon added with ActionScript";
myGraphicsLayer.add(myGraphicPolygon);
btn.enabled = false;
}
protected function myGraphicsLayer_clickHandler(event:MouseEvent):void
{
myGraphicsLayer.remove(event.target as Graphic);
}
]=]=>
</fx:Script>
<s:Label width="100%" text="This sample demonstrates adding graphics to the map using either MXML or ActionScript. Simple marker symbols, picture marker symbols, simple line symbols, simple fill symbols, and picture fill symbols are shown."/>
<s:Button id="btn"
click="addSomeMarkers()"
label="Add some more markers using ActionScript"/>
<esri:Map id="myMap"
level="2"
wrapAround180="true">
<esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
<esri:GraphicsLayer id="myGraphicsLayer" click="myGraphicsLayer_clickHandler(event)">
<esri:Graphic toolTip="California MapPoint with a SimpleMarkerSymbol">
<esri:geometry>
<esri:MapPoint x="-13163000" y="4035000"
spatialReference="{new SpatialReference(102100)}"/>
</esri:geometry>
<esri:symbol>
<esri:SimpleMarkerSymbol color="0x0033DD" size="18"/>
</esri:symbol>
</esri:Graphic>
<esri:Graphic toolTip="Hurricane polyline with a SimpleLineSymbol">
<esri:geometry>
<esri:Polyline spatialReference="{new SpatialReference(102100)}">
<fx:Array>
<fx:Array>
<esri:MapPoint x="-4700503" y="1128848"/>
<esri:MapPoint x="-7909635" y="2819513"/>
<esri:MapPoint x="-8144450" y="4199048"/>
<esri:MapPoint x="-7244327" y="5261584"/>
</fx:Array>
</fx:Array>
</esri:Polyline>
</esri:geometry>
<esri:symbol>
<esri:SimpleLineSymbol width="6" color="0xFF0000"/>
</esri:symbol>
</esri:Graphic>
<esri:Graphic toolTip="Brazilian polygon with a SimpleFillSymbol">
<esri:geometry>
<esri:Polygon spatialReference="{new SpatialReference(102100)}">
<fx:Array>
<fx:Array>
<esri:MapPoint x="-3867905" y="-671044"/>
<esri:MapPoint x="-4533702" y="-2578326"/>
<esri:MapPoint x="-5316417" y="-2832708"/>
<esri:MapPoint x="-5844750" y="-3869806"/>
<esri:MapPoint x="-6333947" y="-3498016"/>
<esri:MapPoint x="-6412218" y="-1942370"/>
<esri:MapPoint x="-8211974" y="-954779"/>
<esri:MapPoint x="-7703209" y="229077"/>
<esri:MapPoint x="-5736637" y="454597"/>
<esri:MapPoint x="-3867905" y="-671044"/>
</fx:Array>
</fx:Array>
</esri:Polygon>
</esri:geometry>
<esri:symbol>
<esri:SimpleFillSymbol alpha="0.7" color="0x009933"/>
</esri:symbol>
</esri:Graphic>
</esri:GraphicsLayer>
</esri:Map>
</s:Application>
... View more
02-13-2013
10:21 AM
|
0
|
0
|
2050
|
|
POST
|
Try this
protected function onClickFunction2(event:MouseEvent):void
{
pointGraphicsLayer.remove(event.target);
}
... View more
02-13-2013
08:48 AM
|
0
|
0
|
2050
|
|
POST
|
When working with geoprocessing tool inputs, I find it helpful to run the tool in ArcMap using the parameters that I want to set and reviewing the results to see how they actually are used in the tool. Here, I ran the Sort tool on a dataset using the field POP2000 and Descending. [ATTACH=CONFIG]21708[/ATTACH] So for your case, you'll want to use "ELEVATION_ DESCENDING"
... View more
02-12-2013
04:55 AM
|
0
|
0
|
717
|
|
POST
|
Sure. I've written with separate tabs for the photo and video parts, hiding them if there isn't any photos or the video doesn't exist. The code is too long to put in this message, so I've attached it (and another AS file that it uses) as a zip file.
... View more
02-07-2013
06:39 AM
|
0
|
0
|
1489
|
|
POST
|
For one of my applications (written in Flex 3.6), I have created an MXML component (called VideoPopup) that contains a VideoDisplay. In the map's mapClick event, I run an IdentifyTask, and in the onResult function, I look for the type of feature that was returned. Take a look at the Identify Sample as an example. I set the map.infoWindow.content to this VideoPopup. To see this in action, go to this site, click the Data button, check the "Show site locations" box, and click on the various points. Some of these dive sites have photos, while others have videos.
function onResult(results:Array, clickGraphic:Graphic = null):void
{
if (results && results.length > 0)
{
var result:IdentifyResult = results[0];
var resultGraphic:Graphic = result.feature;
var mapPoint:MapPoint = MapPoint(clickGraphic.geometry);
var point:Point = mainMap.toScreen(mapPoint);
mainMap.infoWindow.hide();
switch (resultGraphic.geometry.type)
{
case Geometry.MAPPOINT:
{
mainMap.infoWindow.content = createVideoWindow(resultGraphic, xmlProjectParameters, divephotourl, divevideourl, site_id, videoname, photocount);
mainMap.infoWindow.label = "Site ID: " + resultGraphic.attributes[site_id];
resultGraphic.symbol = new SimpleMarkerSymbol("x",12,0xFF0080);
break;
}
}
layerGraphics.graphicProvider = resultGraphic;
mainMap.infoWindow.show(mainMap.toMap(point));
}
}
public static function createVideoWindow(graphic:Graphic, xmlProjectParameters:XMLList, photoURL:String, videoURL:String, siteID:String, videoName:String, photoCount:String):VideoPopup
{
var popVideo:VideoPopup = new VideoPopup();
popVideo.TitleText = graphic.attributes[siteID];
popVideo.VideoName = graphic.attributes[videoName];
popVideo.attributeText = returnAttributes(graphic, xmlProjectParameters, 0); //a function to get all the attributes
popVideo.imageCount = graphic.attributes[photoCount];
popVideo.photoURL = photoURL;
popVideo.videoURL = videoURL;
return popVideo;
}
... View more
02-07-2013
05:35 AM
|
0
|
0
|
1489
|
|
POST
|
If you zoom in farther, you'll notice that the image gets squeezed horizontally instead of shifted. Try this by turning on the 1 hour precipitation layer, panning to Cape Flattery, and zooming in a few more levels.
... View more
02-05-2013
07:05 AM
|
0
|
0
|
2691
|
|
POST
|
The first thing to do is the put this into a Try Catch block so you know why and where the program is crashing. For the second and third time you have the line pEF = pMap.FeatureSelection (and why not use pEF.Reset?) why do you call pEF.Next twice? Are you testing whether you have at least two features selected?
... View more
01-30-2013
06:37 AM
|
0
|
0
|
3053
|
|
POST
|
That's something I've never noticed before, but I'm getting the same issue opening a Windows form using Show. This is the code for the button opening my form.
Public Class Aggregate
Inherits ESRI.ArcGIS.Desktop.AddIns.Button
Public Sub New()
End Sub
Protected Overrides Sub OnClick()
Try
Dim AggForm As New AggregateForm
If AggForm.InitializeForm Then 'sets up the initial view of the form
CenterForm(AggForm, My.ArcMap.Application) 'centers the form on the application window
AggForm.Show(System.Windows.Forms.Control.FromHandle(My.ArcMap.Application.hWnd))
End If
Catch ex As Exception
System.Windows.Forms.MessageBox.Show(ex.ToString, "OnClick")
End Try
'
My.ArcMap.Application.CurrentTool = Nothing
End Sub
Protected Overrides Sub OnUpdate()
Enabled = My.ArcMap.Application IsNot Nothing
End Sub
End Class
... View more
01-29-2013
03:56 AM
|
0
|
0
|
1217
|
|
POST
|
Please post your code. And what version of ArcGIS are you using?
... View more
01-29-2013
03:46 AM
|
0
|
0
|
3053
|
|
POST
|
Is this using an IdentifyTask? If so, you can use the IdentifyParameters.tolerance parameter. However, this is the distance in screen pixels from the specified geometry within which the identify should be performed. You would have to determine the conversion from screen distance to ground distance at the different map scales.
... View more
01-25-2013
04:44 AM
|
0
|
0
|
557
|
|
POST
|
Take a look at this post showing how to use brackets with the SDE field names
... View more
01-25-2013
04:30 AM
|
0
|
0
|
698
|
| 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 |
Online
|
| Date Last Visited |
an hour ago
|