I made a snippet for ModX to display a table from a database on the page, in the table there are 48000 rows:

$area = 'SELECT * FROM `items`'; $query = $modx->query($area); if ($query) { while ($i= $query->fetch(PDO::FETCH_ASSOC)) { echo '<area coords="'.$i['x1'].','.$i['y1'].','.$i['x2'].','.$i['y2'].'" href="http://'.$i['href'].'" title="'.$i['title'].'" shape="rect">'; } } 
The results are displayed in the template, forming a bunch of zones in the map tag.

 <map id="Map" name="Map"> [[!Snippet]] </map> <img usemap="#Map" id="target" src="assets/img/main.png"> 

I put LIMIT 1000 elements - everything is OK, if I raise the limit to 5000 and above - the browser hangs. I tried to run both on the virtual hosting and on the dedicated one for 20000r per month - the same thing, the base load is shown to be minimal.
Render time: 0.3190 s
The page as a result is displayed, visually 5-10 seconds. On the ipad, only a part of the page is visible (((

Is this a limitation of the browser or is it all = the snippet is clumsily made?

  • one
    continue to specify exactly what version of modx you have - revo or evo. - Vasis
  • Version of ModX REVO - Sergey V.

1 answer 1

48 000 lines for any browser to say the least. If you need to display a bunch of points, you need to use tools specifically designed for such tasks - for example, ymaps.Clusterer in Yandex maps.

  • thanks, read. and still tools? - Sergey V.
  • one
    For sure. Googly specifically for your task and compare. - Vasis September