|
POST
|
I would like to try Ken's approach since it's cleaner. But if you like a quick-n-dirty solution, here is one. .dgrid-scroller {
margin-top: 25px !important;
}
... View more
12-03-2013
04:51 AM
|
0
|
0
|
1104
|
|
POST
|
Try to build the geoprocessing parameter as below, and feed it to the geoprocessing service: var features = [];
features.push(inPolygon);
var geoParam = new esri.tasks.FeatureSet();
geoParam.features = features; Here is a sample from ESRI.
... View more
12-02-2013
07:43 PM
|
0
|
0
|
533
|
|
POST
|
One thing I would try is to Change: on(layer, "click", function(evt) {}) To: layer.on("click", function(evt) {}); Based om dojo/on document, on(layer, "click", ...) is applied to dom elements, which means it considers layer as a dom element instead of an esri/layers/FeatureLayer. Use layer.on("click", ...) to define the callback function for FeatureLayer.onClick event.
... View more
11-28-2013
04:46 PM
|
0
|
0
|
1692
|
|
POST
|
Nice summary, Ben. Thank you very much for taking time to share your experience.
... View more
11-25-2013
06:26 PM
|
0
|
0
|
933
|
|
POST
|
Cool. Thanks Jian. You always have an answer for my questions:) Happy Thanksgiving!
... View more
11-25-2013
04:12 AM
|
0
|
0
|
921
|
|
POST
|
There is no existing spatial query tool provided by JS API. You can use the draw toolbar to draw a graphic. Then use it to perform spatial query using either QueryTask or featureLayer.queryFeatures. Here are two samples you can refer to: Draw toolbar: http://developers.arcgis.com/en/javascript/samples/toolbar_draw/ Spatial Query sample: https://developers.arcgis.com/en/javascript/jssamples/fl_selectfeatures.html
... View more
11-22-2013
07:01 PM
|
0
|
0
|
616
|
|
POST
|
Try the below code. It should be much more efficient than loop through each geometry for reproject and intersect operations. If not working still, please point out which line failed. documents.queryRelatedFeatures(queryRecPoint, function (relatedRecords) { fset = relatedRecords[fsetObjectIDArrayPoint[0]]; params = new esri.tasks.ProjectParameters(); params.geometries = array.map(fset.features, function (aFeature) { return aFeature.geometry; }); params.outSR = map.spatialReference; //gsvc is my geometry service gsvc.project(params, function (geoms) { gsvc.intersect(geoms, firstGraphic.geometry, function (intGeoms) { var symbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE, 10, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0, 200, 200]), 1), new dojo.Color([0, 0, 200, 0.25])); array.forEach(intGeoms, function (aGeom) { var intersectGraphic = new esri.Graphic(aGeom, symbol, null, infoTemplate); map.graphics.add(intersectGraphic); }); }); }); });
... View more
11-22-2013
01:18 PM
|
0
|
0
|
1715
|
|
POST
|
I see. Unfortunately, I don't see a direct way to do that. What you can do is to use geometryService.intersect(geometries,geometry,callback?,errback?) to filter the geometries returned from the relationship query.
... View more
11-22-2013
09:05 AM
|
0
|
0
|
1715
|
|
POST
|
ionara, I have replied to you in another post: http://forums.arcgis.com/threads/97254-Feature-Layer-layer-as-a-variable. Please remember that once a feature layer is added to the map, it will stay there until you specifically remove it or hide it. In the above reply, I haven't specified how you will remove or hide the loaded layers. That should be an easy task to accomplish though. Otherwise, let me know.
... View more
11-22-2013
08:41 AM
|
0
|
0
|
545
|
|
POST
|
Can you explain a bit more what you like to accomplish?
... View more
11-22-2013
08:36 AM
|
0
|
0
|
1715
|
|
POST
|
What you can do is to declare a module or global level variable, which will be a key-value hash object. Here is the concept-proof code. var loadedFeatLayers = {};
dojo.connect(dijit.byId("Activity"), 'onChange', function(value){
activity = dijit.byId('Activity');
var layerId = activity.item["layerId"]; // item["layerId"] may be an array; if so, use item["layerId"][0]
var layer = loadedFeatLayers[layerId];
// if the feature layer not created, create it.
if (!layer) {
loadedFeatLayers[layerId] = new FeatureLayer("http://tfsgis-iisd01:6080/arcgis/rest/services/FeatureServiceStewAAreaAPoint/FeatureServer/" + layerId, {
mode: FeatureLayer.MODE_SELECTION,
id: 'stewardship_' + layerId,
outFields: ['*']
});
map.addLayer(loadedFeatLayers[layerId]);
}
// if loaded, make it visible if not visible
else {
if (!layer.visible) layer.setVisibility(true);
}
});
... View more
11-21-2013
05:48 PM
|
0
|
0
|
946
|
|
POST
|
My fault. activity.item is the current selected item that should have everything you need. Try var layerId = activity.item["layerId"];
... View more
11-21-2013
09:25 AM
|
0
|
0
|
1459
|
|
POST
|
The code snippet in my previous post just gives some idea how to get the layer id from the combobox. Ok, in your case, I assume all dataArrayXXXX are the data hosting the layer info. If that is the case, after adding layerId property to each dataArrayXXXX array, then activity = dijit.byId('Activity');
var layerId = activity.store.getValue(activity.item, "layerId");
... View more
11-21-2013
08:41 AM
|
0
|
0
|
1459
|
|
POST
|
What mode do you set when creating the feature layer? Try to use MODE_SNAPSHOT instead of the other two.
... View more
11-21-2013
08:08 AM
|
0
|
0
|
612
|
|
POST
|
Add one property to each data array, like dataArray = [
{name:"Forest Stewardship Plan", id:"0", layerId: 0},
{name:"Non Forest Stewardship Plan", id:"1", layerId: 1},
...
]; Then assume cboLayers is the combobox that built with a store using dataArray. var layerId = store.getValue(cboLayers.item, "layerId");
... View more
11-21-2013
08:02 AM
|
0
|
0
|
1459
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-17-2013 05:16 AM | |
| 1 | 11-06-2013 04:34 AM | |
| 1 | 08-29-2013 10:58 AM | |
| 6 | 10-20-2020 02:09 PM | |
| 1 | 11-20-2013 06:09 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-17-2024
08:41 AM
|