2

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.

1 Answer 1

5

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.

5
  • 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. Commented Mar 19, 2013 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
    Commented Mar 19, 2013 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
    Commented Mar 19, 2013 at 18:54
  • Initially before, but also after, when we can remove and add layers (as part of changing "themes"). Commented Mar 19, 2013 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
    Commented Mar 19, 2013 at 19:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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