nkizza/yii2-map-pick 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

nkizza/yii2-map-pick

Composer 安装命令:

composer require nkizza/yii2-map-pick

包简介

Coordinates picker widget for Yii2.

README 文档

README

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.

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.

Usage

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

<?= 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:

<?= 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', 
]);?>

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2016-10-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固