Giter Site home page Giter Site logo

nucleos / nucleosmapsbundle Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 2.0 3.65 MB

๐Ÿ“ This bundle provides simple map rendering in symfony application.

Home Page: https://nucleos.rocks

License: MIT License

JavaScript 22.70% PHP 69.70% Twig 3.55% SCSS 0.25% Makefile 3.80%
symfony symfony-bundle bundle php maps googlemaps openstreetmap sonata sonata-block hacktoberfest

nucleosmapsbundle's Introduction

NucleosMapsBundle

Latest Stable Version Latest Unstable Version License

Total Downloads Monthly Downloads Daily Downloads

Continuous Integration Code Coverage Type Coverage

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.

nucleosmapsbundle's People

Contributors

core23 avatar dependabot[bot] avatar kodiakhq[bot] avatar nucleos-bot avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

core23

nucleosmapsbundle's Issues

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Cannot find preset's package (github>nucleos/.github:renovate-config)

The map is not rendered after bundle configuration

Environment

Windows 10 with php 8.1

Packages

$ composer show --latest
# Put the result here.

$ composer show --latest
Info from https://repo.packagist.org: #StandWithUkraine
Color legend:

  • patch or minor release available - update recommended
  • major release available - update possible
  • up to date version
    behat/transliterator v1.3.0 v1.3.0 String transliterator
    clue/stream-filter v1.6.0 v1.6.0 A simple and modern approach to stream filtering in PHP
    craue/formflow-bundle 3.6.0 3.6.0 Multi-step forms for your Symfony project.
    doctrine/annotations 1.13.2 1.13.2 Docblock Annotations Parser
    doctrine/cache 2.1.1 2.1.1 PHP Doctrine Cache library is a popular cache implementatio...
    doctrine/collections 1.6.8 1.6.8 PHP Doctrine Collections library that adds additional funct...
    doctrine/common 3.2.2 3.2.2 PHP Doctrine Common project is a library that provides addi...
    doctrine/data-fixtures 1.5.2 1.5.2 Data Fixtures for all Doctrine Object Managers
    doctrine/dbal 3.3.3 3.3.3 Powerful PHP database abstraction layer (DBAL) with many fe...
    doctrine/deprecations v0.5.3 v0.5.3 A small layer on top of trigger_error(E_USER_DEPRECATED) or...
    doctrine/doctrine-bundle 2.5.7 2.5.7 Symfony DoctrineBundle
    doctrine/doctrine-fixtures-bundle 3.4.1 3.4.1 Symfony DoctrineFixturesBundle
    doctrine/doctrine-migrations-bundle 3.2.2 3.2.2 Symfony DoctrineMigrationsBundle
    doctrine/event-manager 1.1.1 1.1.1 The Doctrine Event Manager is a simple PHP event system tha...
    doctrine/inflector 2.0.4 2.0.4 PHP Doctrine Inflector is a small library that can perform ...
    doctrine/instantiator 1.4.1 1.4.1 A small, lightweight utility to instantiate objects in PHP ...
    doctrine/lexer 1.2.3 1.2.3 PHP Doctrine Lexer parser library that can be used in Top-D...
    doctrine/migrations 3.4.1 3.4.1 PHP Doctrine Migrations project offer additional functional...
    doctrine/orm 2.11.2 2.11.2 Object-Relational-Mapper for PHP
    doctrine/persistence 2.4.0 2.4.0 The Doctrine Persistence project is a set of shared interfa...
    doctrine/sql-formatter 1.1.2 1.1.2 a PHP SQL highlighting library
    easycorp/easyadmin-bundle v4.0.9 v3.5.21 Admin generator for Symfony applications
    fakerphp/faker v1.19.0 v1.19.0 Faker is a PHP library that generates fake data for you.
    friendsofphp/proxy-manager-lts v1.0.7 v1.0.7 Adding support for a wider range of PHP versions to ocramiu...
    gedmo/doctrine-extensions v3.6.0 v3.6.0 Doctrine2 behavioral extensions
    geocoder-php/common-http 4.4.0 4.4.0 Common files for HTTP based Geocoders
    geocoder-php/nominatim-provider 5.5.1 5.5.1 Geocoder Nominatim adapter
    geocoder-php/plugin 1.4.0 1.4.0 Plugins to Geocoder providers
    guzzlehttp/guzzle 7.4.1 7.4.1 Guzzle is a PHP HTTP client library
    guzzlehttp/promises 1.5.1 1.5.1 Guzzle promises library
    guzzlehttp/psr7 2.1.0 2.1.0 PSR-7 message implementation that also provides common util...
    jms/metadata 2.6.1 2.6.1 Class/method/property metadata management in PHP
    jms/serializer 3.17.1 3.17.1 Library for (de-)serializing data of any complexity; suppor...
    knplabs/knp-components v3.5.0 v3.5.0 Knplabs component library
    knplabs/knp-paginator-bundle v5.8.0 v5.8.0 Paginator bundle for Symfony to automate pagination and sim...
    knpuniversity/oauth2-client-bundle v2.10.0 v2.10.0 Integration with league/oauth2-client to provide services
    laminas/laminas-code 4.5.1 4.5.1 Extensions to the PHP Reflection API, static code scanning,...
    league/flysystem 3.0.12 2.4.3 File storage abstraction for PHP
    league/flysystem-bundle 2.2.0 2.2.0 Symfony bundle integrating Flysystem into Symfony 4.2+ appl...
    league/mime-type-detection 1.9.0 1.9.0 Mime-type detection for Flysystem
    league/oauth2-client 2.6.1 2.6.1 OAuth 2.0 Client Library
    league/oauth2-facebook 2.2.0 2.2.0 Facebook OAuth 2.0 Client Provider for The PHP League OAuth...
    league/oauth2-google 4.0.0 4.0.0 Google OAuth 2.0 Client Provider for The PHP League OAuth2-...
    monolog/monolog 2.4.0 2.4.0 Sends your logs to files, sockets, inboxes, databases and v...
    nikic/php-parser v4.13.2 v4.13.2 A PHP parser written in PHP
    nucleos/maps-bundle 3.0.0 2.0.0 This bundle provides simple map rendering in symfony applic...
    paragonie/random_compat v9.99.100 v9.99.100 PHP 5.x polyfill for random_bytes() and random_int() from P...
    php-http/discovery 1.14.1 1.14.1 Finds installed HTTPlug implementations and PSR-7 message f...
    php-http/httplug 2.3.0 2.3.0 HTTPlug, the HTTP client abstraction for PHP
    php-http/message 1.13.0 1.13.0 HTTP Message related tools
    php-http/message-factory v1.0.2 v1.0.2 Factory interfaces for PSR-7 HTTP Message
    php-http/promise 1.1.0 1.1.0 Promise used for asynchronous HTTP requests
    phpstan/phpdoc-parser 1.2.0 1.2.0 PHPDoc parser with support for nullable, intersection and g...
    psr/cache 2.0.0 1.0.1 Common interface for caching libraries
    psr/container 1.1.2 2.0.2 Common Container Interface (PHP FIG PSR-11)
    psr/event-dispatcher 1.0.0 1.0.0 Standard interfaces for event handling.
    psr/http-client 1.0.1 1.0.1 Common interface for HTTP clients
    psr/http-factory 1.0.1 1.0.1 Common interfaces for PSR-7 HTTP message factories
    psr/http-message 1.0.1 1.0.1 Common interface for HTTP messages
    psr/log 2.0.0 1.1.4 Common interface for logging libraries
    psr/simple-cache 1.0.1 1.0.1 Common interfaces for simple caching
    ralouphie/getallheaders 3.0.3 3.0.3 A polyfill for getallheaders.
    sensio/framework-extra-bundle v6.2.6 v6.2.6 This bundle provides a way to configure your controllers wi...
    sonata-project/block-bundle 4.11.0 4.11.0 Symfony SonataBlockBundle
    sonata-project/cache 2.2.0 2.2.0 Cache library
    sonata-project/doctrine-extensions 1.16.0 1.16.0 Doctrine2 behavioral extensions
    sonata-project/form-extensions 1.13.1 1.13.1 Symfony form extensions
    sonata-project/twig-extensions 1.9.1 1.9.1 Sonata twig extensions
    stof/doctrine-extensions-bundle v1.7.0 v1.7.0 Integration of the gedmo/doctrine-extensions with Symfony
    symfony/asset v5.4.3 v5.4.3 Manages URL generation and versioning of web assets such as...
    symfony/cache v5.4.6 v5.4.6 Provides an extended PSR-6, PSR-16 (and tags) implementation
    symfony/cache-contracts v2.5.0 v2.5.0 Generic abstractions related to caching
    symfony/config v5.4.3 v5.4.3 Helps you find, load, combine, autofill and validate config...
    symfony/console v5.4.5 v5.4.5 Eases the creation of beautiful and testable command line i...
    symfony/debug-bundle v5.4.3 v5.4.3 Provides a tight integration of the Symfony VarDumper compo...
    symfony/dependency-injection v5.4.6 v5.4.6 Allows you to standardize and centralize the way objects ar...
    symfony/deprecation-contracts v3.0.0 v2.5.0 A generic function and convention to trigger deprecation no...
    symfony/doctrine-bridge v5.4.6 v5.4.6 Provides integration for Doctrine with various Symfony comp...
    symfony/dotenv v5.4.5 v5.4.5 Registers environment variables from a .env file
    symfony/error-handler v5.4.3 v5.4.3 Provides tools to manage errors and ease debugging PHP code
    symfony/event-dispatcher v5.4.3 v5.4.3 Provides tools that allow your application components to co...
    symfony/event-dispatcher-contracts v3.0.0 v2.5.0 Generic abstractions related to dispatching event
    symfony/expression-language v5.4.3 v5.4.3 Provides an engine that can compile and evaluate expressions
    symfony/filesystem v5.4.6 v5.4.6 Provides basic utilities for the filesystem
    symfony/finder v5.4.3 v5.4.3 Finds files and directories via an intuitive fluent interface
    symfony/flex v2.1.6 v1.18.5 Composer plugin for Symfony
    symfony/form v5.4.5 v5.4.5 Allows to easily create, process and reuse HTML forms
    symfony/framework-bundle v5.4.6 v5.4.6 Provides a tight integration between Symfony components and...
    symfony/http-client v5.4.5 v5.4.5 Provides powerful methods to fetch HTTP resources synchrono...
    symfony/http-client-contracts v2.5.0 v2.5.0 Generic abstractions related to HTTP clients
    symfony/http-foundation v5.4.6 v5.4.6 Defines an object-oriented layer for the HTTP specification
    symfony/http-kernel v5.4.6 v5.4.6 Provides a structured process for converting a Request into...
    symfony/intl v5.4.5 v5.4.5 Provides a PHP replacement layer for the C intl extension t...
    symfony/maker-bundle v1.38.0 v1.38.0 Symfony Maker helps you create empty commands, controllers,...
    symfony/mime v5.4.3 v5.4.3 Allows manipulating MIME messages
    symfony/monolog-bridge v5.4.3 v5.4.3 Provides integration for Monolog with various Symfony compo...
    symfony/monolog-bundle v3.7.1 v3.7.1 Symfony MonologBundle
    symfony/options-resolver v5.4.3 v5.4.3 Provides an improved replacement for the array_replace PHP ...
    symfony/password-hasher v5.4.3 v5.4.3 Provides password hashing utilities
    symfony/polyfill-intl-grapheme v1.25.0 v1.25.0 Symfony polyfill for intl's grapheme_* functions
    symfony/polyfill-intl-icu v1.25.0 v1.25.0 Symfony polyfill for intl's ICU-related data and classes
    symfony/polyfill-intl-idn v1.25.0 v1.25.0 Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 fu...
    symfony/polyfill-intl-normalizer v1.25.0 v1.25.0 Symfony polyfill for intl's Normalizer class and related fu...
    symfony/polyfill-mbstring v1.25.0 v1.25.0 Symfony polyfill for the Mbstring extension
    symfony/polyfill-php73 v1.25.0 v1.25.0 Symfony polyfill backporting some PHP 7.3+ features to lowe...
    symfony/polyfill-php80 v1.25.0 v1.25.0 Symfony polyfill backporting some PHP 8.0+ features to lowe...
    symfony/polyfill-php81 v1.25.0 v1.25.0 Symfony polyfill backporting some PHP 8.1+ features to lowe...
    symfony/polyfill-uuid v1.25.0 v1.25.0 Symfony polyfill for uuid functions
    symfony/property-access v5.4.5 v5.4.5 Provides functions to read and write from/to an object or a...
    symfony/property-info v5.4.3 v5.4.3 Extracts information about PHP class' properties using meta...
    symfony/routing v5.4.3 v5.4.3 Maps an HTTP request to a set of configuration variables
    symfony/runtime v5.4.5 v5.4.5 Enables decoupling PHP applications from global state
    symfony/security-bundle v5.4.5 v5.4.5 Provides a tight integration of the Security component into...
    symfony/security-core v5.4.5 v5.4.5 Symfony Security Component - Core Library
    symfony/security-csrf v5.4.3 v5.4.3 Symfony Security Component - CSRF Library
    symfony/security-guard v5.4.3 v5.4.3 Symfony Security Component - Guard
    symfony/security-http v5.4.5 v5.4.5 Symfony Security Component - HTTP Integration
    symfony/service-contracts v2.4.1 v2.5.0 Generic abstractions related to writing services
    symfony/stopwatch v5.4.5 v5.4.5 Provides a way to profile code
    symfony/string v5.4.3 v5.4.3 Provides an object-oriented API to strings and deals with b...
    symfony/translation v5.4.6 v5.4.6 Provides tools to internationalize your application
    symfony/translation-contracts v2.5.0 v2.5.0 Generic abstractions related to translation
    symfony/twig-bridge v5.4.5 v5.4.5 Provides integration for Twig with various Symfony components
    symfony/twig-bundle v5.4.3 v5.4.3 Provides a tight integration of Twig into the Symfony full-...
    symfony/uid v5.4.3 v5.4.3 Provides an object-oriented API to generate and represent UIDs
    symfony/validator v5.4.6 v5.4.6 Provides tools to validate values
    symfony/var-dumper v5.4.6 v5.4.6 Provides mechanisms for walking through any arbitrary PHP v...
    symfony/var-exporter v5.4.6 v5.4.6 Allows exporting any serializable PHP data structure to pla...
    symfony/web-profiler-bundle v5.4.6 v5.4.6 Provides a development tool that gives detailed information...
    symfony/yaml v5.4.3 v5.4.3 Loads and dumps YAML files
    tetranz/select2entity-bundle v3.1.0 v3.1.0 A Symfony bundle that integrates Select2 as a drop-in repla...
    twig/twig v3.3.8 v3.3.8 Twig, the flexible, fast, and secure template language for PHP
    vich/uploader-bundle 1.19.0 1.19.0 Ease file uploads attached to entities
    willdurand/geocoder 4.5.0 4.5.0 Common files for PHP Geocoder
    willdurand/geocoder-bundle 5.16.1 5.16.1 Integration of Geocoder into Symfony

