PHPackages                             pankaj7590/geoplot - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. pankaj7590/geoplot

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

pankaj7590/geoplot
==================

A lightweight PHP library for plotting geographic coordinates with optional Yii2 integration.

v1.0.2(1mo ago)06↓28.6%MITPHPPHP &gt;=7.4CI failing

Since Jul 3Pushed 1mo agoCompare

[ Source](https://github.com/pankaj7590/geo-plot)[ Packagist](https://packagist.org/packages/pankaj7590/geoplot)[ Docs](https://github.com/pankaj7590/geo-plot)[ RSS](/packages/pankaj7590-geoplot/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

GeoPlot
=======

[](#geoplot)

A lightweight PHP library for plotting geographic coordinates on an interactive canvas without relying on external map tile providers.

GeoPlot is designed for applications that need to visualize latitude and longitude datasets such as hotels, tourist attractions, offices, warehouses, or custom geographic points. It provides a fast, dependency-free plotting engine with optional Yii2 integration.

---

Features
--------

[](#features)

- 📍 Plot latitude and longitude coordinates on an interactive canvas
- 🗺️ No dependency on Google Maps, OpenStreetMap, or other tile providers
- 🔍 Built-in zoom and pan controls
- 🎯 Highlight individual points with custom styling
- 🎨 Custom marker colors, labels, and tooltips
- ⚡ Lightweight and fast rendering
- 🔌 Optional Yii2 widget integration
- 🧩 PSR-4 compliant and Composer installable

---

Requirements
------------

[](#requirements)

- PHP 7.4 or later

Optional:

- Yii2 (only if using the provided widget)

---

Installation
------------

[](#installation)

Install via Composer:

```
composer require geoplot/geoplot
```

If Yii2 integration is required:

```
composer require yiisoft/yii2
```

---

Quick Start
-----------

[](#quick-start)

```
require 'vendor/autoload.php';

use GeoPlot\Dataset;
use GeoPlot\Plot;
use GeoPlot\Point;

$dataset = Dataset::make('Hotels')
    ->style([
        'color' => '#2196f3',
        'size' => 7,
    ]);

foreach ($points as $point) {
    $hotel = Point::make($point->latitude, $point->longitude, $point->name);

    if ($point->isSelected) {
        $hotel->mark('#e53935', 10);
    }

    if (!empty($point->url)) {
        $hotel->url($point->url);
    }

    $dataset->add($hotel);
}

$plot = new Plot([
    'datasets' => [$dataset],
    'height' => '600px',
    'maxZoom' => 5000,
]);

echo $plot->render();
```

---

Yii2 Integration
----------------

[](#yii2-integration)

GeoPlot includes optional Yii2 support through an adapter widget.

```
use GeoPlot\Dataset;
use GeoPlot\Point;
use GeoPlot\Yii2\Plot as YiiPlot;

$dataset = Dataset::make('Hotels')
    ->style([
        'color' => '#2196f3',
        'size' => 7,
    ]);

foreach ($points as $point) {
    $hotel = Point::make($point->latitude, $point->longitude, $point->name);

    if ($point->isSelected) {
        $hotel->mark('#e53935', 10);
    }

    if (!empty($point->url)) {
        $hotel->url($point->url);
    }

    $dataset->add($hotel);
}

echo YiiPlot::widget([
    'datasets' => [$dataset],
    'height' => '600px',
    'maxZoom' => 5000,
]);
```

---

Example Output
--------------

[](#example-output)

GeoPlot renders an interactive plotting canvas where users can:

- Zoom in and out
- Pan the view
- Highlight selected locations

---

Features in Detail
------------------

[](#features-in-detail)

### Coordinate Plotting

[](#coordinate-plotting)

Plot thousands of latitude and longitude points efficiently.

### Interactive Navigation

[](#interactive-navigation)

- Mouse wheel zoom
- Drag to pan
- Adjustable zoom limits

### Marker Styling

[](#marker-styling)

Customize markers individually.

Examples include:

- Different colors
- Different sizes
- Labels
- Clickable point links

### Clickable Points

[](#clickable-points)

Add a URL to a point to open that link in a new tab when the marker is clicked.

```
$point = Point::make(28.6139, 77.2090, 'Delhi')
    ->url('https://example.com/delhi');
```

You can also pass URLs through point metadata:

```
$point = Point::make(28.6139, 77.2090, 'Delhi')
    ->meta(['url' => 'https://example.com/delhi']);
```

### City Center Detection

[](#city-center-detection)

GeoPlot can determine a representative city center based on the distribution of plotted coordinates.

This is particularly useful for:

- Hotel clusters
- Property listings
- Delivery hubs
- Tourist destinations

---

Configuration
-------------

[](#configuration)

GeoPlot allows customization of various rendering options, including:

- Canvas dimensions
- Zoom limits
- Marker colors
- Marker radius
- Labels

---

Typical Use Cases
-----------------

[](#typical-use-cases)

GeoPlot is suitable for applications such as:

- Hotel booking platforms
- Travel portals
- Property listing websites
- Logistics and fleet management
- Delivery routing
- Warehouse visualization
- Educational GIS projects
- Business location mapping

---

Roadmap
-------

[](#roadmap)

Future enhancements may include:

- Polygon support
- Polyline rendering
- Heatmap visualization
- Cluster rendering
- Distance measurement tools
- SVG export
- GeoJSON import/export
- Additional framework integrations

---

Contributing
------------

[](#contributing)

Contributions, feature requests, and bug reports are welcome.

Please open an issue before submitting significant changes to discuss the proposed implementation.

---

License
-------

[](#license)

GeoPlot is licensed under the MIT License.

See the LICENSE file for details.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance91

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 87.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

3

Last Release

45d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7496320?v=4)[Pankaj Salokhe](/maintainers/pankaj7590)[@pankaj7590](https://github.com/pankaj7590)

---

Top Contributors

[![pankajsalokhe](https://avatars.githubusercontent.com/u/133879657?v=4)](https://github.com/pankajsalokhe "pankajsalokhe (7 commits)")[![pankaj7590](https://avatars.githubusercontent.com/u/7496320?v=4)](https://github.com/pankaj7590 "pankaj7590 (1 commits)")

---

Tags

canvascomposergeographygislatitudelongitudemapsopen-sourcephpvisualizationyii2yii2mapscanvasgeographygislatitudelongitudevisualizationgeoplot

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pankaj7590-geoplot/health.svg)

```
[![Health](https://phpackages.com/badges/pankaj7590-geoplot/health.svg)](https://phpackages.com/packages/pankaj7590-geoplot)
```

###  Alternatives

[brick/geo

GIS geometry library

2501.5M25](/packages/brick-geo)[anthonymartin/geo-location

Powerful GeoCoding library: Retrieve bounding box coordinates, distances between geopoints, point in polygon, get longitude and latitude from addresses and more with GeoLocation for PHP

1881.0M12](/packages/anthonymartin-geo-location)[data-values/geo

Geographical value objects, parsers and formatters

17662.9k24](/packages/data-values-geo)[adlino/locations

Iran Provinces, Counties and Cities with a Google Map Location for Laravel.

171.3k](/packages/adlino-locations)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
