aminkt/yii2-map-location-picker

该软件包最新版本(dev-master)没有提供许可证信息。

基于https://innostudio.de/fileuploader的控件,用于为yii2框架创建文件输入以上传文件

安装量: 1,185

依赖项: 0

建议者: 0

安全性: 0

星标: 2

关注者: 3

分支: 1

开放问题: 0

类型:yii2-extension

dev-master 2018-06-11 19:05 UTC

This package is auto-updated.

Last update: 2024-09-09 01:33:06 UTC


README

如何安装此模块

步骤1:将以下行添加到composer.json的require部分

"aminkt/yii2-map-location-picker": "@dev",

之后,在您的composer中运行以下命令

Composer update aminkt/yii2-map-location-picker

步骤2:在您的应用视图文件中添加以下行

echo LocationInput::widget([
    'apiKey' => 'Your api key',
    'name' => 'field name',
    'id' => 'field id',
    'options' => [
        // Input options
    ],
    'mapOptions' => [
        'center' => [
            'lat' => 37.4419,
            'lng' => -122.1419,
        ],
        'zoom' => 13,
        // Other google map options.
    ],
    'markerOptions' => [
        'draggable'=> true,
        // Other google map maker options.
    ],
    'disableLocationPicker' => 0, // Or 1 to define input become enabled or not to use just map view.
    'width' => '100%', // Map container width
    'height' => '200px', // Map container height
    'containerOptions' => [
        'class' => 'map-container' // Map container html options.
    ]
]);