egeloen / IvoryGoogleMapBundle

Google Map API v3 integration for your Symfony2 project.
https://github.com/egeloen/ivory-google-map
MIT License
217 stars 152 forks source link

You have requested a non-existent service "ivory_google_map.geocoder" #188

Closed snoop168 closed 7 years ago

snoop168 commented 7 years ago

When i try to run $geocoder = $this->get('ivory_google_map.geocoder'); i get the above error... I have also tried $geocoder = $this->get('ivory.google_map.geocoder'); but same problem. I am not sure what the correct name is supposed to be. The services/geocoder.xml file in the version I have seems to indicate that the first would be correct, but the documentation mentions the second. Thanks in advance. Not sure what I am missing.

egeloen commented 7 years ago

Hey @snoop168

According to your issue, you have installed the 2.x version of the bundle whearas the online doc is the 3.x one. I have added a note in dd1c42773fa74e08bd108bbcd489445b6bade195 in order to clarify it

snoop168 commented 7 years ago

@egeloen Not sure what I am doing wrong... I upgraded to "egeloen/google-map-bundle": "^3.0" and the line in my controller is $geocoder = $this->get('ivory.google_map.geocoder'); but still getting You have requested a non-existent service "ivory.google_map.geocoder"

I'm sure I'm missing something simple...

When I ran composer update this is what got installed:

  - Removing egeloen/json-builder (1.0.3)
  - Installing egeloen/json-builder (2.0.1)
    Downloading: 100%

  - Removing egeloen/google-map (1.4.1)
  - Installing egeloen/google-map (dev-master b366b3a)
    Cloning b366b3a3aa0a773009659e88bb94f4919aa018a0

  - Removing egeloen/google-map-bundle (2.2.1)
  - Installing egeloen/google-map-bundle (dev-master 6e417d1)
    Cloning 6e417d13939f492bdf700dd1b3c824f2ee3a4d66
egeloen commented 7 years ago

@snoop168 Have you configured an http client and a message factory in your configuration? See https://github.com/egeloen/IvoryGoogleMapBundle/blob/master/Resources/doc/service/geocoder.md#http-client-and-message-factory

By default, the geocoder service is not loaded if your don't configure it.

snoop168 commented 7 years ago

@egeloen That was it... I did that at one point in the past but I was getting errors related to the config so I must have removed it while troubleshooting... Thanks!