2017 © Pedro Peláez
 

yii2-extension yii2-map-pick

Coordinates picker widget for Yii2.

image

nkizza/yii2-map-pick

Coordinates picker widget for Yii2.

  • Saturday, October 22, 2016
  • by nkizza
  • Repository
  • 2 Watchers
  • 1 Stars
  • 28 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Yii2 Map Picker based on Yandex.Maps

A map picker for latitude, longtitude and zoom attributes of the model. This widget uses (Yandex.Maps)[http://maps.yandex.ru] API. Fill three important location attributes with one click! Requires jQuery., (*1)

Installation

The preferred way to install this extension is through composer. Either run composer require nkizza/yii2-map-pick:~1.0 or add nkizza/yii2-map_pick:~1.0 to the require section of your application's composer.json file., (*2)

Usage

The widget provides three available values: latitude, longtitude and zoom. The complete definition of the field is:, (*3)

<?= MapPick::widget([
    ...
    'attributes' => [       //key - must be a "zoom", "lat" or "lon"
        'zoom' => [
            'name'=>'MapsCoords[zoom]', //input name (may be custom)
            'value'=>7,                 //initial value for input 
        ]
    ],
]);?>

You may define only needed attributes. Please refer to the following code to see the examples:, (*4)

<?= MapPick::widget([
    'model'=>$model,

    //html options for the container tag
    'options'=>[
        'style'=>'height:400px',
    ], 

    //model attributes 
    'attributes' => [
        'lat',                  //latitude (your model must have the 'lat' field)
        'lon'=>'longtitude',    // your model has the 'longtitude' field, place it under the key 'lon')
        'zoom' => [
            'name'=>'MapsCoords[customzoom]',   //custom input name for attribute (if needed)
            'value'=>7,                         //initial value for input 
        ]
    ],

    //custom js callback, is optional
    'callback' => 'function(lat, lon, zoom) {alert('Hello!');}',

    //language identifier 
    'language' => 'en_US', 
]);?>

The Versions

22/10 2016

dev-master

9999999-dev https://github.com/nkizza/yii2-map-pick

Coordinates picker widget for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

by Avatar nkizza

extension yii2 latitude yii maps yii 2 widget map yandex maps nkizza longtitude

22/10 2016

1.0.6

1.0.6.0 https://github.com/nkizza/yii2-map-pick

Coordinates picker widget for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

by Avatar nkizza

extension yii2 latitude yii maps yii 2 widget map yandex maps nkizza longtitude

22/10 2016

1.0.4

1.0.4.0 https://github.com/nkizza/yii2-map-pick

Coordinates picker widget for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

by Avatar nkizza

extension yii2 latitude yii maps yii 2 widget map yandex maps nkizza longtitude

22/10 2016

v1.0.1

1.0.1.0 https://github.com/nkizza/yii2-map-pick

Coordinates picker widget for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

by Avatar nkizza

extension yii2 latitude yii maps yii 2 widget map yandex maps nkizza longtitude