|
POST
|
Yes, you should be able to execute any tool in the Geoprocessing toolbox like that. I've always used the syntax used in the "Executing a system tool with managed assembly" section. However, I'm surprised that the GPXToFeature tool isn't in the ArcObjects API reference (like this one for FeatureToRaster). Then again, none of the toolboxes after DataManagementTools are showing up, either.
... View more
11-06-2013
07:01 AM
|
0
|
0
|
1279
|
|
POST
|
You could put the features into a collection (an array, dictionary, hashtable, etc). After running the feature cursor once to build the collection, you can access the features as you need. One of my projects involved doing a series of calculations on the attributes of a group of features. Many of the calculations used values that were the result of previous calculations. The person who originally wrote the code used a separate cursor for each individual calculation, which took forever. I was able to rewrite the code where all of the attributes for the features where written into an array using a featurecursor. All the calculations where then done by looping through this array, which speed things up immensely.
... View more
11-06-2013
06:22 AM
|
0
|
0
|
1410
|
|
POST
|
I've been able to remove the group name and title from my legend, leaving only the swatches and labels using the CSS .esriLegendLayerLabel { visibility: hidden; } However, this leaves me with a large empty space above the legend. How would I remove that in addition? [ATTACH=CONFIG]28880[/ATTACH]
... View more
11-05-2013
11:14 AM
|
0
|
3
|
1914
|
|
POST
|
I agree that everything looks OK in your code. Now here's a shot in the dark. Where do your functions that use FindTask and IdentifyTask reside? Are the within that require function like this?
require(["dojo/ready", etc]
function (ready, etc) {
function execute(searchText) {
//set the search text to find parameters
//create find tasks with url to map services
findTask = new esri.tasks.FindTask("http://eagle.camplan.uga.edu:6080/arcgis/rest/services/CampusMap/UGA_CampusMap_Base/MapServer");
//create find parameters and define known values
findParams = new esri.tasks.FindParameters();
findParams.returnGeometry = true;
//findParams.outSpatialReference = map.spatialReference;
findParams.layerIds = [7];
findParams.searchFields = ["NAME", "NUMBER"];
findParams.searchText = searchText;
findTask.execute(findParams, showResults, findErr);
}
});
or do you have it outside that function, like this? require(["dojo/ready", etc]
function (ready, etc) {
});
function execute(searchText) {
//set the search text to find parameters
//create find tasks with url to map services
findTask = new esri.tasks.FindTask("http://eagle.camplan.uga.edu:6080/arcgis/rest/services/CampusMap/UGA_CampusMap_Base/MapServer");
//create find parameters and define known values
findParams = new esri.tasks.FindParameters();
findParams.returnGeometry = true;
//findParams.outSpatialReference = map.spatialReference;
findParams.layerIds = [7];
findParams.searchFields = ["NAME", "NUMBER"];
findParams.searchText = searchText;
findTask.execute(findParams, showResults, findErr);
}
If it's like the second version, then they won't operate without the dot notation.
... View more
11-05-2013
10:29 AM
|
0
|
0
|
2191
|
|
POST
|
Tracy, Thank you for your response. Strangely, removing the "dot" style constructors breaks my code for some of the constructors. Namely, the IdentifyTask. Alex That might be a sign that the function aliases aren't matching up correctly the require modules.
... View more
11-05-2013
09:43 AM
|
0
|
0
|
2586
|
|
POST
|
Tracy makes a good point about making the require/function section easier to visually examine. Here's an example of how I have one of my applications set up, grouping the modules. It may be overkill, but it's much easier for me when adding new modules and aliases.
require(["dojo/_base/array",
"dojo/_base/declare",
"dojo/_base/lang",
"dojo/Deferred",
"dojo/json",
"dojo/ready",
"dojox/gfx/fx",
"dgrid/OnDemandGrid",
"dgrid/Selection",
"dgrid/extensions/ColumnResizer",
"dgrid/extensions/ColumnHider",
"dgrid/util/mouse",
"dgrid/extensions/DijitRegistry",
"dijit/MenuItem",
"dijit/layout/TabContainer",
"dijit/registry",
"esri/map",
"esri/InfoTemplate",
"esri/dijit/Basemap",
"esri/dijit/BasemapGallery",
"esri/dijit/BasemapLayer",
"esri/dijit/Scalebar",
"modules/DVParameters",
"agsjs/dijit/TOC",
"dojo/domReady!"
], function (array, declare, lang, Deferred, JSON, ready,
fx,
Grid, Selection, ColumnResizer, ColumnHider, mouseUtil, DijitRegistry,
MenuItem, TabContainer, registry,
Map, InfoTemplate,
Basemap, BasemapGallery, BasemapLayer, Scalebar,
DVParameters
) {
... View more
11-04-2013
11:25 AM
|
0
|
0
|
2586
|
|
POST
|
So is the problem that you're not getting any results from the FindTask? Not getting any results back should not give you an error and go into the findErr function. Rather, that will happen if there are problem in executing the Find Task itself. Make sure you are getting results that can be loaded onto your map.
function showResults(results) {
console.log (results.length);
//display the results of the building text search
//symbology for graphics
markerSymbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE, 20, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0, 255, 255]), 1), new dojo.Color([0, 255, 255, 0.25]));
etc
Take a look at the video from a session at the 2013 Developers Summit called "Debugging Applications Built with ArcGIS API for JavaScript" to see how you can step through the code. As for the require/function question, I don't know if the require modules have to be loaded in a particular order. However, all of the modules that are being given aliases in the "function" section ("dojo/parser", "dojo/_base/connect", etc) have come before all the modules that don't have a corresponding alias ("dijit/dijit", "dijit/layout/BorderContainer", etc). In your original code, Color would refer to "dijit/dijit".
... View more
11-04-2013
10:12 AM
|
0
|
0
|
2586
|
|
POST
|
The first thing you have to do is make sure the require modules match the function aliases in the correct order
require(["dojo/parser", "dojo/_base/connect", "dojo/_base/array", "esri/map", "esri/layers/ArcGISDynamicMapServiceLayer", "esri/layers/GraphicsLayer", "esri/graphic", "esri/InfoTemplate", "esri/toolbars/navigation", "dojo/dom", "esri/tasks/FindTask",
"esri/tasks/FindParameters", "dijit/dijit", "dijit/layout/BorderContainer", "dijit/layout/ContentPane",
"dijit/layout/AccordionContainer", "dijit/form/TextBox", "dijit/form/Button", "dijit/Toolbar", "dijit/Tooltip", "dijit/registry",
"dojo/_base/Color", "esri/symbols/SimpleMarkerSymbol", "esri/symbols/SimpleLineSymbol", "esri/symbols/SimpleFillSymbol",
"esri/tasks/IdentifyTask", "esri/tasks/IdentifyParameters", "esri/tasks/IdentifyResult", "dojo/domReady!"
], function (
parser, connect, array, Map, ArcGISDynamicMapServiceLayer, GraphicsLayer, Graphic, InfoTemplate, Navigation, dom, FindTask,
FindParameters, Color, SimpleMarkerSymbol, SimpleLineSymbol, SimpleFillSymbol, IdentifyTask, IdentifyParameters, IdentifyResult, registry
)
That should look more like this
require(["dojo/parser", "dojo/_base/connect", "dojo/_base/array", "esri/map", "esri/layers/ArcGISDynamicMapServiceLayer", "esri/layers/GraphicsLayer", "esri/graphic", "esri/InfoTemplate", "esri/toolbars/navigation", "dojo/dom", "esri/tasks/FindTask",
"esri/tasks/FindParameters", "dojo/_base/Color", "esri/symbols/SimpleMarkerSymbol", "esri/symbols/SimpleLineSymbol", "esri/symbols/SimpleFillSymbol", "esri/tasks/IdentifyTask", "esri/tasks/IdentifyParameters", "esri/tasks/IdentifyResult", "dijit/registry",
"dijit/dijit", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dijit/layout/AccordionContainer", "dijit/form/TextBox", "dijit/form/Button", "dijit/Toolbar", "dijit/Tooltip", "dojo/domReady!"
], function (
parser, connect, array, Map, ArcGISDynamicMapServiceLayer, GraphicsLayer, Graphic, InfoTemplate, Navigation, dom, FindTask,
FindParameters, Color, SimpleMarkerSymbol, SimpleLineSymbol, SimpleFillSymbol, IdentifyTask, IdentifyParameters, IdentifyResult, registry
)
... View more
11-04-2013
07:23 AM
|
0
|
0
|
2586
|
|
POST
|
Tracy, I'd also like to compliment you on your site. It has a very good look and feel, without some of the typical Esri-centric jargon (basemap) to help the casual user.
... View more
10-30-2013
09:27 AM
|
0
|
0
|
1743
|
|
POST
|
I hate to mark any particular reply as the answer to my posting, but I'm always looking for the green 'A' to know the posting did had a resolution. I'll continue to pursue my formatting a zoom button question, but mark this answered since my grid now has data in it. You could indicate which postings were helpful in your final solution 🙂
... View more
10-30-2013
04:30 AM
|
0
|
0
|
1743
|
|
POST
|
Take a look at this thread on StackOverflow on adding widgets to a dgrid
... View more
10-29-2013
12:20 PM
|
0
|
0
|
1743
|
|
POST
|
I excluded the Shape field with the ColumnHider extension. Take a look at the buildColumns function in my code above which shows how the "hidden" property was added to the Shape field. As for the TitlePane scrollbars, this post says to set overflow to auto. Also, take a look at this Fiddle that was put up in this post. You can modify the content to make the horizontal scroll bar appear.
... View more
10-29-2013
11:41 AM
|
0
|
0
|
2638
|
|
POST
|
Have you tried issuing startup on the titlepane after adding the dGrid to it? In my application, I add a dGrid to ContentPane, then start up the ContentPane. This will also start up the dGrid. I'm not using store, however, I'm using renderArray
function populateTC(results, evt) {
try {
if (dijit.byId('tabs').hasChildren) {
dijit.byId('tabs').destroyDescendants();
}
if (results.length === 0) {
console.log('Nothing found.');
return;
}
var combineResults = {};
for (var i = 0, len = results.length; i < len; i++) {
var result = results;
var feature = result.feature;
var lyrName = result.layerName.replace(' ', '');
if (combineResults.hasOwnProperty(lyrName)) {
combineResults[lyrName].push(result);
}
else {
combineResults[lyrName] = [result];
}
switch (feature.geometry.type) {
case "point": case "multipoint":
layerResultsGraphic.add(new esri.Graphic(feature.geometry, symbolResultPoint, feature.attributes));
break;
case "polyline":
layerResultsGraphic.add(new esri.Graphic(feature.geometry, symbolResultPolyline, feature.attributes));
break;
case "polygon": case "extent":
layerResultsGraphic.add(new esri.Graphic(feature.geometry, symbolResultPolygon, feature.attributes));
break;
}
}
for (result in combineResults) {
if (combineResults.hasOwnProperty(result)) {
var columns = buildColumns(combineResults[result][0].feature);
var features = [];
for (i = 0, len = combineResults[result].length; i < len; i++) {
features.push(combineResults[result].feature);
}
var data = array.map(features, function (feature) {
return lang.clone(feature.attributes);
});
var dataGrid = new (declare([Grid, Selection, DijitRegistry, ColumnHider]))({
id: "dgrid_" + combineResults[result][0].layerId,
bufferRows: Infinity,
columns: columns,
selectionMode: "single",
"class": "resultsGrid"
});
var gridWidth = "width: " + String(columns.length * 100) + "px";
dataGrid.addCssRule("#" + dataGrid.id, gridWidth);
dataGrid.on(".dgrid-row:click", gridSelect);
dataGrid.on("show", function () {
dataGrid.resize();
});
dataGrid.on(mouseUtil.enterRow, gridEnter);
dataGrid.on(mouseUtil.leaveRow, function () {
map.graphics.clear();
});
var plural = "";
if (combineResults[result].length !== 1) { plural = "s"; }
var cp = new dijit.layout.ContentPane({
id: result,
content: "<strong>" + combineResults[result][0].layerName + "</strong> (" + combineResults[result].length + " feature" + plural + ")",
//content: dataGrid,
title: combineResults[result][0].layerId,
style: "overflow: auto"
}).placeAt(dijit.byId('tabs'));
cp.addChild(dataGrid);
cp.startup();
dataGrid.renderArray(data);
}
}
tc.startup();
tc.resize();
map.infoWindow.show(evt.screenPoint, map.getInfoWindowAnchor(evt.screenPoint));
}
catch (e) { console.log(e.message); }
}
function buildColumns(feature) {
var attributes = feature.attributes;
var columns = [];
for (var attribute in attributes) {
if (attributes.hasOwnProperty(attribute)) {
var objects = {};
objects.label = attribute;
objects.field = attribute;
if (attribute === "Shape") {
objects.hidden = true;
}
columns.push(objects);
}
}
return columns;
}
Here's a production version of that. Turn on several layers and click on overlapping features to see it in play. This also shows how to create dGrids of varying widths, so the columns are not squished down to fit the width of the TitlePane. I've assigned all columns a width of 100 pixels, then calculating the grid's width by multiplying the number of columns by 100. Then I add a CSS rule for that grid. var gridWidth = "width: " + String(columns.length * 100) + "px";
dataGrid.addCssRule("#" + dataGrid.id, gridWidth);
... View more
10-29-2013
08:38 AM
|
0
|
0
|
2638
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-04-2025 06:39 AM | |
| 1 | 05-01-2026 08:26 AM | |
| 1 | 04-10-2026 12:01 PM | |
| 1 | 04-13-2026 09:11 AM | |
| 1 | 10-11-2023 06:18 AM |
| Online Status |
Online
|
| Date Last Visited |
3 hours ago
|