POST
|
Thanks to Robert's help above I did get my code working in Action Script to call the Geometry services. The following is what I did:
private function mouseClickHandler(event:MouseEvent):void
{
const frmapPoint:MapPoint = map.toMapFromStage(event.stageX, event.stageY);
var latlong:MapPoint;
var wkidString:String = frmapPoint.spatialReference.wkid.toString();
//Alert.show("Spatial Ref for map: " + frmapPoint.spatialReference.wkid.toString());
if ( wkidString == "102100")
{
latlong = WebMercatorUtil.webMercatorToGeographic(frmapPoint) as MapPoint;
frLat = latlong.y.toFixed(6);
frLong = latlong.x.toFixed(6);
displayForm(frLat, frLong);
}
else if ( wkidString == "3857")
{
latlong = WebMercatorUtil.webMercatorToGeographic(frmapPoint) as MapPoint;
frLat = latlong.y.toFixed(6);
frLong = latlong.x.toFixed(6);
displayForm(frLat, frLong);
}
else if ( wkidString == "4326")
{
latlong = map.toMapFromStage(event.stageX, event.stageY);
frLat = latlong.y.toFixed(6);
frLong = latlong.x.toFixed(6);
displayForm(frLat, frLong);
}
else
{
//Project using geometry service
var outSR:SpatialReference = new SpatialReference(4326);
// var inSR:SpatialReference = new SpatialReference(102100);
//geometryService.project([ frmapPoint as Geometry ], outSR);
// Changed for 3.0 API
const projectParameters:ProjectParameters = new ProjectParameters;
projectParameters.geometries = [ frmapPoint as Geometry ];
projectParameters.outSpatialReference = outSR;
geometryService.project(projectParameters);
}
var graphic:Graphic = new Graphic();
var mapPoint2:MapPoint = frmapPoint;
mapPoint2.spatialReference = map.spatialReference;
graphic.geometry = mapPoint2;
graphicsLayer.clear();
graphicsLayer.add(graphic);
}
private function projectCompleteHandler(event:GeometryServiceEvent):void
{
try
{
// Note: As of version 2.0, GeometryService returns geometries (instead of graphics)
var pt:MapPoint = (event.result as Array)[0]as MapPoint;
//Alert.show(pt.x + ", " + pt.y);
displayForm(pt.y.toString(),pt.x.toString());
}
catch (error:Error)
{
Alert.show(error.toString());
}
}
Not sure if it helps or not, but maybe it provides you a little more then what you started with!
... View more
08-29-2013
02:13 PM
|
0
|
0
|
411
|
POST
|
Ok, I understand that I must have an organizational account and I do. For example EPA's url is: epa.maps.arcgis.com. However, I'm getting the same error. Any ideas? Ok figured out my own problem. Apparently the user name is case sensitive. That resolved my issue. Hope this helps others.
... View more
08-24-2013
07:02 AM
|
0
|
0
|
821
|
POST
|
Ok, I understand that I must have an organizational account and I do. For example EPA's url is: epa.maps.arcgis.com. However, I'm getting the same error. Any ideas?
... View more
08-24-2013
07:00 AM
|
0
|
0
|
820
|
POST
|
Thank You Robert, as always that is exactly what I was looking for!
... View more
02-05-2013
06:10 PM
|
0
|
0
|
255
|
POST
|
Thanks for looking into the WMS topic above. I have since written code to export the data out of NetCDF and then put it into a feature class in the geoDB. My current issues is that my features have a field in them called "bearing". I then rotate the symbol based upon this attribute in the mxd. However, I am noticing a couple things: 1) if I add AGS service as a whole (dynamic), I can get the features to rotate at the different time stamps, however they over post on them selves and look ugly. 2) if I add the AGS service layers as features, they rotation does not occur. They do change colors but the arrows always point north. Any ideas if this can be overcome? Side note I am using the 3.1 version of the widget currently. Hope to see you in Palm Springs! Frank
... View more
02-05-2013
01:57 PM
|
0
|
0
|
436
|
POST
|
Thanks Wayne that was it! I knew it had to be something simple: So this was my solution:
mxdIn = arcpy.GetParameterAsText(0)
mxd = arcpy.mapping.MapDocument(mxdIn)
Have a great Christmas!
... View more
12-22-2012
07:34 PM
|
2
|
0
|
613
|
POST
|
I have a simple script that is doing some parsing of the mxd that I pass it. The script works just fine if I hard code the name of the mxd into the script, however I would like to pass the full path of the mxd to the script when I run it. This seems to be an issue since the examples I have seen all have the ???r??? in them prior to the path and mxd name. For example(this works by the way): mxd = arcpy.mapping.MapDocument(r"C:\Data\GISData\PythonCode\test.mxd") I???ve tried a number of things but haven???t figured out how to get around this simple problem. For Example: mxdIn = sys.argv[0] mxd = arcpy.mapping.MapDocument(mxdIn) Also tried: mxdIn = sys.argv[0] mxd = arcpy.mapping.MapDocument(r (mxdIn)) Thanks for your help in advance!
... View more
12-22-2012
12:49 PM
|
1
|
3
|
938
|
POST
|
Here is a link to what I have: https://dl.dropbox.com/u/54484896/GoeElectricSource.zip Hope it helps, Frank
... View more
11-08-2012
12:29 PM
|
0
|
0
|
220
|
POST
|
Thank you Dasa, that fixed it. It is always those little things....
... View more
10-01-2012
09:30 AM
|
0
|
0
|
188
|
POST
|
Ok I added the ?token=... after the url for the service but still it is prompting me for the Sign In when I trigger the widget. I can supply a testing url if that would be handy. Just a side note, is that I didn't see this with your widget till I switched to 3.0 of the Viewer, and the associated version of the TOC Widget. Another thing to mention is that I seem to get this behavior when I have a feature service added (type="feature"). So a full dynamic service doesn't seem to cause the behavior. Any other ideas?
... View more
09-20-2012
11:40 AM
|
0
|
0
|
597
|
POST
|
Thanks for your quick reply! It is set up as such:
<layer label="Status" type="feature" visible="false"
token="A90av3k6cC75HbsYVMqpVfulDk3UsfhnZb1TDx0KBesmAIfjCf7puQU6gAQ25fnVpQ2RX6KQxQVwOie9B6nMVw.."
url="http://orator-s.epa.gov/ArcGIS/rest/services/R9ER/EPAR9RemovalWOaklandOpsR9ER/FeatureServer/4"/>
... View more
09-20-2012
08:24 AM
|
0
|
0
|
597
|
POST
|
Robert, I have a 3.0 viewer running off 10.0 Sp4 AGS services. The services are secured with AGS, and a tokken has been generated and put in the config file. The viewer loads just fine and I can view the map layers using the "more" button. However when I launch the TOC widget I get a login prompt. However, the login prompt doesn't seem to recognize the logins provided (I assume it wan'ts the ArcGISServer accounts I created). Not sure why it would want me to login. Here is the error it throws after I type the login/pass. [ATTACH=CONFIG]17846[/ATTACH] Any ideas? Thanks, Frank
... View more
09-20-2012
07:19 AM
|
0
|
0
|
597
|
POST
|
Attached is another image of the error, this one came from firefox: [ATTACH=CONFIG]17845[/ATTACH]
... View more
09-20-2012
06:51 AM
|
0
|
0
|
406
|
POST
|
I am in migration mode to the 3.0 viewer and seem to be running into some issues with secure services. When I launch the viewer it comes up just dandy. However if you click the edit widget you get prompted to sign in, the same thing is true for Robert S's TOC widget. When I then provide my credentials, per the two users I created for ArcGIS server , neither of those logins work. I then get the error: Error #2048 [ATTACH=CONFIG]17830[/ATTACH] Not sure if there is some new magic in the config file I have to provide or what. I am passing a tokken in the config file, and as I said the data layers seem to load just just fine. I have done some research and this seems to be caused by lack of crossdomain.xml file. But the crossdomain.xml file does seem to be there. Side note is that this was all working just fine at the 2.5 version of the viewer. Any ideas would be great, thanks
... View more
09-19-2012
02:12 PM
|
0
|
6
|
558
|
POST
|
Robert, I'm attempting something that maybe isn't right, so that might explain my issues... The only layer I have in my Flexviewer map is a WMS service that has time enabled. I'm assume that this is not supported in this widget? The link to the time enabled WMS service I'm using is as follows:
<layer label="Surface Sea Water Velocity" type="wms" visible="true"
visiblelayers="surface_sea_water_velocity"
imageFormat="png32"
alpha="0.6"
skipgetcapabilities="true"
usemaptime="true"
version="1.1.1"
url="http://hfrnet.ucsd.edu:8080/thredds/wms/HFRNet/USWC/6km/hourly/RTV?service=WMS&srs=EPSG:4326"/>
My Widget.xml looks like:
<?xml version="1.0" ?>
<configuration>
<autotogglelayervisibility>true</autotogglelayervisibility>
<startatoldesttime>true</startatoldesttime>
<resetslideronlayerchange>true</resetslideronlayerchange>
<layers>
<layer label="Water Velocity" name="Surface Sea Water Velocity">
<dateformat>MMMM, YYYY</dateformat>
<loop>false</loop>
<singlethumbastimeinstant>false</singlethumbastimeinstant>
<thumbcount>1</thumbcount>
<thumbmovingrate>1000</thumbmovingrate>
<timeextent>
<starttime>2011/10/01 00:00:00 UTC</starttime>
<endtime>2012/09/05 16:00:00 UTC</endtime>
</timeextent>
<timestops>
<timestopsinterval>1</timestopsinterval>
<timestopsunits>days</timestopsunits>
</timestops>
</layer>
</layers>
<labels>
<timelayerlabel>Select Layer: </timelayerlabel>
</labels>
</configuration>
Thanks for your assistance,
... View more
09-05-2012
10:50 AM
|
0
|
0
|
436
|
Title | Kudos | Posted |
---|---|---|
1 | 02-08-2016 10:36 AM | |
1 | 03-05-2015 11:29 AM | |
1 | 09-04-2015 07:40 AM | |
2 | 12-22-2012 07:34 PM | |
3 | 02-17-2016 09:01 AM |
Online Status |
Offline
|
Date Last Visited |
10-21-2022
08:23 PM
|