POST
|
I have been having the same problem (although with 10.1 SP1 and 3.0). I resolved it by granting insert/update/delete permissions to *each* feature classes in the Geodatabase. It seems that granting permissions on the Geodatabase itself is not sufficient (those permissions do not cascade down to the FC's). Still not sure why Esri could not at least send an error back. To end users, if the application says 'successful', then it should actually be successful! Tragic.
... View more
12-12-2012
02:30 AM
|
0
|
0
|
236
|
POST
|
Yes, "fun" is one way to put it! Here are three, very compelling, reasons why your suggestion will not work: 1. The original code for this section is taken (unedited) from a working sample posted by David Spriggs at ESRI 2. It has worked in the past (cant really say under which circumstances it did work unforatuntely...) 3. The "readonly" variables for xmax and ymax are set correctly, but the xmin and ymin are not And yet, despite that very clear evidence, your suggestion has worked. Sometimes, I really dont know why I do this! But thanks a million for your help - lifesaver! Richard.
... View more
06-10-2011
05:43 AM
|
0
|
0
|
620
|
POST
|
Hi Chris. Thanks for your thoughts. I tested with your idea by manually inputting the extent values - which I collected manually by viewing an extent within the map layout template itself (i.e. definitely fits). modified code: arcpy.AddMessage("Input extent pts: %s %s %s %s" % (newPntLL.X, newPntLL.Y, newPntUR.X, newPntUR.Y))
myExtent = dataFrame.extent
arcpy.AddMessage("Original extent pts: %s %s %s %s" % (myExtent.XMin, myExtent.YMin, myExtent.XMax, myExtent.YMax))
arcpy.AddMessage("... setting my extent xmin to: 3449977")
#myExtent.XMin = newPntLL.X
myExtent.XMin = 3449977
arcpy.AddMessage("... setting my extent ymin to: -3492834")
#myExtent.YMin = newPntLL.Y
myExtent.YMin = -3492834
arcpy.AddMessage("... setting my extent xmax to: 3450982")
#myExtent.XMax = newPntUR.X
myExtent.XMax = 3450982
arcpy.AddMessage("... setting my extent ymax to: -3492116")
#myExtent.YMax = newPntUR.Y
myExtent.YMax = -3492116
arcpy.AddMessage("New extent pts: %s %s %s %s" % (myExtent.XMin, myExtent.YMin, myExtent.XMax, myExtent.YMax))
dataFrame.extent = myExtent
arcpy.AddMessage("Final MAP extent pts: %s %s %s %s" % (dataFrame.extent.XMin, dataFrame.extent.YMin, dataFrame.extent.XMax, dataFrame.extent.YMax))
And the modified output: Input extent pts: 3448672.2243 -3490621.8401 3449675.4603 -3490056.9226
Original extent pts: 2055276.37123 -4018755.96024 2055518.36111 -4018583.26583
... setting my extent xmin to: 3449977
... setting my extent ymin to: -3492834
... setting my extent xmax to: 3450982
... setting my extent ymax to: -3492116
New extent pts: 2055518.36111 -4018583.26583 3450982.0 -3492116.0
Final MAP extent pts: 2055518.36111 -4253281.1636 3450982.0 -3257418.10223
So, now with confirmed coordinates, the values are still not sticking to the extent variables... Richard. Why cant computers just do what they are told?
... View more
06-10-2011
01:08 AM
|
0
|
0
|
620
|
POST
|
Hi there, I am using the script from David Spriggs that prints a map to PDF. I am having a problem with the code "applying" the new extent to the map before printing. The code is: arcpy.AddMessage("Input extent pts: %s %s %s %s" % (newPntLL.X, newPntLL.Y, newPntUR.X, newPntUR.Y))
myExtent = dataFrame.extent
arcpy.AddMessage("Original extent pts: %s %s %s %s" % (myExtent.XMin, myExtent.YMin, myExtent.XMax, myExtent.YMax))
arcpy.AddMessage("... setting my extent xmin to: %s" % newPntLL.X)
myExtent.XMin = newPntLL.X
arcpy.AddMessage("... setting my extent ymin to: %s" % newPntLL.Y)
myExtent.YMin = newPntLL.Y
arcpy.AddMessage("... setting my extent xmax to: %s" % newPntUR.X)
myExtent.XMax = newPntUR.X
arcpy.AddMessage("... setting my extent ymax to: %s" % newPntUR.Y)
myExtent.YMax = newPntUR.Y
arcpy.AddMessage("New extent pts: %s %s %s %s" % (myExtent.XMin, myExtent.YMin, myExtent.XMax, myExtent.YMax))
dataFrame.extent = myExtent
arcpy.AddMessage("Final MAP extent pts: %s %s %s %s" % (dataFrame.extent.XMin, dataFrame.extent.YMin, dataFrame.extent.XMax, dataFrame.extent.YMax)) And the output is: Input extent pts: 3448672.2243 -3490621.8401 3449675.4603 -3490056.9226
Original extent pts: 2055276.37123 -4018755.96024 2055518.36111 -4018583.26583
... setting my extent xmin to: 3448672.2243
... setting my extent ymin to: -3490621.8401
... setting my extent xmax to: 3449675.4603
... setting my extent ymax to: -3490056.9226
New extent pts: 2055518.36111 -4018583.26583 3449675.4603 -3490056.9226
Final MAP extent pts: 2055518.36111 -4251785.42335 3449675.4603 -3256854.76508 Baffling! Why does myExtent.XMin not show the 3448672 value? Its being explicitly defined there. Whats more confusing, is that it DOES show myExtent.XMax correctly... Hopefully, its something obvious in there that I am missing,. Any help would be greatly appreicated. Thanks in advance, Richard.
... View more
06-09-2011
04:51 AM
|
0
|
10
|
1722
|
POST
|
Hi Derek, Thanks for helping out... 1. Well, surprisingly, the compact build did load this morning when I got into work. I thought the whole point of using the "cloud hosted" version is that it would always be available! Anyway, at least it was a server/delivery problem, so now I can use it again. 2. Go to: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jshelp/inside_faq.htm - "Frequently asked questions". The middle paragraph is as follows: While the ArcGIS JavaScript API is built on top of Dojo, you can use JavaScript libraries like JQuery or ExtJS in your applications. At version 2.0 we released a compact build of the ArcGIS JavaScript API. The compact build is small (~30kb) and does not include the dijit namespace on initial download so its a great option for those who wish to use a framework other than Dojo. The SDK contains a sample that shows how to work with the ArcGIS JavaScript API and JQuery or ExtJS. . I suppose its not critical, but I would certainly prefer a 30kb version than the 124kb currently available! Rich.
... View more
05-12-2011
09:58 PM
|
0
|
0
|
302
|
POST
|
Hi, I have developed a lightweight viewer that is to be used as an embedded object in some database applications created in other parts of my organisation. Now that it is working, I am trying to use the compact build to reduce the download size (I purposefully do not use much dojo in the mini-app) and have a couple of issues: 1. Loading from "http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.2compact" returns 403-forbidden, while the older version ((i.e. v=2.1 and v=2.0) do work fine. Why is that? 2. In the documentation (see FAQ under "Inside the API") it mentions that the download size is appealingly small, ~30kb. However, in pointing to v=2.1 the download is app 114kb. Why is it so "big"? Thanks for any light that can be shed on these queries... Cheers, Richard.
... View more
05-12-2011
05:23 AM
|
0
|
3
|
795
|
POST
|
@Derek: just wanted to say thanks for the hint. Actually, the JSAPI says that the argument to esri.hide/show is "The name of the HTML element", rather than the DOM element itself. Curiosly, passing just the element name (without enclosing in quotes) in Chrome and IE (!) works fine, but its Firefox that throws an error. I couldnt figure it out, but from your note I now use dojo.byId to pass the parameter and it works in all browsers. Rich.
... View more
05-12-2011
05:01 AM
|
0
|
0
|
336
|
POST
|
Hi Guys, I know this thread is old, but I am so happy that you helped me find my problem, I wanted to say thanks. You know, I spent SO much time checking, and re-checking the input parameter values and testing using the services directory, I never actually double checked the input parameter names themselves. Duh! Such relief! Cheers, Richard.
... View more
05-06-2011
02:29 AM
|
0
|
0
|
416
|
POST
|
Hi.. Thanks for the info about the geoprocessor. Indeed, I can now see (and retrieve) the generated PDF when using the geoprocessing task through the services interface. To test parameter input, I have written the exact values to the console (see code below), then copied and pasted them into the services interface - this is where I get a "esriJobSucceeded" status back. var params = {
"xMin": map.extent.xmin,
"yMin": map.extent.ymin,
"xMax": map.extent.xmax,
"yMax": map.extent.ymax,
"Spatial_Reference": map.spatialReference.wkid,
"Map_Scale": esri.geometry.getScale(map),
"Visiblelayers": dojo.toJson(visiblelayers),
"Layout": dijit.byId("mapLayout").value,
"Include_Attributes": dijit.byId("incAttribs").checked,
"Map_Title": dijit.byId("mapTitle").value,
"PointGraphics": getFeatureSet("point"), // optional
"LineGraphics": getFeatureSet("polyline"), // optional
"PolyGraphics": getFeatureSet("polygon") // optional
};
console.log("PDF PARAMETERS");
console.log(map.extent.xmin);
console.log(map.extent.ymin);
console.log(map.extent.xmax);
console.log(map.extent.ymax);
console.log(map.spatialReference.wkid);
console.log(esri.geometry.getScale(map));
console.log(dojo.toJson(visiblelayers));
console.log(dijit.byId("mapLayout").value);
console.log(dijit.byId("incAttribs").checked);
console.log(dijit.byId("mapTitle").value);
console.log(getFeatureSet("point"));
console.log(getFeatureSet("polyline"));
console.log(getFeatureSet("polygon")); I do use the getResultData function, but before that even fires, I check the status using the statusCallback as follows: function pdfStatusCallback(jobInfo) {
console.log(jobInfo.jobStatus);
if (jobInfo.jobStatus === "esriJobFailed") {
pdfErrorCallback();
}
} That console statement is never fired. So basically, the task is not even being sent to the service as expected (which would hint at a parameter issue like you say), but I cant see how since I am successfully using the same parameters using the services interface.. Still stumped! Richard.
... View more
04-15-2011
01:25 AM
|
0
|
0
|
379
|
POST
|
Hi there, I have setup a geoprocessing task (a python script) that generates a PDF based on a map document "template". The script takes a number of arguments, including map extent, SR, visible layers, etc. (the script is actually the "Export PDF web application and GP service sample" from David Spriggs). When I run this from ArcCatalog (as a tool) and enter some values, the tool runs and the PDF is created at my specified location on the local disk. However, when I access and run this very same task from my JSPAI application, it simply returns the error: "Error Submitting Job" (the error stack just points to the JSAPI - using v2.2). I have setup a proxy and this seems to work fine (I get a 200 status) when submitting the task. The parameters are definitely correct, as I have written them to the console, then copied and pasted them in the tool dialog (via ArcCatalog) and the tool runs fine. To test further, I used the SubmitJob page through the rest service directory. Again, I entered all the values and the results come back saying the task is complete. However, the PDF created is not located in the directory specified in the python script, but at some non-existent location (http://<server>/arcgisjobs/exportpdf_gpserver/j07d98f158f774503be941bcccedce974/scratch/Map_test6.pdf). So, is it that the GP task ignores the file paths of the original script and uses a setting of its own to save the new file? If so, where is that setting? Or is that just a temp path used by the rest service interface? Or am I totally confused? Any help or suggestions welcome. Thanks, Richard. P.S. It also might be worth noting that the GP error I get comes back very fast. When the tool runs successfully from arccatalog it can take up to a minute. So I am assuming the problem is "early" in the task (i.e. connection, variables, etc.) rather than in the task itself.
... View more
04-14-2011
05:25 AM
|
0
|
3
|
2921
|
POST
|
Hi Greg, Thanks for your reply. Actually, I have managed to get this by using the REST API - I just had to figure out a whole new language for accessing the json data via a dojo deferred request (esri.request). What I also discovered is that the REST API includes a "Legend resource" which publishes small images (swatch) for each layer in a service. At first I created swatches manually using dojo canvas and the renderer info. But after some cross-browser problems I discovered the Legend resource and that seems to work fine (and was easier to build!). Not something I would volunteer to do again, but certainly is possible! Cheers, Richard. P.S. I am using v10.
... View more
04-12-2011
03:19 AM
|
0
|
0
|
255
|
POST
|
Hi Everyone, Seems like a pretty simple task - hopefully there is a simple solution that I cant see. If I publish a map service with layers that have labeling setup and turned on, how do I turn those labels off dynamically? I can see in the REST info that the labeling info is provided, but cant see anything in the API to say labels.show() or labels.hide(). I have also tried using annotation as an alternative, but cannot seem to group all annotation into a single group layer, so that isnt looking like a viable work-around as yet. Thanks! Richard.
... View more
04-11-2011
10:46 PM
|
0
|
1
|
612
|
POST
|
Hi, Thanks for your inputs. I worked around it by calling an "init" function on the event, which in turn calls the "buildLayerList" function twice, each with relevant layers as parameters. Cheers, Richard.
... View more
03-22-2011
05:29 AM
|
0
|
0
|
496
|
POST
|
Hi Guys, I am coming across the same problem. In fact, it is not a bug with the legend widget, it has to do with how the rest service is defined from your layer symbology setup in ArcMap. I am building my own custom TOC and this had me stumped for a while. It happens in two instances that I am aware of: - using "Unique values" in ArcMap, selecting a few categories and grouping them manually - using "Unique values, many fields" in ArcMap (example in the attached esri_001.jpg) When you check the rest service information, you will see some 17 entries under "Unique Value Infos: ". Which is essentially re-splitting your groups and undoing all your hard work! (abbreviated screenshot at esri_002.jpg) So, you can workaround by creating a new column, and manually creating unique categories, but since our data is held in someone else's database, this is not an option for us. Is there some other approach to this? And/or will ESRI be looking at why this happens in Rest and if it can be fixed? Thanks, Richard.
... View more
03-18-2011
02:39 AM
|
0
|
0
|
931
|
POST
|
Ok, here goes: After literally playing around with pretty much every combination of code, in the blind hope that something would "appear" to me, I have discovered the following: When passing the layer object via a parameter to my function (after the layer has loaded): - the object can be written in full to the console - specific object properties are empty/null/bank and cannot be written However, when I run the exact same procedure, but call the layer object directly (i.e. no variables are passed as arguments to the function): - the object can be written in full to the console - any object property can be successfully read - including the layerInfos array The function argument seems to be the culprit, because even if I reference the original layer object, when an arbitrary (unused) argument is shared to the function, it stops working again. Now, Im not a professional developer, but that sure seems strange to me! Dont suppose anyone can throw some light on this conundrum? Richard.
... View more
03-18-2011
12:05 AM
|
0
|
0
|
496
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|