Select to view content in your preferred language

How to handle refresh in dynamic map

1798
6
Jump to solution
07-26-2017 08:41 AM
EvelynHernandez
Frequent Contributor

Hello everyone,

My question is the following.

We have a service that we populated with GPS cars data and we made an app to show how the cars are moving on the map.

We noticed that the data is refreshing too slow, and we actually want to see the cars movement on the map.

I setted up the service as dynamic layer, and in the API there is a property called refreshInterval where the minimun interval is 1 minute and 0 if u want to stop autorefresh.

Actually i didnt set up the property yet, so i dont know what is the default interval for the map.

The table where we get the data is updated in less than a minute. So we realized the refresh is still very slow.

Which is the best option for this? in terms on settings and programming in js.

How i implement the layer is:

var gpsCars = new ArcGISDynamicMapServiceLayer(layers.read_GPS(), {id:"gis_gps"});
gpsCars.setInfoTemplates({
 0: {infoTemplate: myinfotemplate.getCarsInfo()}
 });
gpsCars.setImageFormat("png32");

mapp.addLayers([..., gpsCars]);

Thanks in advice

0 Kudos
1 Solution

Accepted Solutions
EvelynHernandez
Frequent Contributor

yes, i tried with 0.1

View solution in original post

0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Emeritus

Evelyn,

   Have you tried:

gpsCars.setRefreshInterval(0.5);  ///or less
EvelynHernandez
Frequent Contributor

yes, i tried with 0.1

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Evelyn,

Have you tried anything lower than that? Sounds like you map service is just taking a long time to draw.

0 Kudos
EvelynHernandez
Frequent Contributor

Well no, I'm going to try 0.01. 

Thanks.

0 Kudos
AdamRepsher
Frequent Contributor

endlessdsire,

Did you try just adding it to an ‌ map and setting the layer's refresh setting there?  I am using this now at the 0.1 setting (which equals 6 seconds) and it works well for over 800 tracked vehicles at a time.  Maybe checking the service here could help to isolate the issue?

I do not believe that a setting of 0.01 (0.6 seconds) will help you at all because the user's queries to the service and subsequent screen refresh would just tie up your application and you would not be able to see anything at all.

I am also not aware of the data source of your service.  I know, past a certain number of vehicles at a certain rate of position refresh, my SQL server cannot keep up with writing position updates AND handling user queries.  Thought I might mention that as a possible chokepoint.

I do know that the ArcGIS Data Store configured as Spatiotemporal can handle much more throughput. I am going to be using this in the near future to support all of our real-time data services.

--Adam

0 Kudos
EvelynHernandez
Frequent Contributor

Yes, I tried the 0.1 and i ask to one of my coworkers about the refresh time for the data and it is 1min app.

So if i set up the time that u suggest it will work for sure.

Hm another thing i noticed, in edge the refresh Interval for dynamic is making the layer does some snapping, but in chrome that snapping doesnt exist. Weird.

Thanks for all ur help

0 Kudos