|
DOC
|
Robert, Thank you for your work on this widget! I was wondering if you were planning to make it like the original elevationprofile in which a person could select an existing line? Thank you!
... View more
03-04-2015
07:48 AM
|
2
|
0
|
35635
|
|
POST
|
I created an elevation geoprocessing service based on the example video Creating Geoprocessing Services | Esri Video. I ran the StackProfile tool and then published the result to a service. I plugged it into the Elevations Profile template. When I click on a line or draw my own the profile does not appear to be different then the out of box GPServer. ESRI service uses 10m resolution. My data uses 1m. My data is only for a small area(the town I work for). If I use the measure tool outside my data area I still get a result back. Is this because it uses ESRI data for areas that mine does not cover? The only reference to a elevation profile I can find is in line 15. define(
[],
function() {
var config = {
bingMapsKey:"Arrzu_Koi7htDRMIwm6kTe0Nqh8FvVdN17blcaJVTEhn87z-tIYJh2LgBNbJS4fv",
units: null,
helperServices: {
geometry:{
url: location.protocol + "//utility.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"
},
printTask: {
url: location.protocol + "//utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task"
},
elevationSync:{
url: location.protocol + "//gis.ashland.or.us/arcgis/rest/services/tools/StackProfile/GPServer"
},
geocode: [{
url: location.protocol + "//geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer"
}]
},
queryForOrg: true
};
// could use a has() test to optionally populate some global
// property so that the stuff defined is in some global identifier
//
// instead, just populate a global, will need to remove the next line when
// when we remove support for loading modules with dojo.require
// which will be when we move to Dojo 2.0
commonConfig = config;
// instead of using a global, this should probably be added to some namespace...
// do the templates have a common namespace that they use?
return config;
});
... View more
02-24-2015
12:11 PM
|
0
|
1
|
4263
|
|
POST
|
In my web-app I can select a feature and open an attribute table that shows related fields. But I cannot figure out what to add to the code to zoom to the location of a related record when I click on the table. // DataGrid //
//add a link to the popup that for getting related records
var link = domConstruct.create("a",{
"class": "action",
"id": "relatedLink",
"innerHTML": "Show Related Records", //text that appears in the popup for the link
"href": "javascript: void(0);"
}, query(".actionList", this.map.infoWindow.domNode)[0]);
on(link, "click", function(){
//Get info from the selected feature
var feature = map.infoWindow.getSelectedFeature();
var layer = feature.getLayer();
var OIDField = layer.objectIdField;
var oids = feature.attributes[OIDField];
//Setup the relationship query
var relatedQuery = new RelationshipQuery();
relatedQuery.outFields = ["ROUTE_1","ROUTE_2","NAME","GROUP_","LENGTH", "OBJECTID"];
relatedQuery.relationshipId = 0;
relatedQuery.objectIds = [oids];
//Perform the query
layer.queryRelatedFeatures(relatedQuery, function(relatedRecords){
//get the related records for the input OID. In this case there
//is just one object id.
clearGrid();
var featureSet = relatedRecords[oids];
if(featureSet && featureSet.features){
createTable(featureSet);
}else{
console.log("No related records");
}
});
}); function clearGrid(){
//clear existing grid
if(grid){
grid.set("store",new Memory({data:[]}));
domUtils.hide(grid.domNode);
}
}
function createTable(featureSet, info){
var data = [];
array.forEach(featureSet.features, function(r){
data.push(r.attributes);
});
//define the columns
var relatedLayer = featureSet.features[0].getLayer();
var columns = {
var memoryStore = new Memory({data: data});
grid = new Grid({
columns: columns
},"tableContainer");
grid.set("store", memoryStore);
domUtils.show(grid.domNode);
}
... View more
02-20-2015
09:03 AM
|
0
|
0
|
3241
|
|
POST
|
I did find an issue with the related records code. For some reason the first time the map loads, the area where the related records table shows does not act properly. When I try to move the map, it highlights the map and will not let it move. In the example you provided the bottom 15% (the side of the table) of the map cannot be navigated like normal. Is there a way to change the z value or change the height to 0 until the table is displayed? I also changed my services so that the related layer is a line layer. When I select the table it does not move to selected location. "Yes you can zoom if the related data is a layer. In the example above its just tabular data so there is no feature geometry. To zoom you'll just get the geometry of the feature and set the map extent." Any suggestions? Thank you
... View more
02-19-2015
11:00 AM
|
0
|
1
|
2171
|
|
POST
|
That was it, Thank you! My project is not done yet but you can go to the elevation link in my question to see my progress. (if it is not working it is because I am still in development and I am changing the script)
... View more
02-13-2015
11:05 AM
|
1
|
2
|
2171
|
|
POST
|
I copied your suggestions into the code you provided above and it did not work. //Setup the relationship query var relatedQuery = new RelationshipQuery(); relatedQuery.outFields = ["ROUTE_1 ","ROUTE_2 ","NAME ","GROUP_","LENGTH"]; relatedQuery.relationshipId = 0; relatedQuery.objectIds = [oids]; And //define the columns var relatedLayer = featureSet.features[0].getLayer(); var columns = { "ROUTE_1": "Route 1", "ROUTE_2": "Route 2 ", "NAME ": "Name", "GROUP_": "Group", "LENGTH ": "Length (ft)" }; array.forEach(relatedLayer.fields, function(f){ columns[f.name] = f.alias; });
... View more
02-13-2015
10:59 AM
|
0
|
4
|
2171
|
|
POST
|
I replaced the relatedQuery and var columns like you suggested. The relatedQuery part worked but the table now shows every row and only populates the two fields.
... View more
02-13-2015
10:36 AM
|
0
|
6
|
2171
|
|
POST
|
Thank you! That helped a lot! I was wondering if there was a way to zoom to a record in the table? Or is the table the related table and one cannot zoom? How can I remove some fields so they do not display in the table? On another note, is it possible to have the relate table relate off of 3 different fields?
... View more
02-13-2015
07:45 AM
|
0
|
8
|
2171
|
|
POST
|
So what I want to do, is to be able to select a line feature (trails) and have related lines, based on attributes, selected too. What I am thinking is in a data grid. I have been playing with ways to do this. I have tried Query related records | ArcGIS API for JavaScript I have tried Datagrid look up. Neither way seems to work the way I am wanting. Ultimately I want to join this with the Elevations Profile web-app. I can do this part (I hope), if I can figure how to select related features. Our data has multiple trails that split off of each other.
... View more
02-11-2015
02:14 PM
|
0
|
10
|
6630
|
|
POST
|
Here is the answer to my second question. avgGasProduction: function (event) {
var productionSum = 0, productionAvg = 0;
var sumField = this.fieldToSum;
arrayUtil.forEach(event.features, function (feature) {
productionSum += feature.attributes[sumField];
});
if (event.features && event.features.length > 0) {
productionAvg = Math.round(productionSum / event.features.length)
}
dom.byId('messages').innerHTML = "<b>" + this.selectSumMsgPrefix + " " + productionAvg + " " + this.selectSumUnits + ". </b>";
}
... View more
01-15-2015
11:50 AM
|
0
|
0
|
1463
|
|
POST
|
Thank you for the help on the code! Is it possible to find the average now? I am using CMV - Configurable Map Viewer : define([ 'dojo/_base/declare', 'dijit/_WidgetBase', 'dijit/_TemplatedMixin', 'dijit/_WidgetsInTemplateMixin', 'esri/toolbars/draw', 'esri/InfoTemplate', 'esri/layers/FeatureLayer', 'esri/symbols/SimpleMarkerSymbol', 'esri/symbols/SimpleLineSymbol', 'esri/Color', 'esri/tasks/query', 'dijit/form/Button', 'dojo/_base/lang', 'dojo/on', 'dojo/_base/array', 'dojo/dom', 'dojo/text!./Select/templates/Select.html', 'xstyle/css!./Select/css/Select.css' ], function (declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, Draw, InfoTemplate, FeatureLayer, SimpleMarkerSymbol, SimpleLineSymbol, Color, Query, Button, lang, on, arrayUtil, dom, SelectTemplate, css) { return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], { widgetsInTemplate: true, templateString: SelectTemplate, selectTools: null, postCreate: function () { this.selectTools = new Draw(this.map); this.selectQuery = new Query(); on(this.selectTools, "DrawEnd", lang.hitch(this, function (geometry) { this.selectTools.deactivate(); this.selectQuery.geometry = geometry; this.featureLayer.selectFeatures(this.selectQuery, FeatureLayer.SELECTION_NEW); })); this.fieldsSelectionSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 10, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([255,0,0]), 1), new Color([0,255,0,0.25])); var infoTemplate = new InfoTemplate(this.title, this.content); this.featureLayer = new FeatureLayer(this.featureLayerURL, { mode: FeatureLayer.MODE_ONDEMAND, infoTemplate: infoTemplate, outFields: ["*"] }); this.featureLayer.setDefinitionExpression(this.defExpress); this.featureLayer.setSelectionSymbol(this.fieldsSelectionSymbol); this.featureLayer.on("selection-complete", lang.hitch(this, 'sumGasProduction')); var clearMsg = this.clearSelectMsg; this.featureLayer.on("selection-clear", function () { dom.byId('messages').innerHTML = "<i>" + clearMsg + "</i>"; }); this.map.addLayer(this.featureLayer); }, select: function () { this.selectTools.activate(Draw.EXTENT); }, clearSelection: function () { this.featureLayer.clearSelection(); }, sumGasProduction: function (event) { var productionSum = 0; var sumField = this.fieldToSum; arrayUtil.forEach(event.features, function (feature) { productionSum += feature.attributes[sumField]; }); dom.byId('messages').innerHTML = "<b>" + this.selectSumMsgPrefix + " " + productionSum + " " + this.selectSumUnits + ". </b>"; } }); });
... View more
01-13-2015
06:52 AM
|
0
|
1
|
1463
|
|
POST
|
Is there any way to draw a rectangle on a map, select all the points within the rectangle and then find the average of the values? I want the user to be able to "design" their own solar panel and get a verdict if the location is good or not. I know that I can buffer pixels around a selected point but I would rather be able to draw my own area. I am not sure where to start? Any ideas would be helpful! Thanks! I have found this template: Layer in a map service - [ON-DEMAND] If I go with this one, is there a way to have sum (or average) display in a popup not at the bottom of the screen?
... View more
01-07-2015
02:57 PM
|
0
|
3
|
5746
|
|
POST
|
I have over 3 million points. I cannot have my server displaying all these points on a map a the same time. What I want to do is when a building is selected, show all points within that polygon. I know about this example: Select with Feature Layer | ArcGIS API for JavaScript I am not sure that will work because I don't want a buffer I want to use another Layer. Thank you
... View more
12-31-2014
09:11 AM
|
0
|
10
|
7246
|
|
POST
|
Richard, I keep getting this error: Runtime error Traceback (most recent call last): File "<string>", line 32, in <module> TypeError: 'builtin_function_or_method' object has no attribute '__getitem__' Do you have any suggestions?
... View more
12-23-2014
09:38 AM
|
0
|
1
|
2336
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-28-2025 01:53 PM | |
| 1 | 08-24-2022 09:40 AM | |
| 1 | 07-19-2018 04:41 PM | |
| 1 | 04-05-2024 03:12 PM | |
| 1 | 07-04-2024 11:42 AM |