POST
|
Thank you so much for your response I do view the service using the JavaScript preview from the services directory... Please, Any other ideas ? Someone I work with said that the problem was the browser options in the in the "load images automatically" options but I'm not that sure about that... Can you browse to "http://servarcgisprd" directly?
... View more
08-19-2010
07:48 AM
|
0
|
0
|
215
|
POST
|
Ok, my apologies...glad it help in another way..... Does the buffer graphic display as you expect it to? What SR is the query map service in? The buffer graphic displays correctly. To simplify everything, I verified and am using 4326 (WGS84) for every thing.
... View more
08-14-2010
11:52 AM
|
0
|
0
|
325
|
POST
|
Can you verify that you're setting your query geometry correctly? Double-check that you're handling the result of the buffer properly. Here is another piece to the puzzle. I verified that the geometry is correct. What I found is that, the post is being encoded into html, and the (" - quotes) within the json to specify the buffer perimeter (around wkid, and ring for example) don't appear to be un-encoding back to quotes. I'm not sure if this is caused from any of the following: From the Proxy configuration From the Setup in my JavaScript or, from the Proxy debugger (Charles) I used to verify which parameters were being sent. I'll look into this some more and do some more testing, but when I do a post to the rest query for this layer, it's happy so long as the parameters are not URL-encoded.
... View more
08-14-2010
11:51 AM
|
0
|
0
|
325
|
POST
|
Hello, I believe that you have an error in your configuration but not in your proxy setup. I think you need to increase the maximum records allowed within your config file for your mapservice. The config file defaults to 500 so I'm assuming that is where you getting your returned count from. Once you increase the value in the cfg file, be sure to restart your ArcSOM service (or reboot) as this is needed when making any changes to the cfg files. Sorry I can't give you the path to the cfg file because I don't have access to my server right not but it's something like ArcGIS install path\server\usr\config -----Don't quote me on that.....if you search for .cfg on your ArcGIS Server server the config file will have your map service as part of its name. Thanks for this answer! It made me realize I need to clarify a little, but its also a question I had going forward, so you beat me to the punch! I'll be using this configuration information in the very near future. Sorry for not being clear. The problem in the case I'm having is not that it's only returning 500 records... the data I am using and the buffer I'm using shouldn't be returning more than 50-100 records. The problem is that the points are not within the buffered point.
... View more
08-14-2010
08:52 AM
|
0
|
0
|
325
|
POST
|
I'm finally able to play with the ArcGIS API for JavaScript! To get started, I am playing with deploying the functionality that similar to the sample for "Query Map with buffer polygon:" http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jssamples_start.htm However, now that I think I have solved the proxy problem (Yikes, Jeremy et al., please include a link in the example of how to install the proxy!), I am finding that the buffer isn't limiting the result to the region inside the buffer. Is this due to a configuration error on my part with the proxy server? I always receive 500 results from the full extent of a several thousand point Layer file served VIA REST. Here's my code snippet:
dojo.require("esri.map");
dojo.require("esri.tasks.query");
dojo.require("esri.tasks.geometry");
/*Initialize map, buffer, & query params*/
function init(){
var startExtent = new esri.geometry.Extent(-119, 40, -110, 50, new esri.SpatialReference({
wkid: 4326
}));
var map = new esri.Map("mapDiv", {
extent: startExtent
});
//listen for when map is loaded and then add query functionality
dojo.connect(map, "onLoad", initFunctionality);
var streetMap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer");
map.addLayer(streetMap);
}
function initFunctionality(map){
var queryTask = new esri.tasks.QueryTask("http://MYDOMAIN/gis/rest/services/develObservations2/MapServer/0/query");
//identify proxy page to use if the toJson payload to the geometry service is greater than 2000 characters.
//If this null or not available the buffer operation will not work. Otherwise it will do a http post to the proxy.
esriConfig.defaults.io.proxyUrl = "../server/proxy.ashx";
esriConfig.defaults.io.alwaysUseProxy = true;
// Query
var query = new esri.tasks.Query();
query.returnGeometry = true;
query.outFields = ["MYOUTPUTFIELDS"];
//Geometry Service Endpoint
var gsvc = new esri.tasks.GeometryService("http://MYDOMAIN/gis/rest/services/Geometry/GeometryServer");
// +++++Listen for map onClick event+++++
dojo.connect(map, "onClick", function(evt){
map.graphics.clear();
var symbol = new esri.symbol.SimpleMarkerSymbol();
var graphic = new esri.Graphic(evt.mapPoint, symbol);
var params = new esri.tasks.BufferParameters();
params.features = [graphic];
// CASE [1]: if you want to buffer in linear units such as meters, km, miles etc.
params.distances = [dojo.byId('bufferDistance').value];
params.unit = esri.tasks.BufferParameters.UNIT_KILOMETER;
params.bufferSpatialReference = new esri.SpatialReference({
wkid: 4326
});
gsvc.buffer(params);
dojo.byId('messages').innerHTML = "<b>Creating Buffer Using Geometry Service...</b>";
});
// +++++Listen for GeometryService onBufferComplete event+++++
dojo.connect(gsvc, "onBufferComplete", function(graphics){
var symbol = new esri.symbol.SimpleFillSymbol("none", new esri.symbol.SimpleLineSymbol("solid", new dojo.Color([255, 0, 0]), 2), new dojo.Color([255, 255, 0, 0.25]));
var graphic = new esri.Graphic(graphics[0].geometry, symbol);
map.graphics.add(graphic);
query.geometry = graphic.geometry;
queryTask.execute(query);
dojo.byId('messages').innerHTML = "<b>Executing Query with Result Buffer Geometry...</b>";
});
// +++++Listen for QueryTask executecomplete event+++++
dojo.connect(queryTask, "onComplete", function(fset){
//create symbol for selected features
var symbol = new esri.symbol.SimpleMarkerSymbol();
symbol.style = esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE;
symbol.setSize(8);
symbol.setColor(new dojo.Color([0, 255, 255, 0.5]));
//THERE IS PROBABLY A BETTER WAY TO DO THIS, BUT I HAD ISSUES WITH LABELING POINTS AS A MULTIPOINT
var resultFeatures = fset.features;
for (var i = 0, il = resultFeatures.length; i < il; i++) {
var thisx = resultFeatures.attributes.XMin;
var thisy = resultFeatures.attributes.YMin;
thisgeometry = new esri.Graphic(new esri.geometry.Point(thisx, thisy, new esri.SpatialReference({ wkid: 4326 })));
infoTemplate = new esri.InfoTemplate("Observation of " + resultFeatures.attributes.SciName + " ID:" + resultFeatures.attributes.observationid, "Info: " + resultFeatures.attributes.Title);
thisgeometry.setInfoTemplate(infoTemplate);
thisgeometry.setSymbol(symbol);
map.graphics.add(thisgeometry);
}
var totalObservations = resultFeatures.length;
dojo.byId('messages').innerHTML = "<b>The total Observations within the buffer is <i>" + totalObservations + "</i>.</b>";
});
}
dojo.addOnLoad(init);
... View more
08-13-2010
10:02 AM
|
0
|
6
|
625
|
POST
|
Finally i found the solution and here it is... CSS: .orangeSprite { background-image: url(images/orangeinfowindow.png) !important; _background-image: none !important; color: White; _filter: progid: DXImageTransform.Microsoft.AlphaImageLoader(enabled='true', sizingMethod='crop', src='images/orangeinfowindow.png') !important; } Code: Before showing the infowindow, please use the below code: var infoWindow = map.infoWindow; var sprite = dojo.query('.sprite', infoWindow.domNode); for (var i = 0; i < sprite.length; i++) { sprite.className = 'sprite orangeSprite'; //sprite is the default class for infowindow and orangeSprite has the actual sprite image to be displayed. } map.infoWindow.resize(380, 220); Now call the resize() method. You will get the new sprite image, instead of the default provided. Regards, Ravi. Clever, Ravi. I will have to try that.
... View more
08-13-2010
09:50 AM
|
0
|
0
|
280
|
POST
|
Hi Kelly, I have tried the following code and it was working fine in my scenario. But when i buffer a point for a radius of 10 KM using geometry service and pass the resultant polygon (in my case a circle) to the query filter it doesn't filter. But the same polygon if i convert to extent it works fine. Any idea why this behavior is? Regards, Ravi. Ravi, did you set up a proxy server and reference it in your code? http://resources.esri.com/help/9.3/ArcGISServer/apis/javascript/arcgis/help/jshelp_start.htm#jshelp/ags_proxy.htm Any querystring longer than 2000 characters just won't work due to Web browser limitations.
... View more
08-13-2010
09:47 AM
|
0
|
0
|
982
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|