박준영
박준영

Reputation: 11

gmap3 mouseover not working for infowindow

I tried following https://v6.gmap3.net/en/catalog/10-overlays/marker-41 but infowindow not working how should i do

    $('.map-object').gmap3({
        map: {
            options: {
                center:[46.578498,2.457275],
                zoom: 5
            }
        },
        marker:{
            values:[
                {latLng:[48.8620722, 2.352047], data:"Paris !"},
            ],
            options:{
                draggable: false
            },
            events:{
                mouseover: function(marker, event, context){
                    var map = $(this).gmap3("get"),
                    infowindow = $(this).gmap3({get:{name:"infowindow"}});
                    if (infowindow){
                        infowindow.open(map, marker);
                        infowindow.setContent(context.data);
                    } else {
                        $(this).gmap3({
                            infowindow:{
                                anchor:marker, 
                                options:{content: context.data}
                            }
                        });
                    }
                },
                mouseout: function(){
                    var infowindow = $(this).gmap3({get:{name:"infowindow"}});
                    if (infowindow){
                        infowindow.close();
                    }
                }
            }
        }
    });

There is a marker in France but the infowindow does not come out when I hover over it. Thanks for the help.

Upvotes: 1

Views: 33

Answers (0)

Related Questions