PHP code example of msvdev / yii2-widget-mappicker

1. Go to this page and download the library: Download msvdev/yii2-widget-mappicker library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

msvdev / yii2-widget-mappicker example snippets


echo $form->field($model, 'coordinatesAttribute')->widget(\msvdev\widgets\mappicker\MapInput::className(), ['apiKey' => 'google_api_key']);

echo $form->field($model, 'coordinatesAttribute')->widget(\msvdev\widgets\mappicker\MapInput::className(), ['service' => 'yandex']);

use \msvdev\widgets\mappicker\MapInput;

echo $form->field($model, 'coordinatesAttribute')->widget(
    MapInput::className(), 
    [        
        'language' => 'en-Us', // map language, default is the same as in the app        
        'service' => 'google', // map service provider, "google" or "yandex", default "google"       
        'apiKey' => '', // // coordinates center map with an empty attribute, default Moscow        
    ]
);

$ php composer.phar