Select to view content in your preferred language

Feature layer stops refreshing when zooming with dgrid

1211
6
02-13-2014 05:08 AM
MichelleRogers1
Occasional Contributor
I have a feature layer that is set on a refresh interval of 5 seconds.  I also have a dgrid that is set to refresh when the feature layer updates.  Both features work when zoomed out to the full extent of the map, but if I click on a vehicle and zoom to it, the feature layer stops refreshing that one vehicle.  The rest of the vehicles and the grid keep refreshing though.  Is there an extra bit of code that I don't have included when the grid zooms that should be there to keep the feature layer refreshing?  My code is on jsfiddle here:http://jsfiddle.net/mrogers83/XwkFN/
0 Kudos
6 Replies
KenBuja
MVP Esteemed Contributor
This may not be the cause of your issue, but your aliases do not match the modules in the require statement.

require([      
                "dojo/ready", "dgrid/OnDemandGrid", "dgrid/Selection", "dojo/store/Memory", "dojo/_base/array",      
                "dojo/dom-style", "dijit/registry", "esri/map", "esri/layers/FeatureLayer", "esri/symbols/SimpleMarkerSymbol",      
                "esri/tasks/QueryTask", "esri/tasks/query", "dojo/_base/declare", "dojo/number", "dojo/date/locale", "dojo/on",
                "dojo/parser", "esri/dijit/HomeButton", "esri/dijit/BasemapToggle", "esri/InfoTemplate", "esri/layers/ArcGISDynamicMapServiceLayer",      
                "dijit/layout/BorderContainer", "dijit/layout/ContentPane"
                ], function(        
                    ready, Grid, Selection, Memory, array, 
                    domStyle, registry, Map, FeatureLayer, SimpleMarkerSymbol, 
                    QueryTask, Query, declare, dojoNum, locale, on, 
                    parser, HomeButton, BasemapToggle, InfoTemplate, ArcGISDynamicMapServiceLayer
                )
0 Kudos
MichelleRogers1
Occasional Contributor
This may not be the cause of your issue, but your aliases do not match the modules in the require statement.

require([      
                "dojo/ready", "dgrid/OnDemandGrid", "dgrid/Selection", "dojo/store/Memory", "dojo/_base/array",      
                "dojo/dom-style", "dijit/registry", "esri/map", "esri/layers/FeatureLayer", "esri/symbols/SimpleMarkerSymbol",      
                "esri/tasks/QueryTask", "esri/tasks/query", "dojo/_base/declare", "dojo/number", "dojo/date/locale", "dojo/on",
                "dojo/parser", "esri/dijit/HomeButton", "esri/dijit/BasemapToggle", "esri/InfoTemplate", "esri/layers/ArcGISDynamicMapServiceLayer",      
                "dijit/layout/BorderContainer", "dijit/layout/ContentPane"
                ], function(        
                    ready, Grid, Selection, Memory, array, 
                    domStyle, registry, Map, FeatureLayer, SimpleMarkerSymbol, 
                    QueryTask, Query, declare, dojoNum, locale, on, 
                    parser, HomeButton, BasemapToggle, InfoTemplate, ArcGISDynamicMapServiceLayer
                )


I'm not sure what you mean by this.  Are you saying that I'm requiring code that doesn't exist in my code?  If so, I am planning on incorporating those into my code, but can't get them to work either.  The HomeButton is in the code, it just doesn't show up on the map.
0 Kudos
KenBuja
MVP Esteemed Contributor
What this means is the arguments in the "function" part must be in the same order as the modules are listed in the require part. Take a look at the order in my post versus what's in your Fiddle. You don't necessarily need an argument for each module, but the modules the don't have an argument ("dijit/layout/BorderContainer", "dijit/layout/ContentPane") must be listed after the modules that have an argument.
0 Kudos
MichelleRogers1
Occasional Contributor
What this means is the arguments in the "function" part must be in the same order as the modules are listed in the require part. Take a look at the order in my post versus what's in your Fiddle. You don't necessarily need an argument for each module, but the modules the don't have an argument ("dijit/layout/BorderContainer", "dijit/layout/ContentPane") must be listed after the modules that have an argument.


Ken,

That took care of the home button, basemap toggle, and dynamic map service layer not showing up on the map, but the one vehicle I click on in the dgrid still stops refreshing on the map.  It does the same thing when I click on the vehicle itself.  Do I need to call a refresh of the feature layer inside the functions for those maybe??
0 Kudos
MichelleRogers1
Occasional Contributor
Has anyone had any luck in figuring this bug out?  It's the last bug I have in the code.
0 Kudos
MichelleRogers1
Occasional Contributor
I just posted my most recent jsbin code here:http://jsbin.com/qij/1/edit?html,console

As I previously stated, the feature layer is set to refresh every 5 seconds, but when the feature layer is zoomed to from the dgrid, it stops refreshing.  I am not sure why this is happening, but I need the feature layer to keep refreshing even when the car is zoomed to.
0 Kudos