The error "esri. config. defaults. io. proxyUrl has not been set" occurs when the element in the circle with a certain vertex radius is queried by ArcGIS API for Javascript. esriarcgis
When Query is used, the following configuration is used:
var queryTask = new esri.tasks.QueryTask(applicationModelOneSearchPOIURL); var query = new esri.tasks.Query(); query.geometry = geometry; query.outSpatialReference = map.spatialReference; query.spatialRelationship = esri.tasks.Query.SPATIAL_REL_INTERSECTS; query.returnGeometry = true; queryTask.execute(query, ApplicationModelOneGetSearchData, ErrorCallBack);
Query is usually selected in the box. geometry, we usually assign an Extent variable, but when we need to query with a Polygon such as a circle, esri will appear. config. defaults. io. proxyUrl has not been set "error
Because of polygon (multiple points contained), the number of url parameters of web service is greater than 2048. Here we use the get method (the maximum number of characters is 2048) instead of the post method. So we need a proxy page for proxy, specific reference http://blog.csdn.net/lz576825608/article/details/7989391
Add an esri before the query. config. defaults. io. proxyUrl = "proxy. ashx "; then go to the Internet to download the relevant files, on the proxy. ashx and proxy. add the corresponding configuration code in config. Configure the code in proxy. config to add <serverUrl url = "http: // myserver/ArcGIS/rest/services/POI/Shoping/MapServer/0"
MatchAll = "true"
Token = ""> </serverUrl>
Online Editing of arcgis api for javascript
It may be that the published service type is incorrect, and what type of data are used? If you want to edit the data, you 'd better use file geodatabase, personel geodatabase, or arcsde. We recommend that you use the fiddler2 software, the fiddler2 software allows you to view the data uploaded to the map SERVER (access the SERVER you set up) and the data returned by the map SERVER, and then use the demo (access the arcgis server online server) are there any differences between uploading and returning data? First, check whether your code is faulty, or the server is faulty, and there are more problems with the code, it may be that the data returned by your SERVER is different from the data returned by arcgis server online. (The data must be different in many cases. You need to adjust the code at this time ), your code needs to be adjusted. The code is okay. When you access the online data of arcgis server, it does not mean that the data in the accessed area is okay. It may also be a problem with your service. The service has not been released.
I often encounter failures or errors in using my own server in the official demo. Generally, I use fiddler2 and alert (JSON. stringify (arr), JSON. stringify () can convert many objects (not all) into strings, compare them with the data of the official demo and accessing arcgis server online, locate the error, and then troubleshoot, not only data, but also objects, edit objects, and featerset objects. Are there any problems with objects. You can also use alert ("0000") to check the code execution stops. If the same object is executed, check whether the data has any problems.
How to customize online map editing using ArcGIS API for javascript
1. Data should be stored in the database
2. Enable the enterprise-level geographic database
3. register the database to arcgis server
4. Publish the data to be edited as a factor service
5. You can use js APIs on the client to edit data.
Good luck!