cyberjaw/google-maps-bundle
Composer 安装命令:
composer require cyberjaw/google-maps-bundle
包简介
README 文档
README
Symfony bundle for use google maps in your form
Installation
This bundle is compatible with Symfony >= 2.8
composer require cyberjaw/google-maps-bundle
Getting Started
First register the bundle in your AppKernel.php
// app/AppKernel.php $bundles = array( //... new CyberJaw\GoogleMapsBundle\GoogleMapsBundle() );
To enable template and set your Google Maps API key, enter this to your config.yml.
# app/config/config.yml ## Twig Configuration twig: form_themes: - 'GoogleMapsBundle:Form:google_maps_layout.html.twig' google_maps: api_key: 'YOUR_API_KEY'
If your assets is not installed after installation run
//Symfony 2.8
php app/console assets:install
//Symfony 3.*
php bin/console assets:install
Usage
This bundle contains a new FormType called GoogleMapType which can be used in your forms like so:
Build form:
use CyberJaw\GoogleMapsBundle\Form\Type\GoogleMapsType; $builder->add('googleMaps', GoogleMapsType::class);
Entity property
class GoogleMaps { protected $latitude; protected $longitude; protected $city; protected $address; //Getters and Setters }
Options
array( 'type' => TextType::class, //Form type 'lat_type' => TextType::class, //Latitude form type 'lng_type' => TextType::class, //Longitude form type 'options' => [], //Form options 'lat_options' => [], //Latitude field options 'lng_options' => [], //Longitude field options 'city_options' => [], //City field options 'address_options' => [], //Address field options 'lat_name' => 'latitude', //Latitude field name 'lng_name' => 'longitude', //Longitude field name 'city_name' => 'city', //City field name 'address_name' => 'address', //Address field name 'map_width' => '100%', //Map box width 'map_height' => '400px', //Map box height 'default_lat' => '42.69', //Default latitude start 'default_lng' => '23.32', //Default longitude start 'city' => true, //City field status 'address' => true, //Address field status 'jquery' => true, //Enable/Disable jQuery 'map_template' => 'styled', //Enter template name (Options: false = default, 'night' = Night template, 'styled' = Styled map template) 'map_type' => 'terrain', //Set map type (Options: 'roadmap' and 'terrain') 'input_placeholder' => 'Enter location', //Set placeholder to search location input )
Features
- Getting only map
- Make custom map template
- Integrate another google maps api functions
- Added constraints
Authors
- Alexander Dimitrov - Initial work - cyberJaw
cyberjaw/google-maps-bundle 适用场景与选型建议
cyberjaw/google-maps-bundle 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 9.07k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2017 年 07 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 cyberjaw/google-maps-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 cyberjaw/google-maps-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 9.07k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-07-02