PHPackages                             andrapratama/yii2-select-google-map-location - 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. andrapratama/yii2-select-google-map-location

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

andrapratama/yii2-select-google-map-location
============================================

Yii2 widget to select location at map and choose map coordinates

015JavaScript

Since Aug 3Pushed 2y agoCompare

[ Source](https://github.com/andrapratama/yii2-select-google-map-location)[ Packagist](https://packagist.org/packages/andrapratama/yii2-select-google-map-location)[ RSS](/packages/andrapratama-yii2-select-google-map-location/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

yii2-select-map-location
========================

[](#yii2-select-map-location)

Yii2 widget to select location at map and choose map coordinates

This extension adds functionality to select the location on the Google map. The extension indicates the model and attributes, which stores the address, latitude and longitude.

When choosing a location map of switches and sets the marker to the selected location. The attributes recorded address and coordinates of the selected location.

[![Latest Stable Version](https://camo.githubusercontent.com/d33873cac2d22f08fc486007e2001de4976c0ff3d1be98f5695bf1b8ee9ef54d/68747470733a2f2f706f7365722e707567782e6f72672f6b616c796162696e2f796969322d73656c6563742d676f6f676c652d6d61702d6c6f636174696f6e2f762f737461626c65)](https://packagist.org/packages/kalyabin/yii2-select-google-map-location)[![Total Downloads](https://camo.githubusercontent.com/0cfd91e469b55d1e35795a26c1da72d7753937631e6b90236b1eefa3081f0a4a/68747470733a2f2f706f7365722e707567782e6f72672f6b616c796162696e2f796969322d73656c6563742d676f6f676c652d6d61702d6c6f636174696f6e2f646f776e6c6f616473)](https://packagist.org/packages/kalyabin/yii2-select-google-map-location)[![Monthly Downloads](https://camo.githubusercontent.com/62a9c019129ffbaad79113ac6fadd898e4dc69380793c8545d2f4bdbf5474d15/68747470733a2f2f706f7365722e707567782e6f72672f6b616c796162696e2f796969322d73656c6563742d676f6f676c652d6d61702d6c6f636174696f6e2f642f6d6f6e74686c79)](https://packagist.org/packages/kalyabin/yii2-select-google-map-location)[![Latest Unstable Version](https://camo.githubusercontent.com/d5ce6d44ae631024a5678f96fec4c5c49e95ed0171e71a82afb914b4f35bff22/68747470733a2f2f706f7365722e707567782e6f72672f6b616c796162696e2f796969322d73656c6563742d676f6f676c652d6d61702d6c6f636174696f6e2f762f756e737461626c65)](https://packagist.org/packages/kalyabin/yii2-select-google-map-location)[![License](https://camo.githubusercontent.com/407e3794f11fc549ee7bb894b5eb7c0b585f075191d6606fe235a7476bf63a4c/68747470733a2f2f706f7365722e707567782e6f72672f6b616c796162696e2f796969322d73656c6563742d676f6f676c652d6d61702d6c6f636174696f6e2f6c6963656e7365)](https://packagist.org/packages/kalyabin/yii2-select-google-map-location)

Install
-------

[](#install)

Run at your console:

```
php composer.phar require "kalyabin/yii2-select-google-map-location" "*"
```

Register Google API
-------------------

[](#register-google-api)

First, register your Google API key as described: [Google API Documentation](https://developers.google.com/maps/documentation/javascript/get-api-key)

After this, enable at [Google console](https://console.developers.google.com/):

- Google Map JavaScript API (remember API key)
- Google Places API Web Service

Usage
-----

[](#usage)

Declare model class which will save geographic coordinates:

```
class SearchLocation extends \yii\base\Model
{
    ...
    public $address;
    public $longitude;
    public $latitude;
    ...
}
```

Render widget:

```
$model = new SearchLocation();
$form = \yii\widgets\ActiveForm::begin();
...
$form->field($model, 'address')->widget(\kalyabin\maplocation\SelectMapLocationWidget::className(), [
    'attributeLatitude' => 'latitude',
    'attributeLongitude' => 'longitude',
    'googleMapApiKey' => '',
]);
...
\yii\widgets\ActiveForm::end();
```

To use movable marker on the map describe draggable option:

```
$model = new SearchLocation();
$form = \yii\widgets\ActiveForm::begin();
...
$form->field($model, 'address')->widget(\kalyabin\maplocation\SelectMapLocationWidget::className(), [
    'attributeLatitude' => 'latitude',
    'attributeLongitude' => 'longitude',
    'googleMapApiKey' => '',
    'draggable' => true,
]);
...
\yii\widgets\ActiveForm::end();
```

To use custom field template use placeholder {map} for ActiveField:

```
$model = new SearchLocation();
$form = \yii\widgets\ActiveForm::begin();
...
$form->field($model, 'address', [
    'template' => '{label}{input}{map}{error}',
])->widget(\kalyabin\maplocation\SelectMapLocationWidget::className(), [
    'attributeLatitude' => 'latitude',
    'attributeLongitude' => 'longitude',
    'googleMapApiKey' => '',
]);
...
\yii\widgets\ActiveForm::end();
```

###  Health Score

14

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity19

Early-stage or recently created project

 Bus Factor1

Top contributor holds 63.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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/12824925?v=4)[Andra Satria Pratama](/maintainers/andrapratama)[@andrapratama](https://github.com/andrapratama)

---

Top Contributors

[![kalyabin](https://avatars.githubusercontent.com/u/5373014?v=4)](https://github.com/kalyabin "kalyabin (33 commits)")[![andrapratama](https://avatars.githubusercontent.com/u/12824925?v=4)](https://github.com/andrapratama "andrapratama (15 commits)")[![elfarqy](https://avatars.githubusercontent.com/u/5682478?v=4)](https://github.com/elfarqy "elfarqy (2 commits)")[![msvit1989](https://avatars.githubusercontent.com/u/22194397?v=4)](https://github.com/msvit1989 "msvit1989 (2 commits)")

### Embed Badge

![Health badge](/badges/andrapratama-yii2-select-google-map-location/health.svg)

```
[![Health](https://phpackages.com/badges/andrapratama-yii2-select-google-map-location/health.svg)](https://phpackages.com/packages/andrapratama-yii2-select-google-map-location)
```

###  Alternatives

[shayanys/lara-reserve

a package to do reservation

893.4k](/packages/shayanys-lara-reserve)[millipress/millirules

A declarative rule engine for PHP that turns complex conditional logic into readable when-then rules. Features a fluent builder API, lazy-loaded context for performance, smart operator inference, and works seamlessly in pure PHP or WordPress.

166.2k7](/packages/millipress-millirules)

PHPackages © 2026

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