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

ClassNotFoundException: Attempted to load class "MapTypeIdHelper" from namespace "Ivory\GoogleMap\Helper" #99

Closed freiyer closed 10 years ago

freiyer commented 10 years ago

Hi, I'm trying to use the bundle but I'm getting this message :

ClassNotFoundException: Attempted to load class "MapTypeIdHelper" from namespace "Ivory\GoogleMap\Helper"

Any ideas ??

egeloen commented 10 years ago

I need a little bit more info to help you. AFAIR, the error should give your the exact line number & filename where the error occured. Can you copy/paste it?

freiyer commented 10 years ago

Here it is :

ClassNotFoundException: Attempted to load class "MapTypeIdHelper" from namespace "Ivory\GoogleMap\Helper" in C:\wamp\www...\app\cache\dev\appDevDebugProjectContainer.php line 2484. Do you need to "use" it from another namespace?

in C:\wamp\www...\app\cache\dev\appDevDebugProjectContainer.php line 2484 at ErrorHandler->handleFatalError(object(ExceptionHandler), array('type' => '1', 'message' => 'Class 'Ivory\GoogleMap\Helper\MapTypeIdHelper' not found', 'file' => 'C:\wamp\www...\app\cache\dev\appDevDebugProjectContainer.php', 'line' => '2484')) in C:\wamp\www...\vendor\symfony\symfony\src\Symfony\Component\Debug\ErrorHandler.php line 212 at ClassNotFoundFatalErrorHandler->handleError(array('type' => '1', 'message' => 'Class 'Ivory\GoogleMap\Helper\MapTypeIdHelper' not found', 'file' => 'C:\wamp\www...\app\cache\dev\appDevDebugProjectContainer.php', 'line' => '2484'), object(FatalErrorException)) in C:\wamp\www...\vendor\symfony\symfony\src\Symfony\Component\Debug\ErrorHandler.php line 238

Added this in my appkernel.php as it says in doc : new Ivory\GoogleMapBundle\IvoryGoogleMapBundle(),

Thanks for your answer btw :-)

egeloen commented 10 years ago

IMO, your issue is related on the fact you have installed the bundle without the library. How do you install it? from composer? Basically, this bundle simply integrates the library egeloen/ivory-google-map into Symfony2 and I just check the Ivory\GoogleMap\Helper\MapTypeIdHelper class exists.

freiyer commented 10 years ago

I did not install it with composer. I just downloaded it, put it in my bundle folder and give the path to appkernel.php. So I just need to install the egeloen/ivory-google-map library too ?

egeloen commented 10 years ago

Yep and autoload it obviously. That's all!

egeloen commented 10 years ago

@freiyer Does it fix your issue?

freiyer commented 10 years ago

I think Google map and Geocoder libraries works well now. No errors anymore but I've some difficulties now to use the bundle service.

Did a simple controller :

class GeolocalisationController extends Controller {

public function gmapAction() {

    $map = $this->get('ivory_google_map.map');

    return $this->render('Bundle:Geolocalisation:geoloc.html.twig', array(
        "map" => $map,
    ));
}

}

and the Twig render

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

But no map pops out yet.

freiyer commented 10 years ago

All right problem solve my map rendered well.

I'm working on a Symfony base CMS that makes things a bit thougher than expected.

But thank you very much for your help.