Download the PHP package emilklindt/laravel-marker-clusterer without Composer

On this page you can find all versions of the php package emilklindt/laravel-marker-clusterer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-marker-clusterer

Server-side marker clustering in Laravel

Unit Test status Packagist Version (including pre-releases) Packagist PHP Version Support MIT License

The emilklindt/laravel-marker-clusterer package allows you to cluster markers in Laravel, before sending them to the client-side.

When serving large datasets it may not be feasible or practical to send all datapoints to the client side. This may be due to the large payload necessary to transfer all datapoints individually, or to avoid undue processing on the client. This project aims to facilitate these cases, with server-side marker clustering for Laravel.


Table of Contents
  1. Installation
    • Publish config file
  2. Usage
    • Adding markers
    • Clustering markers
  3. Clusterers
    • K-means Clusterer
    • Density-Based Spatial Clusterer
  4. Testing
  5. Credits
  6. License

Installation

You can install the package via composer:

The package will automatically register itself.

Publish config file

You can optionally publish the config file with:

This is the contents of the file that will be published at config/marker-clusterer.php:

Contents of the configuration file

Usage

In order to manage which clustering algorithm is used throughout your applicaiton, you are encouraged to use the DefaultClusterer class. This uses the default_clusterer value in the marker-clusterer config, which can be easily changed by publishing the configuration.

Adding your markers

The clusterer takes a collection of markers. However, these markers have to implement the Clusterable interface, which has a single method for retrieving the marker coordinate.

An example implementation in your Eloquent model may look like this:

Clustering your markers

With the interface implemented, a collection of cars may be clustered like so:

See the clusters section below for the different clustering methods and their parameters.

Clusterers

Contributions or feature requests are welcomed. Feel free to create a pull request or post your feature request in the ideas discussion topic.

Credit: NSHipster/DBSCAN repository

K-means clustering

Perhaps the most well known algorithm in clustering, k-means clustering will partition n elements into k clusters.

As shown illustratively above, K-means clusters markers into the cluster with the nearest mean, meaning the least distance from marker to the center of the cluster. K-means requires a k value, which is the number of clusters desired. There are many different ways of choosing this value, depending on your dataset, however this is not yet adressed in this repository.

Configuration parameters applicable to the KMeansClusterer:

All properties marked optional has default values, specified in the configuration. See the publishing config file section above to manipulate these.

Density-Based Spatial clustering

Algorithm used is Density-Based Spatial Clustering of Applications with Noise (DBSCAN).

This clustering method overcomes a common issue with K-means clustering, namely the need to specify the number of clusters. This parameter may be dependent on the data set – more specifically, the density of the dataset. The DBSCAN algorithm takes an epsilon (maximum distance between two points to be grouped together) and minSamples (minimum amount of points to be grouped, to form a cluster).

The "Application with Noise" portion means, that the clustering method is able to handle noise. Meaning, points not immediately related to a cluster, may be either discarded or returned as single points, depending on the includeNoise configuration.

Configuration parameters applicable to the DensityBasedSpatialClusterer:

All properties marked optional has default values, specified in the configuration. See the publishing config file section above to manipulate these.

Testing

Credits

Thanks to Spatie for providing inspiration and useful resources for package development.

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-marker-clusterer with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
illuminate/support Version >=5.1
spatie/data-transfer-object Version 2.8.3
league/geotools Version ^0.8.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package emilklindt/laravel-marker-clusterer contains the following files

Loading the files please wait ....