Download the PHP package mkebza/google-maps-bundle without Composer
On this page you can find all versions of the php package mkebza/google-maps-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mkebza/google-maps-bundle
More information about mkebza/google-maps-bundle
Files in mkebza/google-maps-bundle
Package google-maps-bundle
Short Description Symfony bundle for some Google Maps functions
License MIT
Informations about the package google-maps-bundle
Installation
Applications that use Symfony Flex
Open a command console, enter your project directory and execute:
Applications that don't use Symfony Flex
Step 1: Download the Bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Step 2: Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles
in the app/AppKernel.php
file of your project:
Configuration
Bundle requires only one configuration, Google Map API key,
Features
Location embeddable
This bundle provides Location
(MKebza\GoogleMaps\Entity\Embeddable\Location
)
which can be used in your doctrine entiteis. This type provides as well shortcut
for creating markers getMarker(...)
Distance
For calculation you can use either MKebza\GoogleMaps\Service\DistanceCalculator
service
which uses Location object as its arguments or in your twig templates helper gmaps_distance(origin, destination)
.
Both returns MKebza\GoogleMaps\Service\Distance
, which hold information about duration / distance
and can convert basic units as well.
Static maps
Again there is service MKebza\GoogleMaps\Service\StaticMap
and twig helper gmaps_static
which
both have same set of arguments.
Parameters:
key
- Your google maps api key, automatically taken from configurationsize
- can be either300x300
or[300, 300]
formatcenter
- center point for your google mapzoom
- zoom levelscale
- density of pixelsformat
- required image format, default pngmaptype
- requested maptype, default roadmaplanguage
- requested language, default your app localemarkers
- array ofMKebza\GoogleMaps\Service\Marker
objects to display in the map
Markers
Markers can be created from options object or by itself, they function as factory with
methods fromLatitudeLongitude($lat, $long, $params)
and
fromName($name, $params)
.
Parameters:
size
- size of markercolor
- hex color, eg.333333
for graylabel
- One letter label for markericon
- URL to iconanchor
- anchor for icon
For more documentation look at https://developers.google.com/maps/documentation/maps-static/intro
Tests
Running tests is with vendor/bin/simple-phpunit
All versions of google-maps-bundle with dependencies
symfony/dependency-injection Version ~3.4|~4.0
symfony/config Version ~3.4|~4.0
guzzlehttp/guzzle Version ~6.0
symfony/cache Version ~3.4|~4.0
symfony/twig-bundle Version ~3.4|~4.0
symfony/options-resolver Version ~3.4|~4.0