Download the PHP package alexpechkarev/google-maps without Composer

On this page you can find all versions of the php package alexpechkarev/google-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 google-maps

Collection of Google Maps API Web Services for Laravel

Provides a convenient way of setting up and making requests to Google Maps APIs from your Laravel application.

For services documentation, API key usage limits, and terms of service, please refer to the official Google Maps documentation:


Important Update: Routes API replaces Directions & Distance Matrix

The Google Maps Directions API and Distance Matrix API are deprecated.

This package now includes support for the new Google Maps Routes API, which is the recommended replacement for calculating routes and route matrices. The Routes API offers enhanced features and performance.

Please update your application code to use the routes and routematrix services provided by this package instead of the deprecated directions and distancematrix services.


Features

This package provides easy access to the following Google Maps APIs:


Dependency

API Deprecation Notes

In addition to the Directions and Distance Matrix deprecation mentioned above:

Places API:


Installation

Issue following command in console:

Configuration

Register Service Provider & Facade (in config/app.php):

Publish configuration file:

Add API Key: Open **config/googlemaps.php*** and add your Google Maps API key:

If you like to use different keys for any of the services, you can overwrite master API Key by specifying it in the service array for selected web service.

Usage

General Pattern: Load the desired service using \GoogleMaps::load('service-name'). Set parameters using setParam([...]) or setParamByKey('key', 'value'). Execute the request:

Example: Geocoding API (using get()):

By default, where appropriate, output parameter set to JSON. Don't forget to decode JSON string into PHP variable.

Example: Routes API - Compute Route (using fetch()):

Note: The Routes API uses the fetch() method and returns a PHP array directly (no JSON decoding needed). Note: The config for routes includes a decodePolyline parameter (default true), which adds a decodedPolyline key to the response if a polyline is present.

Example: Routes API - Compute Route Matrix (using fetch()):

Required parameters can be specified as an array of key:value pairs

Alternatively parameters can be set using setParamByKey() method. For deeply nested array use "dot" notation as per example below.

Available methods


load( $serviceName ) - load web service by name

Accepts string as parameter, web service name as specified in configuration file. Returns reference to it's self.


setEndpoint( $endpoint ) - set request output

Accepts string as parameter, json or xml, if omitted defaulted to json. Returns reference to it's self.


getEndpoint() - get current request output

Returns string.


setParamByKey( $key, $value ) - set request parameter using key:value pair

Accepts two parameters:

Deeply nested array can use 'dot' notation to assign value. Returns reference to it's self.


setParam( $parameters) - set all request parameters at once

Accepts array of parameters Returns reference to it's self.


This method is not Available for Routes API.

Returns web service response in the format specified by setEndpoint() method, if omitted defaulted to JSON. Use json_decode() to convert JSON string into PHP variable. See Processing Response for more details on parsing returning output.

Example with $key parameter


This method is ONLY available for Routes API. Note: config for routes included decodePolyline parameter, default true. If true it will attempts to decode the polilyne.encodedPolyline and add decodePolyline parameter to the response.

Returns an array web service response or thows an ErrorException. See Request Body for details.


isLocationOnEdge( $lat, $lng, $tolrance = 0.1 ) - To determine whether a point falls on or near a polyline, or on or near the edge of a polygon, pass the point, the polyline/polygon, and optionally a tolerance value in degrees.

This method only available with Google Maps Routes API.

Accepted parameter:


containsLocation( $lat, $lng ) -To find whether a given point falls within a polygon.

This method only available with Google Maps Routes API.

Accepted parameter:

Support

Please open an issue on GitHub

License

Collection of Google Maps API Web Services for Laravel is released under the MIT License. See the bundled LICENSE file for details.


All versions of google-maps with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version ^8.0|^9.0|^10.0|^11.0|^12.4
illuminate/config Version ^8.0|^9.0|^10.0|^11.0|^12.4
alexpechkarev/geometry-library Version ^1.0.5
ext-json Version *
ext-curl Version *
jbroadway/urlify Version ^1.2.4-stable
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 alexpechkarev/google-maps contains the following files

Loading the files please wait ....