All Projects β†’ yidas β†’ google-maps-services-php

yidas / google-maps-services-php

Licence: MIT License
PHP client library(SDK) for Google Maps API Web Services

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to google-maps-services-php

laravel-5.3-app
πŸ—ΊοΈ Get started with Laravel 5.3, Vue.js and Google Maps API
Stars: ✭ 28 (-44%)
Mutual labels:  google-maps, google-maps-api
google-maps-statistics
Visualizing Geographic Statistical Data with Google Maps
Stars: ✭ 32 (-36%)
Mutual labels:  google-maps, google-maps-api
google maps
πŸ—Ί An unofficial Google Maps Platform client library for the Rust programming language.
Stars: ✭ 40 (-20%)
Mutual labels:  google-maps, google-maps-api
HealthCare-Scan-Nearby-Hospital-Locations
I developed this android application to help beginner developers to know how to use Google Maps API and how to convert JSON data into Java Object.
Stars: ✭ 23 (-54%)
Mutual labels:  google-maps, google-maps-api
Geolocator-2
Learn how to find and work with locations in Django, the Yelp API, and Google Maps api.
Stars: ✭ 24 (-52%)
Mutual labels:  google-maps, google-maps-api
Googleway
R Package for accessing and plotting Google Maps
Stars: ✭ 187 (+274%)
Mutual labels:  google-maps, google-maps-api
jquery-google-reviews
simple jquery Plugin that utilizes Google API to get data from a Place on Google Maps
Stars: ✭ 33 (-34%)
Mutual labels:  google-maps, google-maps-api
Magento2 Google Address Lookup
Provides an address lookup service on a Magento 2 store powered by the Google Places API
Stars: ✭ 46 (-8%)
Mutual labels:  google-maps, google-maps-api
project sunroof india
Analyzed Google Satellite images to generate a report on individual house rooftop's solar power potential
Stars: ✭ 74 (+48%)
Mutual labels:  google-maps, google-maps-api
ReaLocate
ASP.NET MVC 5 Real Estate Application
Stars: ✭ 18 (-64%)
Mutual labels:  google-maps, google-maps-api
Google Maps
Google Maps Web Services API wrapper for .NET
Stars: ✭ 171 (+242%)
Mutual labels:  google-maps, google-maps-api
IPRadar2
Real-time detection and defense against malicious network activity and policy violations (exploits, port-scanners, advertising, telemetry, state surveillance, etc.)
Stars: ✭ 20 (-60%)
Mutual labels:  google-maps, google-maps-api
Load Google Maps Api
🌏 A lightweight Promise-returning helper for loading the Google Maps JavaScript API
Stars: ✭ 166 (+232%)
Mutual labels:  google-maps, google-maps-api
Meteor Google Maps
πŸ—Ί Meteor package for the Google Maps Javascript API v3
Stars: ✭ 198 (+296%)
Mutual labels:  google-maps, google-maps-api
Bikedeboa
A (Progressive) Web App to find, map and review bike parkings in the cities of Brazil.
Stars: ✭ 54 (+8%)
Mutual labels:  google-maps, google-maps-api
GoogleMaps-CustomInfoWindow-Button
interactive custom InfoWindow for Google Maps
Stars: ✭ 14 (-72%)
Mutual labels:  google-maps, google-maps-api
React Native Maps Directions
Directions Component for `react-native-maps`
Stars: ✭ 846 (+1592%)
Mutual labels:  google-maps, google-maps-api
Maplace.js
A Google Maps Javascript plugin for jQuery.
Stars: ✭ 1,021 (+1942%)
Mutual labels:  google-maps, google-maps-api
qualtrics-map
Google Maps integration into Qualtrics.
Stars: ✭ 17 (-66%)
Mutual labels:  google-maps, google-maps-api
web-maps-wcag-evaluation
Manual accessibility evaluation of popular web map tools.
Stars: ✭ 28 (-44%)
Mutual labels:  google-maps, google-maps-api

Google Maps Services for PHP


PHP client library(SDK) for Google Maps API Web Services

