Select to view content in your preferred language

ArcGIS API for JS - Histogram timeslider

418
0
06-30-2014 08:53 AM
MaryWindsor
Deactivated User
Hi,


I am getting these errors:

message /index_062514timeslide.jsp (line: 1045, column: 19) The attribute prefix [date] does not correspond to any imported tag library

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: /index_062514timeslide.jsp (line: 1045, column: 19) The attribute prefix [date] does not correspond to any imported tag library





This is the script, based off of the ArcGIS API for JS example of which I changed it very little from the original (https://developers.arcgis.com/javascript/jssamples/widget_histogram_time_slider.html😞


          // feature service for time slider
          var featuresUrl = "insert map service";
          var layer = new FeatureLayer(featuresUrl, {
            id: "u2",
            infoTemplate: new InfoTemplate(
              "GHS Data:  2011",
              "Date:  ${date: DateFormat(selector: 'date', fullYear: true)}<br>" +
              "Price:  ${price}<br>" +
              "Population:  ${SUM_SUM_PO}"
            ),
            // infoTemplate: new InfoTemplate("title", "description"),
            mode: FeatureLayer.MODE_SNAPSHOT, // SNAPSHOT required for the histogram time slider
            outFields: ["*"]
          });

          var layerUpdateEnd = layer.on("update-end", function() {
            layerUpdateEnd.remove();

            var sliderElem = domConstruct.create("div", {
              id: "timeSlider_"+ map.id,
              style: "margin-bottom:10px; bottom:33px"
            }, "bottom-div");
            var sliderParams = {
              // format the dates as mm/dd/yyyy
              // more formatting options:  https://developers.arcgis.com/en/javascript/jshelp/intro_formatinfowindow.html
              dateFormat: "DateFormat(selector: 'date', fullYear: true)",
              layers : [ layer ],
              mode: "show_all",
              timeInterval: "esriTimeUnitsDays"
            };
            var slider = new HistogramTimeSlider(sliderParams, sliderElem);
            map.setTimeSlider(slider);
            domConstruct.destroy("loading");
          });
         
          map.addLayer(layer);




From what I can tell, it looks like the script isn't extracting the date correctly..but I can't figure out why...
The example works for me, and the main difference I see is that the example uses a layer that enables feature access..
Would I need to enable feature access as well?

Any help would be appreciated, thanks!


Best,

Mary
0 Kudos
0 Replies