AnsweredAssumed Answered

Lots of map queries when using the SnappingManager with a FeatureLayer with MODE_ONDEMAND

Question asked by greenkarmic on May 8, 2017
Latest reply on Jun 16, 2017 by greenkarmic

I enabled snapping on the Map and I'm using a couple of FeatureLayers with MODE_ONDEMAND with it so that it can fetch all the required geometry from the MapServer required for snapping to lines in the map.

 

It works fine, but I noticed that for each pan or zoom operation in the map, the API triggers a total of 3 to 6 identical queries to the map server to get the FeatureLayer geometry. A zoom operation always triggers 12 queries (6 per FeatureLayer). They are all identical queries except a small difference in the xmin and xmax of the geometry used for the spatial intersection in the query.

 

I'm assuming the map generates a bunch of extent-change events when zooming and that the SnappingManager accepts them all and makes a query to get the FeatureLayer geometries for each of them. (We have over 215 clients/map services so this is pretty wasteful. Especially since we plan to throttle the map services using a resource-proxy in the near future. All these queries will make it harder to configure the proxy properly.)

 

Is there a way to maybe throttle the extent-change events the map generates?

 

Thanks for the help, I attached a screenshot of all the queries it generates for a single zoom in the map.

 

EDIT: I'm not using MODE_SNAPSHOT with the FeatureLayer because it would then be limited to 1000 features as set by the map service config and 1000 is not enough is some situations.

 

Yohan

Attachments

Outcomes