承接 fgh151/yii2-latlng-finder 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

fgh151/yii2-latlng-finder

Composer 安装命令:

composer require fgh151/yii2-latlng-finder

包简介

Find Latitude and Longitude using google maps

README 文档

README

Find Latitude and Longitude using Google Maps

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist fgh151/yii2-latlng-finder "dev-master"

or add

"fgh151/yii2-latlng-finder": "dev-master"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code mentioned below. Click once on the map to the get the marker and coordinates then you can drag the marker around to the desired place on the map.

  • Default usage
<div class="form-group">
    <label class="control-label" for="lat">Latitude</label>
    <input class="form-control" type="text" name="lat" id="lat">
</div>
<div class="form-group">
    <label class="control-label" for="lng">Longitude</label>
    <input class="form-control" type="text" name="lng" id="lng">
</div>
<div class="form-group">
    <label class="control-label" for="zoom">Zoom</label>
    <input class="form-control" type="text" name="zoom" id="zoom">
</div>

<?= \fgh151\latlngfinder\LatLngFinder::widget(); ?>
  • Default usage without Zoom Field
<div class="form-group">
    <label class="control-label" for="lat">Latitude</label>
    <input class="form-control" type="text" name="lat" id="lat">
</div>
<div class="form-group">
    <label class="control-label" for="lng">Longitude</label>
    <input class="form-control" type="text" name="lng" id="lng">
</div>

<?= \fgh151\latlngfinder\LatLngFinder::widget([
	'enableZoom' => false 			// true, false
]); ?>
  • Default usage with optional parameters
<div class="form-group">
    <label class="control-label" for="lat">Latitude</label>
    <input class="form-control" type="text" name="lat" id="lat">
</div>
<div class="form-group">
    <label class="control-label" for="lng">Longitude</label>
    <input class="form-control" type="text" name="lng" id="lng">
</div>
<div class="form-group">
    <label class="control-label" for="zoom">Zoom</label>
    <input class="form-control" type="text" name="zoom" id="zoom">
</div>

<?= \fgh151\latlngfinder\LatLngFinder::widget([
	'latAttribute' => 'lat',		// Latitude text field id
	'lngAttribute' => 'lng',		// Longitude text field id
	'zoomAttribute' => 'zoom',		// Zoom text field id
	'mapCanvasId' => 'map',			// Map Canvas id
	'mapWidth' => 450,				// Map Canvas width
	'mapHeight' => 300,				// Map Canvas mapHeight
	'defaultLat' => -34.397,		// Default latitude for the map
	'defaultLng' =>150.644,			// Default Longitude for the map
	'defaultZoom' => 8, 			// Default zoom for the map
	'enableZoomField' => true,		// True: for assigning zoom values to the zoom field, False: Do not assign zoom value to the zoom field
]); ?>
  • Default usage with model
<?= $form->field($model, 'lat') ?>
<?= $form->field($model, 'lng') ?>
<?= $form->field($model, 'zoom') ?>

<?= \fgh151\latlngfinder\LatLngFinder::widget([
    'model' => $model,				// model object
]); ?>
  • Default usage with model without zoom field
<?= $form->field($model, 'lat') ?>
<?= $form->field($model, 'lng') ?>

<?= \fgh151\latlngfinder\LatLngFinder::widget([
    'model' => $model,				// model object
    'enableZoom' => false 			// true, false
]); ?>
  • Default usage with model and optional parameters
<?= $form->field($model, 'lat') ?>
<?= $form->field($model, 'lng') ?>
<?= $form->field($model, 'zoom') ?>

<?= \fgh151\latlngfinder\LatLngFinder::widget([
	'model' => $model,				// model object
	'latAttribute' => 'lat',		// Latitude attribute
	'lngAttribute' => 'lng',		// Longitude attribute
	'zoomAttribute' => 'zoom',		// Zoom text attribute
	'mapCanvasId' => 'map',			// Map Canvas id
	'mapWidth' => 450,				// Map Canvas width
	'mapHeight' => 300,				// Map Canvas mapHeight
	'defaultLat' => -34.397,		// Default latitude for the map
	'defaultLng' =>150.644,			// Default Longitude for the map
	'defaultZoom' => 8, 			// Default zoom for the map
	'enableZoomField' => true,		// True: for assigning zoom values to the zoom field, False: Do not assign zoom value to the zoom field
]); ?>

Resources

统计信息

  • 总下载量: 52
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-01-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固