views:

139

answers:

1

Hey, I just started using Google maps, and am having a problem. Adding overlays is working fine. If I add controls (zoom, left/right etc.), they are also working fine. But Googlemaps isn't allowing me to drag, even if I set map.enableDragging(). It also won't respond to any of my GEvent.addListeners. I've looked on other sites, and there's supposed to be a hand icon on mouseover to drag and click and such, and all I have is my pointer. Am I doing something wrong? Parts of my code:

The declaration of the map. EnableDragging is supposed to be default, and it's not even working when I call the function to set it to true.

 Boozemap.map = new GMap2( $('#map_mapholder').get(0));
 Boozemap.map.enableDragging();

The function to add a marker, which makes the marker show up, but not be interactive:

Boozemap.addBCMarker = function(lat, lng)
{
    var point = new GLatLng(lat, lng);
    var icon = new GIcon();

    icon.image = absoluteFilepath("images/fstar.png");
    icon.iconSize = new GSize(25, 25);
    icon.iconAnchor = new GPoint(140, 25);

    var bcmarker = new GMarker(point, icon);

    GEvent.addListener(bcmarker, 'click', function(){alert('clicked!')});

    Boozemap.map.addOverlay(bcmarker);
}

Any and all help would be lovely, thanks!

A: 

I figured it out, but it's kind of weird. The majority of my map was indeed getting covered, but it was getting covered by the copyright div that's built into the google API. I'm pretty sure I can fix it through CSS, but it seems strange that google would mess up like that, so I'm assuming I did something wrong. Is there a google maps API CSS that I'm supposed to include, or something?

Thanks to all those who helped.

Ethan
There isn't a API CSS to use, but if you have styles that apply to your map div, those styles will be inherited by map objects.
Chris B
yup, it was in my CSS reset. Thanks everyone!
Ethan