|
POST
|
hzhu, thanks for the suggestion. Just tried it, and the service returns not empty feature classes. What could I be doing wrong in my code? Without knowing your GP service, i can't pinpoint what is wrong with your code. My guess is most likely your parameter setting.
... View more
11-23-2011
05:05 AM
|
0
|
0
|
1053
|
|
POST
|
The result is saved in ArcGIS server jobs folder, and I can download it. However, the downloaded featrue classes contain no features when the gp service is called via REST. The same input parameters for the gp service result in not empty feature classes when called via SOAP. Have you tested via REST through service directory (put JSON text for AOI etc)?
... View more
11-22-2011
08:05 AM
|
0
|
0
|
1053
|
|
POST
|
Hello, I have a problem consuming a geoprocessing service with Extract Data task using javascript API and REST on ArcGIS Server 10. When consumed from a web app the service returns feature classes with no data. However, when consumed from ArcMap (also as a service) everything works fine. The task always finishes successfully. I modified the code from the javascript API samples page, and here it is: var clipLayers = []; if(dijit.byId('layer1').checked){clipLayers.push('TACKE_EM');} if(dijit.byId('layer2').checked){clipLayers.push('LINIJE_EM');} if(dijit.byId('layer3').checked){clipLayers.push('POVRSINE_EM');} if(clipLayers.length === 0 || map.graphics.graphics.length === 0){ alert('Select layers to extract and area of interest'); return; } var features =[]; features.push(map.graphics.graphics[0]); var featureSet = new esri.tasks.FeatureSet(); featureSet.features = features; var rasterFormat = "ESRI GRID - GRID"; var spatialReference = "MGI Balkans 7"; var params = {"Layers_to_Clip":clipLayers, "Area_of_Interest": featureSet, "Feature_Format": dijit.byId('formatBox').value, "Raster_Format" : rasterFormat, "Spatial_Reference" : spatialReference }; gp.submitJob(params, completeCallback , statusCallback,function(error){ alert(error); }); What am I doing wrong? If you need additional info, please ask. Thanks in advance. To consume a GP service result, you need either put the result layer on a map service or put it in scratch workspace (the AGS server will store it in job output folder identified by job id). Which approach did you take?
... View more
11-22-2011
04:10 AM
|
0
|
0
|
1053
|
|
POST
|
I have noticed that the keyboard navigation keys (arrow and + - keys) are only active when the mouse cursor is over the map. Is there a way to activate keyboard navigation when the mouse isn't positioned over the map? Many Thanks Jason You can implement your own navigation by useing onkeypress event(or some other key relate events) on certain key. It is supported by most the html tags and javascript doc. example: onkeypress="javascriptFunction(k){if (k.keyCode=(keycode value of whatever key you choose)) dosomemapnavigation;}"
... View more
11-22-2011
03:53 AM
|
0
|
0
|
632
|
|
POST
|
Hi there, I have a map with serveral different MapServiceLayers (DynamicMapServiceLayers and FeatureLayer). Now I'm looking for indexes of each of this services in the map. So I like to know which is the topmost, the second topmost etc.. With the information about the indexes I can as as example the map.reorderLayer(layer, index) function for reordering. best regards Urs All layers has a id property. Even though it is a string type. you could name the layers '0', '1', '2'.... Since javascript is loosely typed, those ids can be easily treated as number with min code.
... View more
11-16-2011
04:16 AM
|
0
|
0
|
456
|
|
POST
|
Hi Guys, If i move from a big screen to a smaller screen it looks like the actual extent is changed. For eg. if my intial extent is set to point to san francisco for a screen size of ( 1680 X 1050). When i move to a screen size of (800X600). The extent is getting set at San Jose. Is there any way i could set the extent to always point to San Francisco irrespective of screen size. I am using the ESRI JAVASCRIPT API Any help would be greatly appreciated. Regards, Pawan The geographic extent of san francisco will always be the same no matter what screen size. So i don't understand how the map's initial extend gets changed. However, theoretically you can try this for 800X600. YouInitialExtentFor(1680 X 1050).expand((800*600)/(1680*1050)).
... View more
11-16-2011
04:09 AM
|
0
|
0
|
557
|
|
POST
|
Also, if I replace store.setValues(item, "indValue", value) with store.setValues(item, "indValue", "xyz"), it populates the table with "xyz", similar to the example you sent earlier. Thanks Samir After a second look at your code, I change your code a little bit, it should work if the you make the changes as follows.
if (boxId=="checkTest1"){
store.fetch({query:{},onItem:function(item){
var value = store.getValues(item, "Shape_Leng");
store.setValues(item, "indValue", value);
}
});
}
You don't need for loop because store.fetch -onItem will do it for you.
... View more
11-15-2011
11:33 AM
|
0
|
0
|
1913
|
|
POST
|
Hi Heming, Your suggestion works really well, but I am encountering some problem. Here is my code: data = {items:items}; store = new dojo.data.ItemFileWriteStore({data:data}); store.fetch({onBegin:function(total){alert("there are "+total+" items in store");}}); if (boxId=="checkTest1"){ for (i=0; i<items.length; i++){ var item=items; var value = store.fetch({query:{},onItem:function(item){alert(store.getValues(item, "Shape_Leng"));}}); store.setValues(item, "indValue", value); } } grid.setStore(store); My 'alert' on values returns the right values (and the right count of values), but it does not populate the grid. It fills in the values as [object Object]. Would you know why is this happening? Thanks Samir try this:
if (boxId=="checkTest1"){
var items =store._arrayOfAllItems;
for (i=0; i<items.length; i++){
var item=items;
var value = store.getValues(item, "Shape_Leng");
store.setValues(item, "indValue", value);
}
}
... View more
11-15-2011
10:04 AM
|
0
|
0
|
2050
|
|
POST
|
Still no luck, Heming, I tried your solution, but it is not reading store.setValue(...) at all. I also put a check to see what values 'item' is returning but have been unsuccessful. Do you have any other suggestion. This part of the code has taken me much longer than all the other portions in my application. Any help will be really appreciated. Also, if you can direct me to a good source to understand the functioning of ItemFileWriteStore with examples, please pass it on. Thanks Samir I modified the esri sample http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/find_map_datagrid.html just a little bit to include a update function.
... View more
11-14-2011
11:11 AM
|
0
|
0
|
2050
|
|
POST
|
Thanks Heming, I believe onRowClickHandler works with one row at a time. Can I use .setValues instead to update all records in the table? As I mentioned earlier, the table should update all values when the user selects another indicator. Thanks Samir Then you might need to code like this:
for (i = 0; i < items.length; i++) {
var item = items; store.setValue(item, "NB_D_SIGNS, "Test1") ;
}
... View more
11-14-2011
08:01 AM
|
0
|
0
|
2050
|
|
POST
|
Hi Heming, I am sorry I am still not getting it right. I must be really thick to understand this. I have looked at various forum too but still no luck. It'll be really helpful if you could suggest the soltuion based on the information below: I have described two fields ("name" which has unique values and "NB_D_SIGNS" which has attribute values for each "name") in the grid structure in my html file. "NB_D_SIGNS" is missing from the code that I pasted in my last email. Items array, I understand, holds pairs of information such as "name" and value of an indicator. My other indicators are "Test1" and "Test2". My two questions are: Having defined my field name in my HTML, what code will update the values of field "NB_D_SIGNS" to values of the field, say "Test1"? In the normal sequence of code( data = {items:items}; store=new dojo.data.ItemFileWriteStore({data:data}); grid.setStore(store);) where does the .setValue code fit in? I'll really appreciate it if you could help. Thanks Samir store.setValue(item, "NB_D_SIGNS, "Test1") will update a individual item's NB_D_SIGNS field value to "Test1". Before using this statement, you have to specify the item (just like to identify a record in a recordset). For example, in esri's sample: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm. it used dojo.connect(grid, "onRowClick", onRowClickHandler) to inentify individual item...
... View more
11-14-2011
06:49 AM
|
0
|
0
|
2050
|
|
POST
|
Hi Heming, I am trying to set the value for the store in a datagrid based on the function that you suggested (store.setValue....). Unfortunately, I am not being able to understand the parameters that I need to pass to get this to work. I am pasting a portion of my code (pertaining to data grid). I hope you'll be able to help me starighten this out: HTML CODE: <div data-dojo-type="dijit.form.Form" id="distDataTable" name="distDataTable"> <div id="stateInfo" name="stateInfo"></div><!--Message informing which State/UT is being viewed--> <div id="indicatorInfo" name="indicatorInfo"></div> <table data-dojo-type="dojox.grid.DataGrid" class="grid" data-dojo-id="grid" id="grid" rowsPerPage="15" rowSelector="20px"> <thead> <tr> <th field="name" width="auto" height="30px">District</th> <th width="auto" height="30px"><p style="font:Calibri; font-size:12px;">Indicator value (%)</p></th> </tr> </thead> </table> <div data-dojo-type="dijit.form.Form" id="downloadData" name="downloadData"> <button dojoType="dijit.form.Button" id="dataDownload" name="dataDownload">DOWNLOAD THIS DATA</button> </div> <div id="clear" style="clear:both;"></div> </div> JS CODE: queryTask.execute(query, function(featureSet){ var results=[], attr=[], items=[]; for (i=0, il=featureSet.features.length; i<il; i++) { var graphic = featureSet.features; graphic.setInfoTemplate(infoTemplate); distGraphicsLayer.add(graphic); items.push(graphic.attributes); } dijit.byId('progress').hide(); distGraphicsLayer.show(); data = {items:items}; store = new dojo.data.ItemFileWriteStore({data:data}); if (boxId=="checkNBD"){ store.setValue(item, "NB_D_SIGNS"); } grid.setStore(store); }); I'll be happy to send you the entire code if you like. Thanks for all yur help, Samir ItemFileWriteStore.setValue has the following format: ItemFileWriteStore.setValue(item, columnName, value). item is the certain individual item in items, it has to be specified. columnName is the certain field name that you has to update value on, also value is required.
... View more
11-11-2011
05:02 AM
|
0
|
0
|
3048
|
|
POST
|
See post# 13. I don't know how else to explain it. It's matter of consistence issue. Pull out the style in basemap div, and put it together with your custome logo:
div.map #baseMap
{ position:absolute;
right:20px;
top:10px;
z-Index:999;
}
div.map #logo
{
position:absolute;
bottom:20px;
right:20px;
z-index:100;
width:15px;
heigth:15px;
}
Note: #baseMap and #logo are ids of your basemap and your logo image.
... View more
11-09-2011
06:49 AM
|
0
|
0
|
1862
|
|
POST
|
I'm trying to populate a combo box based on a select list. I'm using a combination of examples from the samples page. My query is valid as I have tested it against the layer in the services directory and using an alert I can see that it is passing the correct syntax. I get no FireFox errors but the combo box is not getting populated. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>State Info</title>
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.5/js/dojo/dijit/themes/tundra/tundra.css">
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.5">
</script>
<script type="text/javascript">var dojoConfig = { parseOnLoad:true };</script>
<script type="text/javascript">
dojo.require("esri.tasks.query");
dojo.require("dojo.parser");
dojo.require("dijit.form.ComboBox");
dojo.require("dojo.data.ItemFileReadStore");
var query, queryTask;
function init() {
//create map and add layer
map = new esri.Map("mapDiv");
var layer = new esri.layers.ArcGISDynamicMapServiceLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer");
map.addLayer(layer);
//initialize query task
queryTask = new esri.tasks.QueryTask("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/0");
//initialize query
query = new esri.tasks.Query();
query.returnGeometry = false;
query.outFields = ["SUB_REGION", "STATE_NAME"];
}
function executeQueryTask(subr) {
//alert(subr);
//set query based on what user typed in for population;
query.where = "SUB_REGION = '"+ subr +"'";
//alert(query.where);
//execute query
queryTask.execute(query,populateList);
}
function populateList(results) {
//Populate the dropdown list box with unique values
var zone;
var values = [];
var testVals={};
values.push({name:"ALL"});
var features = results.features;
dojo.forEach (features, function(feature) {
zone = feature.attributes.STATE_NAME;
if (!testVals[zone]) {
testVals[zone] = true;
values.push({name:zone});
}
});
//Create a ItemFileReadStore and use it for the ComboBox's data source
var dataItems = {
identifier: 'name',
label: 'name',
items: values
};
var store = new dojo.data.ItemFileReadStore({data:dataItems});
dijit.byId("mySelect").store = store;
}
dojo.addOnLoad(init);
</script>
<body class="tundra">
<br/>
US city population greater than :
<select name="subregion" id="subregion" onChange="executeQueryTask(dojo.byId('subregion').value);">
<option value="Pacific">Pacific Region</option>
<option value="Mtn">Mountain Region</option>
<option value="S Atl">South Atlantic Region</option>
</select>
<select id="mySelect"
dojotype="dijit.form.ComboBox"
style="width:300px;font-size:18px;"
autoComplete="true"
forceValidOption="false"
value="Select Zoning Type">
</select>
<div id="mapDiv" style="width:600px; height:600px; border:1px solid #000;"></div>
</body>
</html> No field "SUB_REGION" in http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/0
... View more
11-08-2011
09:55 AM
|
0
|
0
|
1753
|
|
POST
|
And even further information... If I start editing, move a vertex of the problem feature, and save, "Part 0" becomes the outer ring, "Part 1" become the inner ring, and my script detects the feature as a polygon having a hole! Now I just need to find a way of making that reordering happen without modifying any vertices. Any ideas? Here are some of my thoughts. First check if a polygon has multiparts. If it has, then create each polygon out of each part. Then compare those polygons, for example if A contains B. Then B most likely be the hole of A. So you remove the B part....
... View more
11-04-2011
01:13 PM
|
0
|
0
|
2552
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-11-2011 12:16 PM | |
| 1 | 05-25-2017 08:26 AM | |
| 1 | 06-02-2017 07:37 AM | |
| 1 | 06-28-2011 07:02 AM | |
| 1 | 06-12-2017 10:10 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-01-2024
09:57 PM
|