PHP code example of cyberjaw / google-maps-bundle
1. Go to this page and download the library: Download cyberjaw/google-maps-bundle library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
cyberjaw / google-maps-bundle example snippets
// app/AppKernel.php
$bundles = array(
//...
new CyberJaw\GoogleMapsBundle\GoogleMapsBundle()
);
# app/config/config.yml
## Twig Configuration
twig:
form_themes:
- 'GoogleMapsBundle:Form:google_maps_layout.html.twig'
google_maps:
api_key: 'YOUR_API_KEY'
use CyberJaw\GoogleMapsBundle\Form\Type\GoogleMapsType;
$builder->add('googleMaps', GoogleMapsType::class);
class GoogleMaps
{
protected $latitude;
protected $longitude;
protected $city;
protected $address;
//Getters and Setters
}
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
)
//Symfony 2.8
php app/console assets:install
//Symfony 3.*
php bin/console assets:install