Select to view content in your preferred language

Why Map Layer is slow in JavaScript API Environment?

3636
1
07-10-2014 12:36 PM
LeiZhou
Deactivated User

I used JavaScript API to build a web application for our organization.  The map layer (census tract which is our own map service) seems displaying in a very slow speed; the SAME map service works fine in our Flex-Viewer based application. My question is: what possible reason could make this happen? For example, in JavaScript API environment the layer is created as ArcGIS Feature layer; while in Flex-Viewer environment the layer is ArcGIS Dynamic layer.  Any hint will be helpful for us.  Thanks a lot!

0 Kudos
1 Reply
TimHollingshead
Deactivated User

An ArcGISDynamicMapServiceLayer uses the images generated by the dynamic map service, while a FeatureLayer draws a separate graphic for each feature. This means that a FeatureLayer has to request the geometry/attributes for each feature, which could be a significant amount of data for the census tract service.

If you don't need the additional capability of a FeatureLayer, using a ArcGISDynamicMapServiceLayer will most likely reduce the data payload, and resolve the performance issues you are experiencing.

Here is the documentation on the layers:

https://developers.arcgis.com/javascript/jsapi/arcgisdynamicmapservicelayer-amd.html

https://developers.arcgis.com/javascript/jsapi/featurelayer-amd.html