looptribe/form-spatial

该包已被放弃且不再维护。没有建议的替代包。

为Symfony2表单提供Google Maps的空间支持

安装: 1,997

依赖: 0

建议者: 0

安全: 0

星标: 7

关注者: 5

分支: 5

开放问题: 0

类型:symfony-bundle

v0.0.3 2018-04-19 14:36 UTC

This package is not auto-updated.

Last update: 2023-09-30 12:41:44 UTC


README

为使用Google Maps的Symfony2表单提供空间支持。

Package version

该包是creof/doctrine2-spatial的Symfony2表单集成。它添加了一个新的表单类型point,用于通过Google Maps编辑空间Point类型。

安装

$ php composer.phar require looptribe/form-spatial dev-master
<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Looptribe\FormSpatialBundle\LooptribeFormSpatialBundle(),
        // ...
    );
}
# app/config/parameters.yml
parameters:
    looptribe.formspatial.google_maps_api_key: YOUR_API_KEY

使用

当您创建表单时,将Point字段类型设置为Looptribe\FormSpatialBundle\Form\Type\PointType

<?php
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            // ...
            ->add('location', Looptribe\FormSpatialBundle\Form\Type\PointType::class)
            // ...
        ;
    }

开发

目前仅支持地理Point类型。