|
POST
|
you need the execute the second query task. Please make sure geometryEngine and array are part of the require/define modules. function showResults(results) {
var resultItems = [];
var inBuffer = [];
var resultCount = results.features.length;
for (var i = 0; i < resultCount; i++) {
inBuffer.push(results.features.geometry);
var featureAttributes = results.features.attributes;
var graphic = results.features;
graphic.setSymbol(symbol);
map.graphics.add(graphic);
var strNum = 100;
var newExtent = graphic.geometry.getExtent();
newExtent.xmin = newExtent.xmin - strNum;
newExtent.ymin = newExtent.ymin - strNum;
newExtent.xmax = newExtent.xmax + strNum;
newExtent.ymax = newExtent.ymax + strNum;
map.setExtent(newExtent);
for (var attr in featureAttributes) {
resultItems.push("<b>" + attr + ":</b> " + featureAttributes[attr] + "<br>");
}
resultItems.push("<br>");
}
var query2 = new Query();
query.geometry = geometryEngine.union(inBuffer);
query2.returnGeometry = false;
query2.outFields = [ "NAME" ];
var resultNames = [];
var queryTask2 = new QueryTask("http://rest/services/live/SEARCH/MapServer/15");
queryTask2.execute(query2, function(result){
if(result && result.features.length > 0){
array.forEach(result.features, function(feature){
resultNames.push(feature.attributes.NAME);
}
}
});
dom.byId("info").innerHTML = resultItems.join("") + "<BR>" + resultNames.join(",");
}
... View more
07-06-2015
08:53 AM
|
1
|
0
|
3623
|
|
POST
|
My understanding is featureLayer is polygon feature layer and featureLayer2 is point feature layer. so when in query the 1st layer use query.where instead of circle var query = new Query(); query.where= "1=1"; // or the condition of you polygon selection. //use a fast bounding box query. will only go to the server if bounding box is outside of the visible map featureLayer.queryFeatures(query, selectInBuffer); and on the result, combine all the polygons and get the 2nd layers.
... View more
07-06-2015
08:03 AM
|
1
|
3
|
3928
|
|
POST
|
the sample is not buffering any geometry. it is union of all the geometries. you could use where clause "1=1" on the first layer. and then combine all the polygons and query on the second layer. PS: You need to watch out for the map service limit.
... View more
07-06-2015
07:49 AM
|
0
|
5
|
3928
|
|
POST
|
you code should be something like this. It has not been tested. The example shows using the geometry, you could also build where clause as well function showResults(results) {
var resultItems = [];
var inBuffer= [];
var resultCount = results.features.length;
for (var i = 0; i < resultCount; i++) {
inBuffer.push(results.features.geometry);
var featureAttributes = results.features.attributes;
var graphic = results.features;
graphic.setSymbol(symbol);
map.graphics.add(graphic);
var strNum = 100;
var newExtent = graphic.geometry.getExtent();
newExtent.xmin = newExtent.xmin - strNum;
newExtent.ymin = newExtent.ymin - strNum;
newExtent.xmax = newExtent.xmax + strNum;
newExtent.ymax = newExtent.ymax + strNum;
map.setExtent(newExtent);
for (var attr in featureAttributes) {
resultItems.push("<b>" + attr + ":</b> " + featureAttributes[attr] + "<br>");
}
resultItems.push("<br>");
}
var query = new Query();
query.geometry = geometryEngine.union(inBuffer);
//your second query should come here
//var queryTask2 = new QueryTask("http://rest/services/live/SEARCH/MapServer/15");
//query2 = new.esri.tasks.Query();
//query2.returnGeometry - false;
//query2.where = ""
dom.byId("info").innerHTML = resultItems.join("");
}
... View more
07-06-2015
07:29 AM
|
0
|
3
|
3623
|
|
POST
|
You can use two Feature layers instead of one, similar to same example like this function selectInBuffer(response){
var feature;
var features = response.features;
var inBuffer = [];
//filter out features that are not actually in buffer, since we got all points in the buffer's bounding box
for (var i = 0; i < features.length; i++) {
feature = features;
if(circle.contains(feature.geometry)){
//TODO: if the feature.geometry is point then buffer the point here
inBuffer.push(feature.geometry);
}
}
var query = new Query();
query.geometry =geometryEngine.union(inBuffer);
featureLayer2.selectFeatures(query, function(results){
//TODO: do something with the second layer result
});
}
... View more
07-06-2015
07:21 AM
|
0
|
7
|
3928
|
|
POST
|
Not necessarily, you could easily build a whereClause within the loop or get a Union of all the geometries and than use it in the query after the looping.
... View more
07-06-2015
07:02 AM
|
0
|
0
|
3623
|
|
POST
|
I dont understand your problem, do you want to use the result of one querytask to make a query on another layer. is that what you are asking for?
... View more
07-06-2015
06:59 AM
|
1
|
11
|
3623
|
|
POST
|
The IGeometry has a method project which you can use to project the geometry object to what ever coordinate system you want. ArcObjects 10 .NET SDK Help
... View more
07-06-2015
06:11 AM
|
0
|
0
|
6702
|
|
POST
|
No, deleting the gdbVersion will not be useful. You need to use setGDBVersion method only. As there are dependent properties / activities that needs to be done. theLayer.setGDBVersion(null); This will work.
... View more
07-03-2015
11:49 AM
|
0
|
0
|
1592
|
|
POST
|
the featureLayer has gdbVersion property. But, it would be undefined if you have not used setGDBVersion()
... View more
07-02-2015
10:35 AM
|
1
|
3
|
1592
|
|
POST
|
You should probably ask this question in a different form. Well, there are couple of place you could start looking into. Check the projection system in the map document used to create the service. The projection system used to create the tile schema In general review all the projection system carefully.
... View more
07-02-2015
06:58 AM
|
1
|
0
|
742
|
|
POST
|
Yes. you need to compare the ObjectId of the clicked object with the one from Query and set the value of ii variable to the appropriate index. so that your next/previous will work like normal.
... View more
07-01-2015
01:12 PM
|
2
|
1
|
4445
|
|
POST
|
If searchMoreResultsHtml is showing duplicates, Than you can completely remove if by removing the line tpl +=</div><div>${searchMoreResultsHtml}</div></div></div>"
... View more
07-01-2015
12:03 PM
|
0
|
0
|
3443
|
|
POST
|
I feel 5000+ is still a big number. See you you segregate the prefix suffix and street type, and see if the number reduces. Otherwise, keydown is not as bad, if you have a minimum chars before you start pinging to the server. The lesser the result set the better the response time.
... View more
07-01-2015
10:15 AM
|
1
|
1
|
1963
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-24-2017 07:15 AM | |
| 1 | 09-13-2016 06:27 AM | |
| 1 | 05-21-2015 08:06 AM | |
| 1 | 12-16-2015 05:43 AM | |
| 1 | 07-20-2015 09:33 AM |
| Online Status |
Offline
|
| Date Last Visited |
05-13-2026
09:55 AM
|