m0t0r / MyZend_Geolocation

ZF2 Google Maps Geolocation module with Doctrine/MongoDB documents

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MyZend / Geolocation

Version 0.9

Build status:

Build Status

Introduction

MyZend Geolocation is a ZF2 module to resolve an address using Google Maps API.

Uses MongoDB to save the locations.

You could add a reference of this objects from any of your entities.

/** @ODM\ReferenceOne(targetDocument="Geolocation\Document\Geolocation") */
protected $geolocation;

Examples

/**
* Basic usage
*/
$googleMapsHelper = new Geolocation\Document\GoogleMapsHelper($this->getServiceManager());
$googleMapsHelper->forwardSearch("La Rambla, s/n, Barcelona");
if ($googleMapsHelper->getStatus() == $googleMapsHelper::OK) {
	var_dump($googleMapsHelper->getGeoData());
}
/**
* Document resolve creation
*/
$geolocationHelper = new Geolocation\Document\GeolocationHelper($this->getServiceManager());
$geolocationDocument = $geolocationHelper->lookupGeolocation("Brixton Academy, London");

About

ZF2 Google Maps Geolocation module with Doctrine/MongoDB documents


Languages

Language:PHP 100.0%