POST
|
Hi everyone! Like this example:https://developers.arcgis.com/en/javascript/jssamples/time_slider_layerDef.html , I have added my featureLayer to my map, and bind the timeSlider with the timeExtent = featureLayer's timeExtent. After that, the points display normally, but i cannot get attribute data of these points. But, after i click the play button, in the timeSlider's "timeExtentChange" event, I can get the attribute data of the points normally. My question is that how can i get the attribute data of the points after i bind timeSlider to map and before i click the play button. This is my code.
function initSlider(results) {
var timeLayers = dojo.map(results, function (result) {
return result.layer;
});
var timeExtent = new esri.TimeExtent();
timeExtent = results[0].layer.timeInfo.timeExtent;
var timeSlider = new esri.dijit.TimeSlider({
style: "width: 800px;"
}, dojo.byId("timeSliderDiv"));
myMap.setTimeSlider(timeSlider);
timeSlider.setThumbCount(1);
timeSlider.createTimeStopsByTimeInterval(timeExtent, 1, 'esriTimeUnitsHours');
timeSlider.singleThumbAsTimeInstant(true);
timeSlider.setThumbIndexes([0]);
timeSlider.setThumbMovingRate(1000);
timeSlider.setLoop(true);
timeSlider.startup();
//add labels for every other time stop
var labels = dojo.map(timeSlider.timeStops, function (timeStop, i) {
return timeStop.getHours();
});
timeSlider.setLabels(labels);
//search the initial datas
var timeQuery = new esri.tasks.Query();
var timeE = new esri.TimeExtent();
timeE = myMap.timeExtent;
timeQuery.timeExtent = timeE;
dojo.forEach(timeLayers, function (layer) {
var mappedField = layer.renderer.attributeField;
layer.queryFeatures(timeQuery, function (featureSet) {
var timeDatas = dojo.map(featureSet.features, function (feature) {
return [feature.attributes["RG_id"], Number(feature.attributes[mappedField])];
});
});
});
//search datas in the timeSlider's event.
dojo.connect(timeSlider, "onTimeExtentChange", function (timeExtent) {
timeQuery.timeExtent = timeExtent;
var yearlyLayerProduction = '';
dojo.forEach(timeLayers, function (layer) {
var mappedField = layer.renderer.attributeField;
layer.queryFeatures(timeQuery, function (featureSet) {
var chartDatas = dojo.map(featureSet.features, function (feature) {
return [feature.attributes["RG_id"], Number(feature.attributes[mappedField])];
});
});
});
});
}
I also found this example seemed resolved this problem, but i haven't find the different of the these two examples. https://developers.arcgis.com/en/javascript/jssamples/time_streetTrees.html This problem has troubled me for a long time. Can anyone help me? Any help will be appreciated. Thank you Shengli Zhao
... View more
10-29-2013
02:08 AM
|
0
|
0
|
276
|
POST
|
Hi every one, thank your for your attention. i need help. In my application, i need to do the Kriging interpolation work online. so, i published a GP Service for the kriging interpolation. the service require a input parameter witch type is GPFeatureRecordSetLayer, and it return a GPRasterDataLayer. In the client, i get the data from my database, and use them to create graphics. I use the asynchronous form to get the result. But after i submit my request, Why there is nothing response? even the statusCallback function didn't be triggered. That's why ? relative code: submitJob code: gp.submitJob( {"Points_Input" : featureSet} , completeCallback, statusCallback );//the parameters were created before. statusCallback function: function statusCallback(jobInfo) { var status = jobInfo.jobStatus; dojo.byId("messages").innerHTML = "Status: " + status; } completeCallback function: function completeCallback(jobInfo) { var imageParams = new esri.layers.ImageParameters(); gp.getResultImageLayer(jobInfo.jobId, "Image_Output",imageParams, displayResult); } display the result: function displayResult(layer) { myMap.addLayer(layer); }
... View more
04-15-2013
08:02 AM
|
0
|
0
|
571
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|