Why does my map load slow using Flex, but not in JavaScript?

3101
3
Jump to solution
07-10-2015 02:33 PM
ChrisSergent
Regular Contributor III

We have a Flex Viewer application that uses the following web service: ActiveCDCases (MapServer)

If I click on View in ArcGIS JavaScript, the map loads quickly, but if it is viewed on our site in Flex, it runs slow, but there are no errors.

Our site is at: City Code Violation Database

Also, is there a way to add a loading icon while waiting for the data to display?

0 Kudos
1 Solution

Accepted Solutions
JonathanQuinn
Esri Notable Contributor

When you look at the service in the Javascript API at Rest, you're viewing the cached service which returns pre-created tiles.  A cached service will perform better than a dynamic service, as a cached service is returning pre-created tiles instead of dynamically creating images to send ot the client.  In your application, though, it looks like you're adding the feature layer of the cached service to the application, which then forces the application to submit query requests for the data.  Why are you adding the feature layer to the application, instead of the whole map service to take advantage of the cache?  You can still access the popups for the map service even if it's cached.

View solution in original post

3 Replies
JonathanQuinn
Esri Notable Contributor

When you look at the service in the Javascript API at Rest, you're viewing the cached service which returns pre-created tiles.  A cached service will perform better than a dynamic service, as a cached service is returning pre-created tiles instead of dynamically creating images to send ot the client.  In your application, though, it looks like you're adding the feature layer of the cached service to the application, which then forces the application to submit query requests for the data.  Why are you adding the feature layer to the application, instead of the whole map service to take advantage of the cache?  You can still access the popups for the map service even if it's cached.

ChrisSergent
Regular Contributor III

We would still want to query data that displays.Would we be able to do that?

0 Kudos
JonathanQuinn
Esri Notable Contributor

Yes, you're considering display, but then attribute information.  The operational layers is the display, but query and search widgets and popups are separate.  You can still query the service regardless if it's cached, (as we can also see when you add the feature layer to the map).