Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nucleos/nucleosmapsbundle
📍 This bundle provides simple map rendering in symfony application.
https://github.com/nucleos/nucleosmapsbundle
bundle googlemaps hacktoberfest maps openstreetmap php sonata sonata-block symfony symfony-bundle symfony-ux
Last synced: 3 months ago
JSON representation
📍 This bundle provides simple map rendering in symfony application.
- Host: GitHub
- URL: https://github.com/nucleos/nucleosmapsbundle
- Owner: nucleos
- License: mit
- Created: 2020-06-19T16:23:33.000Z (over 4 years ago)
- Default Branch: 3.5.x
- Last Pushed: 2024-08-14T18:59:09.000Z (5 months ago)
- Last Synced: 2024-09-30T17:23:18.232Z (3 months ago)
- Topics: bundle, googlemaps, hacktoberfest, maps, openstreetmap, php, sonata, sonata-block, symfony, symfony-bundle, symfony-ux
- Language: PHP
- Homepage: https://nucleos.rocks
- Size: 3.74 MB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
NucleosMapsBundle
=================
[![Latest Stable Version](https://poser.pugx.org/nucleos/maps-bundle/v/stable)](https://packagist.org/packages/nucleos/maps-bundle)
[![Latest Unstable Version](https://poser.pugx.org/nucleos/maps-bundle/v/unstable)](https://packagist.org/packages/nucleos/maps-bundle)
[![License](https://poser.pugx.org/nucleos/maps-bundle/license)](LICENSE.md)[![Total Downloads](https://poser.pugx.org/nucleos/maps-bundle/downloads)](https://packagist.org/packages/nucleos/maps-bundle)
[![Monthly Downloads](https://poser.pugx.org/nucleos/maps-bundle/d/monthly)](https://packagist.org/packages/nucleos/maps-bundle)
[![Daily Downloads](https://poser.pugx.org/nucleos/maps-bundle/d/daily)](https://packagist.org/packages/nucleos/maps-bundle)[![Continuous Integration](https://github.com/nucleos/NucleosMapsBundle/actions/workflows/continuous-integration.yml/badge.svg?event=push)](https://github.com/nucleos/NucleosMapsBundle/actions?query=workflow%3A"Continuous+Integration"+event%3Apush)
[![Code Coverage](https://codecov.io/gh/nucleos/NucleosMapsBundle/graph/badge.svg)](https://codecov.io/gh/nucleos/NucleosMapsBundle)
[![Type Coverage](https://shepherd.dev/github/nucleos/NucleosMapsBundle/coverage.svg)](https://shepherd.dev/github/nucleos/NucleosMapsBundle)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-bundlecomposer 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:
```php
// config/bundles.phpreturn [
// ...
Nucleos\MapsBundle\NucleosMapsBundle::class => ['all' => true],
];
```### Configure the Bundle
Create a configuration file called `nucleos_maps.yaml` and define geocoders:
```yaml
# config/packages/nucleos_maps.yamlbazinga_geocoder:
providers:
nominatim:
factory: Bazinga\GeocoderBundle\ProviderFactory\NominatimFactory
cache: 'cache.geocoder' # PSR16 Cache pool
cache_lifetime: 3600
cache_precision: 4nucleos_maps:
geocoder:
service: 'bazinga_geocoder.provider.nominatim'
```## Usage
If you want dynamic address resultion:
```twig
{# template.twig #}{{ sonata_block_render({ 'type': 'nucleos_maps.block.map' }, {
'address': 'Hamburg',
'service': 'openstreetmap'
}) }}
```If you know the exact coordinates:
```twig
{# 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](https://stimulusjs.org/).
When using [webpack-encore](https://github.com/symfony/webpack-encore) with `enableStimulusBridge` everything is pre-configured for you.## License
This bundle is under the [MIT license](LICENSE.md).