nucleos / maps-bundle
This bundle provides simple map rendering in symfony application.
Fund package maintenance!
core23
Opencollective
Ko-Fi
Other
Installs: 1 451
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 1
Open Issues: 3
Type:symfony-bundle
Requires
- php: ^7.3
- geocoder-php/common-http: ^4.2
- geocoder-php/provider-implementation: ^1.0
- psr/log: ^1.0
- sonata-project/block-bundle: ^3.18 || ^4.0
- sonata-project/form-extensions: ^0.1 || ^1.4
- symfony/config: ^4.4 || ^5.0
- symfony/dependency-injection: ^4.4 || ^5.0
- symfony/expression-language: ^4.4 || ^5.0
- symfony/form: ^4.4 || ^5.0
- symfony/framework-bundle: ^4.4 || ^5.0
- symfony/http-foundation: ^4.4 || ^5.0
- symfony/http-kernel: ^4.4 || ^5.0
- symfony/options-resolver: ^4.4 || ^5.0
- symfony/twig-bridge: ^4.4 || ^5.0
- twig/twig: ^2.4 || ^3.0
- willdurand/geocoder: ^4.2
- willdurand/geocoder-bundle: ^5.11
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.2
- ergebnis/composer-normalize: ^2.0.1
- geocoder-php/nominatim-provider: ^5.0
- nyholm/psr7: ^1.0
- php-http/mock-client: ^1.3
- symfony/browser-kit: ^4.4 || ^5.0
Suggests
- geocoder-php/bing-maps-provider: For bing geocoder
- geocoder-php/google-maps-provider: For Google Maps geocoder
- geocoder-php/nominatim-provider: For OpenStreetMap geocoder
- 2.0.x-dev
- 1.1.0
- 1.0.0
- dev-dependabot/npm_and_yarn/assets/babel/eslint-parser-7.13.8
- dev-dependabot/npm_and_yarn/assets/babel/preset-env-7.13.8
- dev-dependabot/npm_and_yarn/assets/babel/plugin-transform-runtime-7.13.8
- dev-dependabot/npm_and_yarn/assets/babel/core-7.13.8
- dev-dependabot/npm_and_yarn/assets/eslint-7.21.0
- dev-dependabot/composer/vendor-bin/tools/phpstan/phpstan-0.12.80
- dev-dependabot/github_actions/shivammathur/setup-php-2.10.0
This package is auto-updated.
Last update: 2021-03-01 10:52:51 UTC
README
This bundle provides simple map rendering in symfony application.
Installation
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
composer require nucleos/maps-bundle
composer require geocoder-php/nominatim-provider # if you want OpenStreetMaps Geocoder
Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles in config/bundles.php
file of your project:
// config/bundles.php return [ // ... Nucleos\MapsBundle\NucleosMapsBundle::class => ['all' => true], ];
Configure the Bundle
Create a configuration file called nucleos_maps.yaml
and define geocoders:
# config/packages/nucleos_maps.yaml bazinga_geocoder: providers: nominatim: factory: Bazinga\GeocoderBundle\ProviderFactory\NominatimFactory cache: 'cache.geocoder' # PSR16 Cache pool cache_lifetime: 3600 cache_precision: 4 nucleos_maps: geocoder: service: 'bazinga_geocoder.provider.nominatim'
Usage
If you want dynamic address resultion:
{# template.twig #} {{ sonata_block_render({ 'type': 'nucleos_maps.block.map' }, { 'address': 'Hamburg', 'service': 'openstreetmap' }) }}
If you know the exact coordinates:
{# template.twig #} {{ sonata_block_render({ 'type': 'nucleos_maps.block.map' }, { 'longitude': '9.993682', 'latitude': '53.551086', 'service': 'openstreetmap' }) }}
Assets
The assets can be loaded via stimulus.
When using webpack-encore with enableStimulusBridge
everything is pre-configured for you.
License
This bundle is under the MIT license.