Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Our web app uses the ESRI JS API. With SNAPSHOT, our feature layers take a long time to show up on the map, especially after using setDefinitionExpression to restrict the feature layer to a date range. If we change it to ONDEMAND, our feature layers show up very quickly, but not reliably. It often takes wiggling the mouse (panning a small amount of pixels) to get the feature layers to show up.

Does this sound familiar to anyone? Which of the two modes would be a better starting point to get things working right? SNAPSHOT got much quicker after we turned off TimeInfo in our feature layers, but it's still noticeably slower than ONDEMAND.

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

SNAPSHOT is more useful if you're doing something with with the TimeSlider, like showing hurricanes through the different hurricane seasons. You have a long load time up-front, but no loading waits while it shows your data over time.

ONDEMAND works better if you have a lot of features, but only want to concentrate on a few at a time (typically the ones in the viewing area). It's load as you go. If you're selecting features from a feature layer on the map, ONDEMAND is typically the way to go.

share|improve this answer
    
Thanks! Yes, the performace is much better with ONDEMAND, as we are not doing a TimeSlider but applying a date range from two calendar controls. Does the not rendering until mouse moved sound familiar? That is the only negative we have with ONDEMAND. –  Joe Ballard Mar 19 '13 at 18:02
    
Are you loading the FeatureLayer before or after the map's onLoad event fires? ESRI's examples show them loading the FeatureLayer on the map after the map loads its basemap. Example1, Example2 –  raykendo Mar 19 '13 at 18:16
    
My guess is that the map extent hasn't been established when the FeatureLayer is loaded, so the FeatureLayer doesn't know what extent of features to demand. That may be why you have to jiggle the map around to get your results. Find a way to add the FeatureLayer when the map's onLoad event fires. –  raykendo Mar 19 '13 at 18:54
    
Initially before, but also after, when we can remove and add layers (as part of changing "themes"). –  Joe Ballard Mar 19 '13 at 19:00
    
One hack you could do to make your FeatureLayer load is to shift your map extent just a little when the map loads or when the FeatureLayer changes layers. –  raykendo Mar 19 '13 at 19:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.