Download the PHP package mercynet/maps without Composer

On this page you can find all versions of the php package mercynet/maps. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package maps

=======

Maps

Maps is a PHP library designed to facilitate the integration and rendering of various map providers, such as Leaflet and Google Maps, in web applications. It adheres to SOLID principles, design patterns, and clean code practices, ensuring maintainability and scalability. The package allows developers to either use built-in views for map rendering or customize their own views by providing necessary data. It includes comprehensive tests using PestPHP to ensure reliability and correctness. The package is structured to be easily extendable, allowing the addition of more map providers in the future.

Installation

  1. Clone the repository:

  2. Install dependencies using Composer:

Configuration

Configure your map providers in src/config/maps.php:

Usage

Google Maps

To use Google Maps, ensure you have a valid API key. Add the API key to the GoogleMapConfig class:

`

Example view file for Google Maps (src/Providers/GoogleMaps/Views/map.php):

Leaflet

Example view file for Leaflet (src/Providers/Leaflet/Views/map.php):

Creating a Map Provider

You can create a map using the specific map class (e.g., LeafletMap):

`

Creating a Map Using Factory

You can create a map using the MapProviderFactory:

`

Rendering a Map

To render a map, use the render method of the map class:

`

Setting a Custom View

To set a custom view for rendering the map, use the setCustomView method:

`

Handling Exceptions

MapPackage provides custom exceptions to handle specific errors. Here are some examples:

Example of using exceptions:

`

Directory Structure

Testing

To run the tests, use PestPHP:

`

Extending the Package

To add support for a new map provider, implement the MapInterface interface:

`

Then, register the new provider with the MapProviderFactory using a configuration file or a service provider. Here is an example using a configuration file:

Configuration File

Create a configuration file config/map_providers.php:

`

License

This project is licensed under the MIT License. See the LICENSE file for more details.


All versions of maps with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
google/apiclient Version ^2.17
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mercynet/maps contains the following files

Loading the files please wait ....