PHPackages                             hector68/yii2-map-input-widget - 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. hector68/yii2-map-input-widget

ActiveYii2-extension

hector68/yii2-map-input-widget
==============================

Fork of Yii2 map input widget. Allows you to select geographcal coordinates via a human-friendly inteface.

v2.0.2(10y ago)11.7k31GNU GPL v3.0JavaScript

Since Feb 23Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Hector68/yii2-map-input-widget)[ Packagist](https://packagist.org/packages/hector68/yii2-map-input-widget)[ Docs](https://github.com/Hector68/yii2-map-input-widget)[ RSS](/packages/hector68-yii2-map-input-widget/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (10)Used By (1)

Yii2 map input widget
=====================

[](#yii2-map-input-widget)

Description
-----------

[](#description)

A [Yii2 input widget](http://www.yiiframework.com/doc-2.0/yii-widgets-inputwidget.html) which provides a user-friendly interface for selecting geographical coordinates via [Google maps](https://www.google.com/maps/preview). Allows users to select geographical coordinates by clicking on an interative Google map embedded into you web-page. Also allows users to type in a place name to search for it via Google Places API.

The widget is [composer](https://getcomposer.org/)-enabled. You can aquire the latest available version from the [packagist repository](https://packagist.org/packages/kolyunya/yii2-map-input-widget).

Demo
----

[](#demo)

A simple widget demo is available [here](http://kolyunya.github.io/yii2-map-input-widget/). You may inspect the hidden input value via some web-developer tool (e.g. [Firebug](https://addons.mozilla.org/ru/firefox/addon/firebug/)) to see how geographical coordinates are represented inside the widget.

Usage examples
--------------

[](#usage-examples)

### Minimal example

[](#minimal-example)

All widget parameters are optional, have some sensible default values and may not be configured.

```
echo $form->field($model, 'coordinates')->widget('kolyunya\yii2\widgets\MapInputWidget');
```

### Extended example

[](#extended-example)

An exhaustive list of widget parameters (which are not derived from [yii\\widgets\\InputWidget](http://www.yiiframework.com/doc-2.0/yii-widgets-inputwidget.html)) available for configuration is described in the following example.

```
echo $form->field($model, 'coordinates')->widget(
    'kolyunya\yii2\widgets\MapInputWidget',
    [

        // Google maps browser key.
        'key' => $key,

        // Initial map center latitude. Used only when the input has no value.
        // Otherwise the input value latitude will be used as map center.
        // Defaults to 0.
        'latitude' => 42,

        // Initial map center longitude. Used only when the input has no value.
        // Otherwise the input value longitude will be used as map center.
        // Defaults to 0.
        'longitude' => 42,

        // Initial map zoom.
        // Defaults to 0.
        'zoom' => 12,

        // Map container width.
        // Defaults to '100%'.
        'width' => '420px',

        // Map container height.
        // Defaults to '300px'.
        'height' => '420px',

        // Coordinates representation pattern. Will be use to construct a value of an actual input.
        // Will also be used to parse an input value to show the initial input value on the map.
        // You can use two macro-variables: '%latitude%' and '%longitude%'.
        // Defaults to '(%latitude%,%longitude%)'.
        'pattern' => '[%longitude%-%latitude%]',

        // Google map type. See official Google maps reference for details.
        // Defaults to 'roadmap'
        'mapType' => 'satellite',

        // Marker animation behavior defines if a marker should be animated on position change.
        // Defaults to false.
        'animateMarker' => true,

        // Map alignment behavior defines if a map should be centered when a marker is repositioned.
        // Defaults to true.
        'alignMapCenter' => false,

        // A flag which defines if a search bar should be rendered over the map.
        'enableSearchBar' => true,

    ]
);
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 67.3% 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 ~53 days

Recently: every ~89 days

Total

8

Last Release

3723d ago

Major Versions

v1.1.0 → v2.0.02016-01-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/97ca5a02b90c84b0381748d6cd1bc9fe65a5921ef826b836b504d095fe7d6a8d?d=identicon)[Hector68](/maintainers/Hector68)

---

Top Contributors

[![Kolyunya](https://avatars.githubusercontent.com/u/2682768?v=4)](https://github.com/Kolyunya "Kolyunya (33 commits)")[![Hector68](https://avatars.githubusercontent.com/u/920564?v=4)](https://github.com/Hector68 "Hector68 (8 commits)")[![almirb](https://avatars.githubusercontent.com/u/1752962?v=4)](https://github.com/almirb "almirb (7 commits)")[![maxxer](https://avatars.githubusercontent.com/u/240201?v=4)](https://github.com/maxxer "maxxer (1 commits)")

---

Tags

geocodingmapyii2extensionwidgetinputcoordinatesgeo-coordinates

### Embed Badge

![Health badge](/badges/hector68-yii2-map-input-widget/health.svg)

```
[![Health](https://phpackages.com/badges/hector68-yii2-map-input-widget/health.svg)](https://phpackages.com/packages/hector68-yii2-map-input-widget)
```

###  Alternatives

[kolyunya/yii2-map-input-widget

Yii2 map input widget. Allows you to select geographcal coordinates via a human-friendly inteface.

2836.3k4](/packages/kolyunya-yii2-map-input-widget)[kartik-v/yii2-widget-fileinput

An enhanced FileInput widget for Bootstrap 3.x, 4.x &amp; 5.x with file preview, multiple selection, and more features (sub repo split from yii2-widgets)

2286.8M95](/packages/kartik-v-yii2-widget-fileinput)[kartik-v/yii2-widget-rating

A Yii2 widget for the simple yet powerful bootstrap-star-rating plugin with fractional rating support (sub repo split from yii2-widgets)

444.1M8](/packages/kartik-v-yii2-widget-rating)[kartik-v/yii2-widget-switchinput

A Yii2 wrapper widget for the Bootstrap Switch plugin to use checkboxes &amp; radios as toggle switchinputes (sub repo split from yii2-widgets)

384.4M13](/packages/kartik-v-yii2-widget-switchinput)[kartik-v/yii2-widget-colorinput

An enhanced Yii 2 widget encapsulating the HTML 5 color input (sub repo split from yii2-widgets)

324.8M10](/packages/kartik-v-yii2-widget-colorinput)[kartik-v/yii2-widget-rangeinput

An enhanced Yii 2 widget encapsulating the HTML 5 range input (sub repo split from yii2-widgets)

193.9M3](/packages/kartik-v-yii2-widget-rangeinput)

PHPackages © 2026

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