|
POST
|
I've been wondering about that, too since I can run the query using the REST query form. But, still no luck figuring it out. Here is my proxy.config file. <?xml version="1.0" encoding="utf-8" ?> <!-- Proxy config is used to set the ArcGIS Server services that the proxy will forward to. mustMatch: true to only proxy to sites listed, false to proxy to any site --> <ProxyConfig mustMatch="true"> <serverUrls> <!-- serverUrl options: url = location of the ArcGIS Server, either specific URL or stem matchAll = true to forward any request beginning with the url token = (optional) token to include for secured service dynamicToken = if true, gets token dynamically with username and password stored in web.config file's appSettings section. --> <serverUrl url="http://myhost.com/arcgis/rest/services/" matchAll="true"></serverUrl> </serverUrls> </ProxyConfig> I can access the map layer query service by this url (host name is changed): http://myhost.com/proxy/proxy.ashx?http://myhost.com/ArcGIS/rest/services/test/huc_centerpts/MapServer/0/query Looking at the NET traffic, it appears this is what is being requested, but I am seeing this error: Error: Unable to load http://myhost.com/proxy/proxy.ashx?http://myhost.com/ArcGIS/rest/services/test/huc_centerpts/MapServer/0/query status:0 Have you check to see if your ArcGISWebSerivces acount has the access of your services directory folder? Usually in C:\Inetpub\wwwroot\ArcGIS\rest. This is the acount that access your services or cache through web...
... View more
04-07-2011
01:14 PM
|
0
|
0
|
2914
|
|
POST
|
We have a geoprocessing service running in ArcGIS Server 10 sp1 java edition. It is basically the same as the population summary/demographics GP Example. The geoprocessing service runs fine in ArcMap and in ArcGIS Explorer as a service from ArcGIS Server. When trying to implement the service within a web app using the javascript api based on this sample http://help.arcgis.com/en/webapi/javascript/arcgis/demos/gp/gp_zonalstats.html (and even with the flex sample) I keep getting "dojo.io.script.jsonp_dojoIoScript2._jsonpCallback({"error":{"code":500,"message":"Error executing task 'SumZone'. Please check your parameters.","details":[]}});" We have tried everything 1. Running it locally 2. local jobs folder, etc 3. Both on 9.3.1 and 10 Here is the REST request with the geometry payload to execute the service http://igskaecgas010:8399/arcgis/rest/services/tmtools/ZonalStats/GPServer/SumZone/execute?f=json&env%3AoutSR=102100&env%3AprocessSR=102100&inputPoly={%22geometryType%22%3A%22esriGeometryPolygon%22%2C%22features%22%3A[{%22geometry%22%3A{%22rings%22%3A[[[-12089524.992070802%2C4855463.220549357]%2C[-12083410.029807992%2C4851488.49507853]%2C[-12084021.526034273%2C4851488.49507853]%2C[-12086773.259052537%2C4851488.49507853]%2C[-12089524.992070802%2C4849654.006399686]%2C[-12089524.992070802%2C4853017.2356442325]%2C[-12089524.992070802%2C4855463.220549357]]]%2C%22spatialReference%22%3A{%22wkid%22%3A102100}}}]%2C%22sr%22%3A{%22wkid%22%3A102100}}&callback=dojo.io.script.jsonp_dojoIoScript2._jsonpCallback Here is the web app (but the map server is internal so you wont be able to see that). A six pack to the one who can help me with this! The most trickest part of running a GP on ArcGIS server using JS API is how to configure the parameters of the GP. If you use JSON expression to configure your parameters, you have to be perfect on writting them including the order etc. Here is the secret: if you are not sure how to write your Json (Java Script Object Notation) expression, use Java Object itself: Here is a code sample from my works, hope it help: function clipLayer() { /* run the gp process to clip * and download TOPO and DEM layers * var ext = geometry.getExtent(); // for ArcGIS 9.3.1 * constraint the extent to the minimum. * var strExtent = "" + ext.xmin + " " + ext.ymin + " " + ext.xmax + " " + ext.ymax; */ var strExtent = "#"; var graphic = new esri.Graphic(); graphic.geometry = dataGraphic.geometry; /* parameter AOI */ var clipFeature = []; clipFeature.push(graphic); var clipFeatureSet = new esri.tasks.FeatureSet(); clipFeatureSet.features = clipFeature; /* parameter: featureformat or rasterformat */ var featureformat = ""; var rasterformat = ""; if (lyrChoise == 1) featureformat = document.getElementById("Output_Format").value; else rasterformat = document.getElementById("Output_Format").value; /* using javascript new Object() to set up parameters * pros: the order does not have to match with service directory * and much easy to write code * multi line statements and might be slightly slow */ var params = new Object(); params.Feature_Format = featureformat; params.Raster_Format = rasterformat; params.Extent = strExtent; params.Layer_to_Clip = layer; params.Area_of_Interest = clipFeatureSet; /* or using Json expression to set up parameters * cons: the order has to match with service directory * compact (one line) and might be slightly fast */ /* var params = { "Layer_to_Clip": layer, "Area_of_Interest": clipFeatureSet, "Feature_Format": featureformat, "Raster_Format": rasterformat, "Extent": strExtent }; */ //document.getElementById("btnProcess").disabled = true; //processDisabled = true; gp.submitJob(params, completeCallback, statusCallback, gpFailed); }
... View more
04-07-2011
12:52 PM
|
0
|
0
|
2610
|
|
POST
|
I have ArcGIS Server Enterprise with ArcSDE/PostgreSQL running on one windows XP machine. All queries, including spatial queries are working as expected. Then I moved the data and maps to another installation of ArcGIS Server Enterprise on Windows 2008 Server 64bit with ArcSDE/PostgreSQL on a separate Windows 2008 Server 64bit. I can re-run the javascript against the new installation and all of the spatial queries return an error: TypeError: _297 is null (undefined="null", undefined="[object Object]")arcgis?v=2.2 (line 48) (undefined="null")arcgis?v=2.2 (line 14) _144()arcgis?v=2.2 (line 14) _142(undefined="null")arcgis?v=2.2 (line 14) (undefined="null")arcgis?v=2.2 (line 14) _144()arcgis?v=2.2 (line 14) _142(undefined="[object Object]")arcgis?v=2.2 (line 14) [Break On This Error] If I comment out the code that includes the spatial query, the data is returned just fine. Here is the code where I am having problems. The query results are never returned and the inline function does not get executed: pquery.returnGeometry = false; pquery.outFields = ["*"]; pquery.geometry = geometry; pquery.spatialRelationship = query.SPATIAL_REL_CONTAINS; pquery.where = "length (huc_id) = 8"; hucCtrFeatureLayer.selectFeatures(pquery, esri.layers.FeatureLayer.SELECTION_NEW, function (features) { if (features.length > 0) { dojo.byId("messages").innerHTML = "HUC 8 Features found: " + features.length; } else { dojo.byId("messages").innerHTML = "No HUC 8 features found."; } }, displayErr); If I comment out these 2 lines, the query works just fine: pquery.geometry = geometry; pquery.spatialRelationship = query.SPATIAL_REL_CONTAINS; This same error is occurring for all spatial queries regardless of the layers. I checked for spatial indexing and the layers being queried are showing they have a spatial index. Any ideas? Thanks. have you add your new services directory to your proxy.config. When you do a spatial query, it usually involved geometry-huge querysting!. That means that most likely your query have to go throug POST not GET...
... View more
04-07-2011
11:11 AM
|
0
|
0
|
2914
|
|
POST
|
I have a set of geometries and need to overlay them on a point layer to determine points falling under the set of geometries. I use the Union function of Geometry service to combine the geometries and pass the unioned geometry to the Querytask object of point layer. The union works fine for small subset of geometries , but when large set of geometries are passed to Geometry service , the process takes a lot of time , often resulting in scripting error message �?��?�.Script is causing IE to slow down.�?� . Is there any alternative of passing a set of geometries (Array or List ) to a single Querytask object? I tried passing the extent of set of geometries to querytask , but extent picks up lot of additional points. Regards, Nidhi Arora. For a large set of geometries, Union is not an option. I had similar exprience. What i did is create a javascript function and do it on client... Here is my functin for your reference: function mergeGeometries(features) { /* STR search might result * multi polygons * merge them into a single one */ var polygon = features[0].geometry; for (i = 1; i < features.length; i++) { var poly = features.geometry; for (j = 0; j < poly.rings.length; j++) { polygon.addRing(poly.rings ); } } return polygon; } hope it will help.
... View more
04-07-2011
07:39 AM
|
0
|
0
|
1025
|
|
POST
|
Google and ESRI are in some kind of GIS power struggle. I'm not sure what it's about. I suppose you could find some answers on the internet. I asked an ESRI rep about it at a class and the very question made him uncomfortable. You will note that the ArcGIS JS API can consume Bing's map tiles. This is how I see it; ESRI and Microsoft are friends while Google and Microsoft aren't, and all of them are tech giants. Draw your own conclusions. ArcGIS Extension for the Google Maps API is simple and beautiful, however it has some limitations. Concerning GMaps v3, the API itself has changed to MVC and is hard to work with for in-depth GIS web app development. Google Code has a code library called google-maps-utility-library-v3 which can be found here. While it works well for adding dynamic layers, etc; it has some problems. The biggest one is you cannot print maps with overlays on. I suppose it works well enough for simple maps. I personally wouldn't spend a second with it, unless you like being disappointed. I've been deploying ArcGIS Server and building full functioning web-based GIS applications for a few years now. Here's my advice: switch to ArcGIS JS API or Flex. Both are way more powerful. ArcGIS JS API is particularly powerful when deployed with asp.net instead of just html. Even better if your data is stored in ArcSDE. The web-based GIS application possibilities are endless. But you say you want GMap tiles? You can have it. Find a library here that allows you to consume Gmap tiles with ArcGIS JS API. This is a simple example. To make it work well in a complex application you have to apply some tweaks. I wouldn't say ESIR GIS application possibilities are endless. How about switch base maps between 2D and 3D, real time traffic, etc. The point here is Google map complements ESRI GIS. Google map APIs concentrate on providing informative data to the public while ESRI Web api are powerful on analysis and solving specific GIS related issues. They complete each other...
... View more
04-07-2011
05:07 AM
|
0
|
0
|
1589
|
|
POST
|
I just found out from my sales rep in the Olympia regional office, that Esri does not plan to support the Google Map V3 API. The V2 API has been deprecated since last May. I think this is a huge mistake. It also seems very protective and short-sighted on their part. I�??d like the user community to weigh in here. If what you said is true, that is very unfortunate. From my personal development expriences, ArcGIS JavaScript Extension for the Google Maps API is still my favorite among ESRI JS APIs. It mashes with Google Map API in such a way that it enriches the ESRI GIS functionalities with variety of Google Map services (streeview, traffic, directions, weather, local search, 3D in Google Earth plug in... to name just a few). ESRI ought to embrace it other than shy away from it.
... View more
04-06-2011
11:47 AM
|
0
|
0
|
1589
|
|
POST
|
Hi, I want to calculate the centroid of the polygon . I tried using Polygon.getExtent().getCenter( ) , but this fn does not return the true center , for example , if the polygon is C shaped. Any thoughts in this aspect will be appreciated. Regards, Nidhi. If the polygon is the result of a task(find, query, identify) on a map/feature service, you could add two fields (x, y) on the polygon layer and populate centroid's x and y using calculate geometry on ArcMap. So when you got the polygon, you could fetch x and y using graphic attributes["x"] and attributes["y"]. If the polygon is the result of a drawing, sorry the current JS api esri.Geometry doesn't have such method as getTrueCentroid. In this case, you might want to create a samll python script as a gp service to calculate centroid of the polyon. Because in Arcpy, Geometry does have a method like trueCentroid(or something like that-can't remember exactly). Another thought: A polyon locator will return centroid point as a result...
... View more
04-05-2011
01:23 PM
|
0
|
0
|
1623
|
|
POST
|
Hi, I have implemented the validation text box for the editing Widget using the JavaScript API, but it does not prevent invalid entries from submission into the database. The input text box on the attribute inspector will have a warning showing the attribute is not valid, but if the user submits the change, it still goes through. I believe I need to use dijit.form.form widget to ensure invalid attributes are not submitted, but I am not quite sure how to implement this. Any examples out there? Thanks. First of all, if you set wrong type of data for an attribute field for example put a text string info a field with double type, the field will not accept a value. Secondly, if your specified a domain and/or subtypes for the attribute field, the field will not accept a value that is not in that domain or subtypes. In both cases the field value will not updated. Thirdly, you could further constrict the entries by code logice using validation like in your case. Something like the following: dojo.connect(attInspector, "onAttributeChange", function(feature, fieldName, newFieldValue) { // specify thefieldName you want to further validate if (fieldName ==thefieldName) { var regularExpression = /^\d+(\.\d+)?$/; //for example a positive value if ( newFieldValue.match(regularExpression)) { feature.attributes[fieldName] = newFieldValue; feature.getLayer().applyEdits(null, [feature], null); } else { //alert("invalid entries for field " +fieldName); return; } else { feature.attributes[fieldName] = newFieldValue; feature.getLayer().applyEdits(null, [feature], null); } ... });
... View more
04-04-2011
11:30 AM
|
0
|
0
|
1007
|
|
POST
|
Hi, I've got an Identify Task that opens an infoWindow and highlights the clicked feature using a map graphic. I want to clear the graphic when the infoWindow is closed but can't get it to work. I tried using onHide() with no success: map.infowWindow.onHide(clearGraphics);
function clearGraphics() {
if (map.graphics) {map.graphics.clear()};
} Any ideas? try this instead of map.infowWindow.onHide(clearGraphics): dojo.connect(map.infoWindow, "onHide", clearGraphics);.
... View more
03-31-2011
06:21 AM
|
0
|
0
|
472
|
|
POST
|
This example does not use the editor to edit the feature shapes. If I load my feature layer in my application but disable the editor then sure enough I can customise the infoTemplate and even stop the infoWindow appearing as you suggest in an earlier post, but with the editor and template picker in use on the feature layer I cannot control the infoTemplate and cannot prevent the infoWindow appearing. Do you have any more suggestions? Thanks again. To my understanding, if you use template picker, the editor itself will use the infowindow to display attributes. So how to use editor without showing infowindow is tricky. I have not done this so i really could say much any more on this. Perhaps you might want to think about other options such as update your feature without using editor...
... View more
03-31-2011
06:16 AM
|
0
|
0
|
1635
|
|
POST
|
Hi, I appreciate all your responses, but I'm still getting nowhere. I have tried defining an infoTemplate, but the infoWindow that appears when I click a shape for editing is just the default template, for some reason I don't seem to be able to alter it. Below is my code that runs to load the editor service if that gives any clues. I haven't used the infoTemplate before so I could be getting it wrong. Also, I still have the code in place which should stop the window appearing anyway, and that's not taking effect. If you have any working code you don't mind sharing then please post it. Thank you. function loadEditor() {
infoTemplate = new esri.InfoTemplate();
infoTemplate.setContent("<b>Reference: </b>${APP_REF}");
planAppsLayer = new esri.layers.FeatureLayer("http://myServer/ArcGIS/rest/services/Test/myService/FeatureServer/0", {
mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
infoTemplate: infoTemplate,
outFields: ["*"]
});
dojo.connect(map, "onLayersAddResult", initEditing);
map.addLayers([planAppsLayer])
} It could not be any better than just use the ESIR sample: I picked up the following one. http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/fl_selectfeatures.html. Just add showInfoWindowOnClick: false in sample's statement: var map = new esri.Map("map", { extent: esri.geometry.geographicToWebMercator(initialExtent), slider: true, nav: true }); Watch the behaviors with and without showInfoWindowOnClick: false. You can see it clearly take effect on the behavior of infowindow.
... View more
03-31-2011
05:14 AM
|
0
|
0
|
1882
|
|
POST
|
Kevin, I am now having the same exact problem, and I have tried all the solutions that you have tried. Can you tell me how you used esri.config.defaults.io.timeout in your code? Where did you place it? If I could see a sample of the code with it, that would be great! Thanks! Jeff McCullough If you set GP service Execution type as Asynchronous (on Parameters tab) and then its timeout property is controlled by The maximum time a client can use a service(on Pooling tab). you don't have to set esri.config.defaults.io.timeout. Just remember in API using GP.sumbitJob instead of GP.execute.
... View more
03-29-2011
11:47 AM
|
0
|
0
|
1355
|
|
POST
|
Hi, No, that doesn't work either, I have: map = new esri.Map("mapDIV", { extent: customExtent, showInfoWindowOnClick:false }); And the infoWindow still appears when editing, the above probably only applies to the Identify. Any chance you feel like trying it to make sure it's not just me? Thanks. Well i looked at the API carefully. It stated showInfoWindowOnClick:false only works "if the Graphic has a defined InfoTemplate when the user clicks on the graphic". I tested it. showInfoWindowOnClick:false indeed worked on a layer (feature or graphiclayer) which has a defined infoTemplate. It did not honored if the layer has no infoTemplate attached. You might have to define a infoTemplate so you can workround it. Good luck.
... View more
03-29-2011
09:52 AM
|
0
|
0
|
1882
|
|
POST
|
Hi, These don't work. I have tried both. The problem is the hide(), it is not a 'stop', so the infoWindow still shows, so in the case of the event ideas you suggest I expect the hide() actually fires before the show, or I can put some logic in my code to hide() a split second after the show, but the infoWindow still shows for a split second. I think I need to disable the infoWindow by some other technique but I don't know what. With the Identify code you actually code the infoWindow.show() to open the infoWindow at the appropriate time, but that seems to be hidden with the editor. Mark. Then you might want to set map's showInfoWindowOnClick as false as default and only show it when necessary. like this map = new esri.Map("map", { ......, showInfoWindowOnClick:false });
... View more
03-29-2011
07:37 AM
|
0
|
0
|
1882
|
|
POST
|
Hi, Thanks for that. What event works with this? I have tried a few things that don't work, and I can use map.infoWindow.hide() to hide the window a split second after it appears, but not to stop it appearing in the first place. Can you please post the code? Thanks. could be in dojo.connect(map, "onClick", function(evt){ map.infoWindow.hide();.... }); or dojo.connect(yourfeaturelayer, "onClick", function(evt){ map.infoWindow.hide();.... }); depending upon your code logic..
... View more
03-29-2011
05:09 AM
|
0
|
0
|
1882
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-11-2011 12:16 PM | |
| 1 | 05-25-2017 08:26 AM | |
| 1 | 06-02-2017 07:37 AM | |
| 1 | 06-28-2011 07:02 AM | |
| 1 | 06-12-2017 10:10 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-01-2024
09:57 PM
|