Select to view content in your preferred language

error: exception in animation handler for: onEnd

7648
11
04-09-2012 07:59 AM
danbecker
Frequent Contributor
In firebug, I get this error when I zoom to the visibility scale of the 'props' layer:

exception in animation handler for: onEnd...?v=2.8 (line 14)
TypeError: _69.color is Null...Legend.xd.js (line 19)


If I remove the props layer from both the map and legend objects, the error is gone.

Here's what I have:

dojo.addOnLoad(init);
var mapLayers = [];
var legendLayers = [];
  
//Function to initialize the map and read data from Configuration file
function init() {
        setupFindTask();
        //asp.net proxy page for token service
        esri.config.defaults.io.proxyUrl = "proxy.ashx";
        //change the location of the map slider
 esri.config.defaults.map.slider = { left:"13px", top:"76px", width:null, height:"150px" };
 //change zoom options to try and get map to display faster
 esri.config.defaults.map.zoomRate = 50;
 esri.config.defaults.map.zoomDuration = 1000;

 dojo.connect(map, "onLoad", mapLoaded);
 dojo.connect(grid1, "onRowClick", onRowClickHandler);

 //lets grab the details from the config.txt file  
 dojo.xhrGet({
        url: "Config.txt",
        handleAs: "json",
        preventCache: true,
        load: function (responseObject, ioArgs) {
                var mapExtent = responseObject.DefaultExtent;
                defaultID = responseObject.defaultID;
  defaultFacName = responseObject.defaultFacName;
  defaultFacCityState = responseObject.defaultFacCityState;                    
     
  var startExtent = new esri.geometry.Extent(parseFloat(zoomExtent[0]), parseFloat(zoomExtent[1]),
                                        parseFloat(zoomExtent[2]), parseFloat(zoomExtent[3]), new esri.SpatialReference({ wkid: 102100}));
     
     
  dojo.byId('imgApp').src = responseObject.ApplicationImage;
                dojo.byId('lblAppName').innerHTML = responseObject.ApplicationName;     
          
         map = new esri.Map("map", { extent: startExtent});     
     
  createBasemapGallery();
  
  dojo.connect(map, "onLoad", MapInitFunction);
                }
 });
}
 
//map layers can be added here
function MapInitFunction(map) {
        var facils = new esri.layers.FeatureLayer("https://mydomain.com/MapServer/0",{
         mode:esri.layers.FeatureLayer.MODE_SNAPSHOT,
  id: 'facils',
         outFields:["*"]
       });
 legendLayers.push({layer:facils,title:"Facilities"});
  
 var bndry = new esri.layers.FeatureLayer("https://mydomain.com/MapServer/3",{
        mode:esri.layers.FeatureLayer.MODE_SNAPSHOT,
  id: 'bndry',
  opacity: 0.7,
         outFields:["*"]
       });
 legendLayers.push({layer:bndry,title:"Boundary"});
  
 var props = new esri.layers.FeatureLayer("https://mydomain.com/MapServer/2",{
        mode:esri.layers.FeatureLayer.MODE_SNAPSHOT,
  id: 'props',
         outFields:["*"]
       });
 legendLayers.push({layer:props,title:"Property Boundaries"});

 dojo.connect(map,'onLayersAddResult',function(results){
  var legend = new esri.dijit.Legend({
   map:map,
                        layerInfos:legendLayers
           },"legendDiv");
                 
                 //when the map extent is changed, refresh legend layers since layerInfos is used in legend constructor
  dojo.connect(map, "onExtentChange", function(){
   legend.refresh();
  });
 legend.startup();
        });

        map.addLayers([bndry,props,facils]);
  
 dojo.connect(map,'onLayersAddResult',function(results){
  //add check boxes
  dojo.forEach(legendLayers,function(layer){
   var layerName = layer.title;
   var checkBox = new dijit.form.CheckBox({
    name: "checkBox" + layer.layer.id,
                      value: layer.layer.id,
                      checked: layer.layer.visible, 
    onChange: function(evt) {
     var clayer = map.getLayer(this.value);
     clayer.setVisibility(!clayer.visible);
     this.checked = clayer.visible;
     }
    });
     
          //add the checkbox and label to the toc
          dojo.place(checkBox.domNode,dojo.byId("toggle"),"after");
          var checkLabel = dojo.create('label',{'for':checkBox.name, innerHTML:layerName},checkBox.domNode,"after");
          dojo.place("<br />",checkLabel,"after");
     
  });
 });
   
}


anyone see this problem before?

edit: The problem seems to start at v2.7; changing to v2.5 or v2.6 there is no error, and everything works fine.
0 Kudos
11 Replies
ShinKobara1
Emerging Contributor
no-one have any ideas about this, our clock is ticking and I need to get my app working in IE10

It must be something I have added recently that has caused this as earlier versions of my app worked in IE10 - but there's about 3 months of changes I'll have to pick through - if anyone has any pointers it would be appreciated.


Do you use maxAllowableOffset to reduces feature size?
I had the similar issue and checked a feature layer with maxAllowableOffset.
I switched a feature layer to a dynamic layer, forgot to delete maxallowableoffset setting, which made a blur screen whenever zoom-in/out.
0 Kudos
AdrianMarsden
Honored Contributor
Well, I did get the error to go away, but no idea how.  I have three versions, a internet "frozen" version from April  - worked. A Live version - failed and a Dev version - worked !  So I finished what I was doing on Dev and made it live.  So no idea what it was.

ACM
0 Kudos