When using Gmap static in views the PolylineReducer class is used to reduce the number of points to plot down so that http://maps.google.com/staticmap service can work with them.

On long tracks (those with many points) the PolylineReducer class takes a long time to run.

With a view with numerous tracks with this issue this can cause the page to timeout.

This calculation should be performed at time of node save, or it's result at least cached.

Comments

raintonr’s picture

Status: Active » Needs work

This was tracked down to the fact that the _trackfield_map_optimise_for_gmap function always uses a very low tolerance then moves this up.

It is better to use a starting tolerance based on the lat/lon range. This seems to work:


  /* Have a guess at tolerance. */
  $tolerance = max($dlat, $dlon) / 150;

Possibly needs more thought before committing.

raintonr’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

silverwing’s picture

spam tag clean-up - please excuse the noise.