How To Select Wich Marker To Display On Egmap

Hello folks am new with yii

I just started to use Egmap for Yii and Im adding a groupe of marker (shopping centers, hospitals hotels etc) and I am wondering how to proceed to allow the user to select which marker he would like to display in the map (all, juste hospitals or just restaurans etc…)



        // ext is your protected.extensions folder

        // gmaps means the subfolder name under your protected.extensions folder




        $gMap = new EGMap();

        $gMap->zoom = 15;

        $gMap->setHeight (600);

        $gMap->setWidth (1138);




    $icon = new EGMapMarkerImage("/graphics/gmap/stores/mall.png");

    $icon_b = new EGMapMarkerImage("/graphics/gmap/Health_Education/hospital-building.png");

    $icon_c = new EGMapMarkerImage("/graphics/gmap/transportation/highway.png");

    $icon_d = new EGMapMarkerImage("/graphics/gmap/Restaurants_Bars_Hotels/hotel_0star.png");


        // Create marker

        $marker = new EGMapMarker(13.737510, 100.560485, array('title' => 'MALL','icon'=>$icon));




        $marker = new EGMapMarkerWithLabel(13.734938, 100.576620, array('title' => 'Hospital','icon'=>$icon_<img src='' class='bbc_emoticon' alt='B)' />);




        $marker = new EGMapMarkerWithLabel(13.742694, 100.550510, array('title' => 'EcpressWay','icon'=>$icon_c));




        $marker = new EGMapMarkerWithLabel(13.737639, 100.559360, array('title' => 'Hotel','icon'=>$icon_d));






        // enabling marker clusterer just for fun

        // to view it zoom-out the map

        $gMap->enableMarkerClusterer(new EGMapMarkerClusterer());





please any help would be much apreciated thank you


Just add the event to the egmap …follow below example

search for $gMap->addEvent(new EGMapEvent(‘click’,