You need to load your GeoJSON from the source(View) into your application. This can be done using AJAX in leaflet. In the tutorial at https://youtu.be/vWcasu07R7Q , the GeoJSON is loaded from the DB and loaded into Leaflet. Then the MarkerCluster, for example, is used to cluster all the points into nice visualizations on the map. It’s been a while since I used PHP but I believe you already have the PHP method to fetch the data from the DB. Use that method to bring in the data into leaflet and then cluster it. If no success, let me know.
1 minute read