|
POST
|
I've built an web app that is based on the following sample http://help.arcgis.com/en/webapi/javascript/arcgis/demos/ed/ed_default_editingwidget.html however my attribute table is very long and i'm not getting the look/feel that i want by playing around with the positioning and size of the infowindow. Therefore i was wondering if it was possible to modify the above sample so that instead of a infowindow you had a dialog box openup, in a fixed position/size that contained the attributes to either edit or create. Or perhaps moving the infowindow into dijit.layout.ContentPane. Is this possible? Si Attribute inspector has a property called domNode. So theoretically (i have not tried myself) you should be able to place it at dom element..
... View more
08-04-2011
06:06 AM
|
0
|
0
|
1107
|
|
POST
|
Hi Derek, Background to this question - I'm trying to keep the UI really simple, so the user doesn't have to worry about typing in a query. A 2-handled dojo slider bar works really well for selecting features between a range, aside from the asynchronous query issue. Filtering on a feature layer may be an option here. I could also use a Submit button which runs the query, rather than running it onChange. Any other suggestions would be very welcome. Cheers, Steve The main issue here is that there is no events for on going queryTask. The only event that handling querytask process would be onComplete. You can try stop that event to see if you will get expected results. You can achieve this by a couple of steps 1. Using a variable to trace the progress of the query task.
var inProgress =false;
....
var queryEvent =dojo.connect(querytask, "onComplete", querTaskOnComplete);
function sliderOnchange(newValue)
{
// stop passed event if passed event is still in progress
if (inProgress ==true) dojo.stopEvent(queryEvent);
// start a new query process
inProgress =true;
... do your query here...
}
function querTaskOnComplete(featueSet)
{
....do you post query action here....
//reset inProgress at the end of the function
inProgress =false;
}
... View more
08-04-2011
05:54 AM
|
0
|
0
|
2198
|
|
POST
|
I was stucked on get the field names from a row object. I have a feature set created from the query task. I want to pass this feature set to a geoprocessing so i can use a search cursor to iterator each feature. However, unless you specify the field name explicitly, you can not iterator the cols in the row. And there is no Describe or list object for featureset so you can get field info. I do want to pass additional parameter to just list the field names for the feature set. Does anyone have any idea how to get field names of a featureset through arcpy or Python?
... View more
08-03-2011
11:12 AM
|
0
|
3
|
1585
|
|
POST
|
I have spent some time reading the numerous threads about setting the identify task to work with layer toggling and I seem to have it working properly except for one small issue. The identify task will continue to work even though all of the layers are turned off. The Pop-Up dialogue will show "searching" for some time, until the JavaScript times out. The more problematic issue is that the task will lock up a SOC process until it times out as well, which is much longer than the JavaScript time out. This gives the user the ability to use the identify task again, repeating the process above, and locking up another SOC process. Since 2 SOC processes are the default this means that the service is useless until one of them times out. Click below to view an example of this behavior. This is hitting the ArcGIS.com sample server so you will have to take my word on the "hung" SOC processes. http://geoville.org/viewers/identifytoggle/ My question is two fold. 1: Could this be a bug? 2: Any ideas on how to keep the identify task from executing when there are no layers visible? Thanks for your help. I have also posted this question on StackExchange here. http://gis.stackexchange.com/questions/12772/identify-with-layer-toggling
function executeIdentifyTask(evt) {
if (dynlayer.visibleLayers.length <1)
return;
identifyParams.geometry = evt.mapPoint;
identifyParams.mapExtent = map.extent;
var deferred = identifyTask.execute(identifyParams);
deferred.addCallback(function(response) {
// response is an array of identify result objects
// Let's return an array of features.
return dojo.map(response, function(result) {
var feature = result.feature;
feature.attributes.layerName = result.layerName;
//console.log(feature.attributes.NAME);
var template = new esri.dijit.PopupTemplate({ title: "Name: {NAME}",
fieldInfos: [
{fieldName: "ADDRESS", visible: true, label: "Address:"}
]
});
feature.setInfoTemplate(template);
return feature;
});
});
// InfoWindow expects an array of features from each deferred
// object that you pass. If the response from the task execution
// above is not an array of features, then you need to add a callback
// like the one above to post-process the response and return an
// array of features.
map.infoWindow.setFeatures([ deferred ]);
map.infoWindow.show(evt.mapPoint);
}
... View more
07-29-2011
07:21 AM
|
0
|
0
|
742
|
|
POST
|
What are the techniques recommended for handling case sensitivity in a query in the JS API? The Query No Map sample is a perfect example - search on "CALIFORNIA" and it returns no results. Is there a way to handle the situation where the user doesn't know the correct capitalisation required? function execute(stateName) {
query.text = stateName;
queryTask.execute(query,showResults);
} You could convert query.text to upper- or lower-case, but that doesn't help unless the actual value in the geodatabase matches. Is there a flag to ignore the case in a query? Thanks, Steve query.text, as API stated, is "Shorthand for a where clause using "like". The field used is the display field defined in the map document. You can determine what the display field is for a layer in Services Directory". Use query.where instead so that you could convert both end to upper case:
function execute(stateName) {
query.where ="Upper(STATE_NAME) like '%" + stateName.toUpperCase() +"'%";
queryTask.execute(query,showResults);
}
... View more
07-29-2011
05:54 AM
|
0
|
0
|
1958
|
|
POST
|
My map shows up correctly but when I go to add in my kmz file nothing happens. I have tested it with other kmz and kml files and it works sometimes. when I try and open my kmz in Google Earth it works every time. var url = "http://XXXXX/ArcGIS/rest/services/MyService/MapServer/kml/mapImage.kmz";
var TSGTLayer = new google.maps.KmlLayer(url, {preserveViewport:false, map:map}); If your kmz works on google earth, I suggest that you add google earth plugin as a base layer and add kmz on it when you switch your base layer to google earth plug in. One approach i did is save kmz from the map service to a specific location (saying sub folder under your web application). I find it more stable. One down side is that it is a snapshot.
... View more
07-29-2011
04:49 AM
|
0
|
0
|
1108
|
|
POST
|
Yes, that is a lot of layers. You're comparing the load time of 42 to layers with that of one when you compare your app to the JS preview from the services directory. It's kind of like saying "Firefox opens immediately when I open it with one tab but if I open it with 42 tabs it takes forever". You're probably overwhelming your server. Do you really need 42 layers in your web app? Can you combine any of your services? What about loading services at run-time instead of when your app starts? In cartography, there is a thumb rule that don't show > 5,6 colors. It overwhelms your eyes let alone show these many layers(at lest for showing map purpose). Maybe you could set up visible scale or toggle visibility so that at certain scale you could constrain the no. of showing layers.
... View more
07-28-2011
12:17 PM
|
0
|
0
|
1700
|
|
POST
|
Is there a way to use the kml that is served from ArcGIS server in an app created with the Google Maps api? When I try it with my service it never loads. I had used kml in Google Map Api with Google Earth plug. You can get the kmz for the mapserver through REST: Here is the part of code that my give me some clue:
kmlUrl="http://xxx/ArcGIS/rest/services/yourmapservice/MapServer/kml/mapImage.kmz";
geoXml = new GGeoxml(kmlUrl);
map.addOverlay(geoXml);
... View more
07-28-2011
11:58 AM
|
0
|
0
|
1108
|
|
POST
|
The reference for BasemapLayer says that it includes an opacity setting, however I'm having problems getting it to work. Using the sample here I add a setting to specify the opacity: function createBasemapGallery(){
//Manually create a list of basemaps to display
var basemaps = [];
var basemapRoad = new esri.dijit.Basemap({
layers: [new esri.dijit.BasemapLayer({
type: "BingMapsRoad",
opacity: 0.25
})],
id: "bmRoad",
title: "Road"
}); This doesn't have any discernible effect - what am I doing wrong? Cheers, Steve Instead of set opacity on each basemap layer. you could try set it once:
var baselayer = map.getLayer(youbasemapid);
baselayer.setOpacity(0.25);
if you want to set up opacity differently for each individual basemap layer, you could use the above code in layer's onSelectionChange() event
... View more
07-28-2011
11:27 AM
|
0
|
0
|
1357
|
|
POST
|
Hi , Thnx for your help . i saw the sample and understand GPRecordSet is a featureset object without geometry. My challenge is , i read a file and am trying to create featureset object with the data from the file . i.e Manually creating featureset object . Saw the featureSet API and that is what i m trying to create feature_set = { "features" : [ { "attributes" : {"OBJECTID":1,"Add_line":"303 Kulana St","state":"HI","city":"Hilo","zip":"96720","zip_4":"2266"} }, { "attributes" : {"OBJECTID":2,"Add_line":"303 Kulana St","state":"HI","city":"Hilo","zip":"96720","zip_4":"2266"} } ] }; var featureSet = new esri.tasks.FeatureSet(feature_set); i just need some help in knowing whether what i m doing is correct way to create a FeatureSet object or if i m missing something?
var features =[];
var feature1=new Graphic();
feature2.setAttributes({"OBJECTID":1,"Add_line":"303 Kulana St","state":"HI","city":"Hilo","zip":"96720","zip_4":"2266"});
features.push(feature1);
var feature1=new Graphic();
feature2.setAttributes {"OBJECTID":2,"Add_line":"303 Kulana St","state":"HI","city":"Hilo","zip":"96720","zip_4":"2266"});
features.push(feature2);
var featureSet = new esri.tasks.FeatureSet();
featureSet.features = features;
... View more
07-20-2011
09:14 AM
|
0
|
0
|
1488
|
|
POST
|
Unable to pass value to GPRecordSet object. Hi , I have a gp task which requires input as a GPREcordset object . Details for input parameter from rest end point Parameter: record_set Data Type: GPRecordSet Display Name: record_set Direction: esriGPParameterDirectionInput Default Value: Fields: OBJECTID (Type: esriFieldTypeOID, Alias: OBJECTID) Add_line (Type: esriFieldTypeString, Alias: Add_line) state (Type: esriFieldTypeString, Alias: state) city (Type: esriFieldTypeString, Alias: city) zip (Type: esriFieldTypeString, Alias: zip) zip_4 (Type: esriFieldTypeString, Alias: zip_4) Parameter Type: esriGPParameterTypeRequired I need to create this GPRecordset object in javascript to pass it to the GP task Code snipplet I tried feature_set = { "features" : [ { "attributes" : {"Add_line":"303 Kulana St","state":"HI","city":"Hilo","zip":"96720","zip_4":"2266"} }, { "attributes" : {"Add_line":"303 Kulana St","state":"HI","city":"Hilo","zip":"96720","zip_4":"2266"} } ] }; var featureSet = new esri.tasks.FeatureSet(feature_set); var params = {"record_set":featureSet}; gp.submitJob(params, completeUploadCallback , statusUploadCallback,errorAlert); The job is successfully submitted , but as soon as it goes to the arcgis server , it fails . I m able to run the geoprocessing service thru ArcMap by passing the features interactively but I m not able to properly set the FeatureSet object in javascript. How can a GPRecordSet object be created for an input to geoprocessing service and passed through Javascript ? Look at the ESRI sample: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/gp_clipasync.html. The only difference is that the GPRecordSet is equivalent to JS API FeatureSet without geometry. For example, if you do a querytask with Query.retureGeometry =false, the result is equivalent to GPRecordSet.
... View more
07-20-2011
05:01 AM
|
0
|
0
|
1488
|
|
POST
|
Hi there, Just wondering how I can load more than one base layer into an overview map dijit? I'd like to add a tiled layer and, on top, an operational layer that is loaded in the main map? Thanks for any assistance. Ed I don't think you can add more then one layer on the overview map. An alternative approach would be add another map control on the page acting as a overiew map and using Map's onExtentChange event to synchronize the extents and behaviors of the two maps.
... View more
07-13-2011
10:42 AM
|
0
|
0
|
663
|
|
POST
|
I'm new to GIS and I'm trying to figure out how to use ARCGis to geocode addresses we have in the database and get the corresponding Census Block and Tract numbers. I'd appreciate any help. Thanks, Geocoding address gives you a point. Use the point to do a spatial query (or a identify task) against the Census layer.
... View more
07-13-2011
05:14 AM
|
0
|
0
|
645
|
|
POST
|
Hi I'm trying to adapt the "Show Find Task results in DataGrid" to zoom to the result in the grid. I can see how the code loops through the results and populates the grid, but have hit a time barrier to try and get the click bit working - I've tried adapting http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/find_map_datagrid.html without much luck and now I've run out of "free" time and have to get back to other stuff. Any help would be great Cheers ACM This thread might give you a hint: http://forums.arcgis.com/threads/33472-Find-Task-and-DataGrid-Questions?p=113045#post113045
... View more
07-13-2011
05:10 AM
|
0
|
0
|
462
|
|
POST
|
Hi Heming Sorry but I have stumbled upon another problem so if you fancy figuring the following out I would appreciate it! 🙂 All of my candidate addresses are coming up in the data grid and I can successfully zoom to each one which is great, but I am trying to limit the number of results that are outputted to the grid using an if statement which is used in the ESRI locator sample (the code snippet below is what I have tried to use). I run it when the array 'items' is built to try and only select those that have a candidate score of 80 or above - my graphics layer is successfully drawing only those candidates that have a score of +80 but the data grid has an error, when using firebug it mentions that it "cannot set property '_RI' of undefined". Digging a bit deeper this variable seems to be set in the dojo.data.ItemFileReadStore:- this._rootItemPropName = "_RI"; // Default Item Id for isItem to attach to every item. This might be something more dojo related but I don't suppose you have any other possible ways of limiting the candidates down by scores or indeed if the above error might be solvable? I appreciate all the help you have given me so far! 🙂 //CODE //create array of attributes var items = dojo.map(candidates,function(candidate){ if (candidate.score > 80){ geom = new esri.geometry.Point(candidate.location.x, candidate.location.y); var attributes = candidate.attributes; var scoreCandidate = candidate.score; var graphic = new esri.Graphic(geom, symbol, attributes); //add a graphic to the map at the geocoded location map.graphics.add(graphic); return candidate.attributes;//break out of loop after one candidate with score greater than 80 is found. } }); //CODE The simplest approach would be setup the loactor's minium score as 80 and then publish it on the server. then you would has to deal with it using code logic.
... View more
07-12-2011
09:07 AM
|
0
|
0
|
1902
|
| 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
|