Latest Stable Version License Total Downloads Monthly Downloads

OUTLINE


DEMONSTRATION

$gmaps = new \yidas\googleMaps\Client(['key'=>'Your API Key']);

// Geocoding an address
$geocodeResult = $gmaps->geocode('Taipei 101, Taipei City, Taiwan 110');

// Look up an address with reverse geocoding
$reverseGeocodeResult = $gmaps->reverseGeocode([25.0339639, 121.5644722]);

// Request directions via public transit
$directionsResult = $gmaps->directions('National Palace Museum', 'Taipei 101', [
    'mode' => "transit",
    'departure_time' => time(),
    ]);

DESCRIPTION

The PHP Client for Google Maps Services is a PHP Client library for the following Google Maps APIs:


REQUIREMENTS

This library requires the following:

  • PHP 5.4.0+|7.0+
  • guzzlehttp/guzzle 5.3.1+|6.0+
  • Google Maps API key or credential

API keys

Each Google Maps Web Service request requires an API key or client ID. API keys are freely available with a Google Account at https://developers.google.com/console. The type of API key you need is a Server key.

To get an API key:

  1. Visit https://developers.google.com/console and log in with a Google Account.
  2. Select one of your existing projects, or create a new project.
  3. Enable the API(s) you want to use. The Client for Google Maps Services accesses the following APIs:
    • Directions API
    • Distance Matrix API
    • Elevation API
    • Geocoding API
    • Geolocation API
    • Places API
    • Roads API
    • Time Zone API
  4. Create a new Server key.
  5. If you'd like to restrict requests to a specific IP address, do so now.

For guided help, follow the instructions for the Directions API. You only need one API key, but remember to enable all the APIs you need. For even more information, see the guide to [API keys][apikey].

Important: This key should be kept secret on your server.


INSTALLATION

Run Composer in your project:

composer require yidas/google-maps-services

Then you could call it after Composer is loaded depended on your PHP framework:

require __DIR__ . '/vendor/autoload.php';

use yidas\googleMaps\Client;

USAGE

Before using any Google Maps Services, first you need to create a Client with configuration, then use the client to access Google Maps Services.

Client

Create a Client using API key:

$gmaps = new \yidas\googleMaps\Client(['key'=>'Your API Key']);

Google Maps APIs Premium Plan license

If you use Google Maps APIs Premium Plan license instead of an API key, you could create Client using client ID and client secret (digital signature) for authentication.

$gmaps = new \yidas\googleMaps\Client([
    'clientID' => 'Your client ID', 
    'clientSecret' => 'Your digital signature'
    ]);

Language

You could set language for Client for all services:

$gmaps = new \yidas\googleMaps\Client(['key'=>'Your API Key', 'language'=>'zh-TW']);

Changing language during execution:

$gmaps->setLanguage('zh-TW');
// ...

Directions API

// Request directions via public transit
$directionsResult = $gmaps->directions('National Palace Museum', 'Taipei 101', [
    'mode' => "transit",
    'departure_time' => time(),
    ]);

Distance Matrix API

// Get the distance matrix data between two places
$distanceMatrixResult = $gmaps->distanceMatrix('National Palace Museum', 'Taipei 101');

// With Imperial units
$distanceMatrixResult = $gmaps->distanceMatrix('National Palace Museum', 'Taipei 101', [
    'units' => 'imperial',
    ]);

Elevation API

// Get elevation by locations parameter
$elevationResult = $gmaps->elevation([25.0339639, 121.5644722]);
$elevationResult = $gmaps->elevation('25.0339639, 121.5644722');

Geocoding API

// Geocoding an address
$geocodeResult = $gmaps->geocode('Taipei 101, Taipei City, Taiwan 110');

// Look up an address with reverse geocoding
$reverseGeocodeResult = $gmaps->reverseGeocode([25.0339639, 121.5644722]);

Geolocation API

// Simple geolocate
$geolocateResult = $gmaps->geolocate([]);

Time Zone API

// requests the time zone data for giving location
$timezoneResult = $gmaps->timezone([25.0339639, 121.5644722]);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].