pavle/yii2-location-picker
最新稳定版本:v1.0
Composer 安装命令:
composer require pavle/yii2-location-picker
包简介
yii2 location picker
README 文档
README
yii2 location picker
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist pavle/yii2-location-picker "*"
or add
"pavle/yii2-location-picker": "*"
to the require section of your composer.json file.
Usage
Once the extension is installed, simply use it in your code by :
Location: <input type="text" id="us2-address" style="width: 200px"/> Radius: <input type="text" id="us2-radius"/> Lat.: <input type="text" id="us2-lat"/> Long.: <input type="text" id="us2-lon"/> <?= $form->field($model, 'coordinates')->widget(LocationPicker::className(), [ 'id' => 'input-coordinates', 'pattern' => '%longitude%,%latitude%', 'pluginOptions' => [ 'location' => [ 'latitude' => $model->getLatitude(), 'longitude' => $model->getLongitude(), ], 'inputBinding' => [ 'latitudeInput' => new JsExpression("$('#us2-lat')"), 'longitudeInput' => new JsExpression("$('#us2-lon')"), 'radiusInput' => new JsExpression("$('#us2-radius')"), 'locationNameInput' => new JsExpression("$('#us2-address')"), ], 'enableAutocomplete' => true, ], ]) ?>
统计信息
- 总下载量: 625
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-10-26