Git Product home page Git Product logo

geocoder-bundle's Introduction

Dlin Symfony Geocoder Bundle

Dlin Symfony Geocoder Bundle is wrapper bundle for dlin/geocoder library :

Dlin Symfony Geocoder Bundle provides a configurable service to work with geocoding


Version

0.9


Installation

Installation using Composer

Add to your composer.json:

json
{
    "require" :  {
        "dlin/geocoder-bundle": "dev-master"
    }
}

Enable the bundle in you AppKernel.php

public function registerBundles()
{
    $bundles = array(
    ...
    new Dlin\Bundle\GeocoderBundle\DlinGeocoderBundle(),
    ...
}

Configuration

You can specify multiple geocoding providers. For example:

#app/config/config.yml

dlin_geocoder:
    geocoder_service:
         Provider2:
			vendor: google
			weight: 19

		 Provider3:
			vendor: bing
			key: AvwNOuwxCZESwB9_p_RAHncR-oypS6UTsX5_g9u4Ejyt32G59_kKnvTSG3ySE3Q8
			weight: ~

	     Provider4:
			vendor: bing
			key: ApUmGCPD3VPcMRjlZUjVz1Z5uPHhlZYqA6Up9wvOVjQrYmJlygS3ftM87SHlIyx9
			weight: 5

For more information, please refere to the documentation of the dlin/geocoder library

Usage

Geting the service in a controller

$geocoder =  $this->get('dlin.geocoder_service');

Getting the service in a ContainerAwareService

$geocoder = $this->container->get('dlin.geocoder_service');

Using the method "foward"

$address = $geocoder->forward('1 Queen Street, Melbourne, Vic, AU');

Using the method "reverse"

$address = $geocoder->reverse("-33.86687", "151.19565");

The returned $address

$address = $geocoder->reverse("-33.86687", "151.19565");

print_r($address);

/* ========= out put ============

Dlin\Geocoder\GeoAddress Object
(
    [addressLine1] => 48 Pirrama Rd
    [addressLine2] =>
    [suburb] => Pyrmont
    [state] => NSW
    [postcode] => 2009
    [country] => Australia
    [latitude] => -33.86687
    [longitude] => 151.19565
    [partial] =>
    [formattedAddress] => 5/48 Pirrama Road, Pyrmont NSW 2009, Australia
    [geoCoding] => my bing
)

License

MIT

Free Software, Yeah!

geocoder-bundle's People

Watchers

 avatar  avatar

geocoder-bundle's Issues

error installing

I've copied and pasted the relevant code into my composer.json and AppKernel.php respectively.
When I do a composer update I get the following error.
my 'minimum-stability' = 'dev'

Problem 1
- The requested package dlin/geocoder-bundle could not be found in any version, there may be a typo in the package name.

Potential causes:

Read https://getcomposer.org/doc/articles/troubleshooting.md for further common problems.

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.