nucleos / maps-bundle
This bundle provides simple map rendering in symfony application.
Fund package maintenance!
core23
Opencollective
Ko-Fi
Other
Installs: 8 776
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 2
Open Issues: 7
Type:symfony-bundle
Requires
- php: ^8.1
- ext-json: *
- geocoder-php/common-http: ^4.2
- geocoder-php/provider-implementation: ^1.0
- psr/log: ^1.0 || ^2.0 || ^3.0
- sonata-project/block-bundle: ^4.21 || ^5.0
- sonata-project/form-extensions: ^1.4 || ^2.0
- symfony/config: ^6.4 || ^7.0
- symfony/dependency-injection: ^6.4 || ^7.0
- symfony/expression-language: ^6.4 || ^7.0
- symfony/form: ^6.4 || ^7.0
- symfony/framework-bundle: ^6.4 || ^7.0
- symfony/http-foundation: ^6.4 || ^7.0
- symfony/http-kernel: ^6.4 || ^7.0
- symfony/options-resolver: ^6.4 || ^7.0
- symfony/twig-bridge: ^6.4 || ^7.0
- twig/twig: ^2.4 || ^3.0
- willdurand/geocoder: ^4.2
- willdurand/geocoder-bundle: ^5.11
Requires (Dev)
- ergebnis/composer-normalize: ^2.0.1
- geocoder-php/nominatim-provider: ^5.0
- nyholm/psr7: ^1.0
- php-http/mock-client: ^1.3
- psr/simple-cache: ^2.0 || ^3.0
- symfony/browser-kit: ^6.4 || ^7.0
- symfony/cache: ^6.4 || ^7.0
- symfony/console: ^6.4 || ^7.0
- symfony/yaml: ^6.4 || ^7.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
- 3.5.x-dev
- 3.4.x-dev
- 3.4.0
- 3.3.x-dev
- 3.3.0
- 3.2.x-dev
- 3.2.0
- 3.1.x-dev
- 3.1.0
- 3.0.x-dev
- 3.0.0
- 2.3.x-dev
- 2.2.x-dev
- 2.2.0
- 2.1.x-dev
- 2.1.0
- 2.0.x-dev
- 2.0.0
- 1.1.0
- 1.0.0
- dev-renovate/major-phpstan-packages
- dev-renovate/phpunit-phpunit-11.x
- dev-renovate/matthiasnoback-symfony-dependency-injection-test-6.x
- dev-renovate/major-eslint-monorepo
- dev-readme-badge
This package is auto-updated.
Last update: 2024-11-12 05:46:43 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.