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

"google_map_container" does not exist #40

Closed yabadabadoodle closed 12 years ago

yabadabadoodle commented 12 years ago

Hi.

I have my own custom bundle (Mapper\GoogleMapBundle)

and have a default controller as follows:


namespace Mapper\GoogleMapBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Ivory\GoogleMapBundle\Model\MapTypeId;
use Ivory\GoogleMapBundle\IvoryGoogleMapBundle;

class DefaultController extends Controller
{
  public function loadAction()
  {
    $map = $this->get('ivory_google_map.map');
   //....configured as per the documentation...
   return $this->render('MapperGoogleMapBundle:Default:load.html.twig', array('map' => $map));
  }
}

and I have this in my twig file:

{{ google_map_container(map) }}
{{ google_map_js(map) }} 

and I get an error as follows:

The function "google_map_container" does not exist in MapperGoogleMapBundle:Default:load.html.twig at line 1
500 Internal Server Error - Twig_Error_Syntax

I'm scratching my head... I don't know what is going on!

I'm very new to symfony2.

Just testing out different stuff.

Please help. Much appreciated.

Thanks Momo Taro.

yabadabadoodle commented 12 years ago

SOLVED.

The following entry was missing from my AppKernel class:

new Ivory\GoogleMapBundle\IvoryGoogleMapBundle(),

Just wasted 3 days trying to find a solution! Finally it worked.

Thanks

PS Love the IvoryGoogleMapBundle!