PHP version

$ php -v
# Put the result here.

$ php -v
PHP 7.4.23 (cli) (built: Aug 25 2021 09:35:48) ( NTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

Subject

Steps to reproduce

Just follow the Readme, install packages then configure bazinga_geocoder.yaml with :

# See the docs at https://github.com/geocoder-php/BazingaGeocoderBundle
bazinga_geocoder:
    # The local IP (127.0.0.1) will be replaced by the fake_ip
    # see https://github.com/geocoder-php/BazingaGeocoderBundle/blob/5.0.0/Resources/doc/index.md#fake-local-ip
    fake_ip: 123.123.123.123

    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'

Then try to render the map with

{{ sonata_block_render({ 'type': 'nucleos_maps.block.map' }, {
            'address': 'Hamburg',
            'service': 'openstreetmap'
        }) }}

Expected results

The map should be displayed.

Actual results

Nothing is displayed. I try to install stimulus (I don't know this library) with

<script type="module">
    import { Application, Controller } from "https://unpkg.com/@hotwired/stimulus/dist/stimulus.js"
    window.Stimulus = Application.start()

    Stimulus.register("hello", class extends Controller {
      static targets = [ "name" ]

      connect() {
      }
    })
  </script>

But same result, the map is not displayed.

Can you help me ? Thanks

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.


Warning

Renovate failed to look up the following dependencies: Failed to look up packagist package geocoder-php/provider-implementation.

Files affected: composer.json


Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

composer
composer.json
  • php ^8.1
  • 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
  • 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
vendor-bin/tools/composer.json
  • friendsofphp/php-cs-fixer ^3.3
  • maglnet/composer-require-checker ^4.0
  • matthiasnoback/symfony-dependency-injection-test ^5.0
  • phpmd/phpmd ^2.10
  • phpstan/extension-installer ^1.0
  • phpstan/phpstan ^1.0
  • phpstan/phpstan-doctrine ^1.0
  • phpstan/phpstan-phpunit ^1.0
  • phpstan/phpstan-strict-rules ^1.0
  • phpstan/phpstan-symfony ^1.0
  • phpunit/phpunit ^10.0
  • psalm/plugin-phpunit ^0.18
  • psalm/plugin-symfony ^5.0
  • symfony/phpunit-bridge ^7.0
  • vimeo/psalm ^5.0
github-actions
.github/workflows/assets.yml
  • actions/checkout v4.1.5
  • actions/setup-node v4.0.2
.github/workflows/automatic-release.yml
.github/workflows/continuous-integration.yml
npm
assets/package.json
  • leaflet ^1.7.1
  • leaflet-extra-markers ^1.1.0
  • @babel/cli ^7.17.10
  • @babel/core ^7.20.12
  • @babel/eslint-parser ^7.18.2
  • @babel/plugin-proposal-class-properties ^7.16.7
  • @babel/plugin-transform-runtime ^7.18.2
  • @babel/preset-env ^7.18.2
  • @hotwired/stimulus ^3.0.1
  • @size-limit/esbuild ^9.0.0
  • @size-limit/preset-small-lib ^9.0.0
  • @symfony/stimulus-testing ^2.0.1
  • eslint ^8.32.0
  • eslint-config-prettier ^9.0.0
  • eslint-plugin-import ^2.27.5
  • eslint-plugin-jest ^28.0.0
  • prettier ^3.0.0
  • sass ^1.57.1
  • sass-loader ^14.0.0
  • size-limit ^9.0.0
  • @hotwired/stimulus ^3.0.1

  • Check this box to trigger a request for Renovate to run again on this repository

PHP > 7.4 support

Feature Request

Seems to be that the php version is locked at 7 using ^7.3. Will be nice change that for >7.3 to provide support to php8

Make sonata optional, support twig components

Feature Request

Currently sonata/blocks-bundle is required. It seems that this could also be rendered as a twig ux component.

{{ sonata_block_render({ 'type': 'nucleos_maps.block.map' }, {
    'longitude': '9.993682',
    'latitude': '53.551086',
    'service': 'openstreetmap'
}) }}

<twig:nucleos_map :longitude="place.lng" :latitude="place.lat" service="openstreetmap" />

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.