tags:

views:

281

answers:

1

I have a GMap2 object with a GOverviewMapControl and a GAdsManager, but they both appear in the lower right hand corner.

How can I get them to appear in different parts of the map?

Here's my Overview:

    map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.addControl(new GOverviewMapControl());
map.enableDoubleClickZoom();

here's my Ads

   var adsManagerOptions = {
    maxAdsOnMap: 2,
    style: 'adunit',
    channel: 'XXXXXXXXX'
};

adsManager = new GAdsManager(map, publisherID, adsManagerOptions);
adsManager.enable();
+1  A: 

The position property of the GAdsManagerOptions class will allow you to set the position of the GAdsManager. The options are passed in to the GAdsManager constructor.

Unfortunately, the GOverviewMapControl is not as flexible. According to the documentation, "Unlike other controls, you can only place this control in the bottom right corner of the map (G_ANCHOR_BOTTOM_RIGHT)."

I have no way to test this at the moment, but your options will probably look something like:

   var adsManagerOptions = {
    maxAdsOnMap: 2,
    style: 'adunit',
    channel: 'XXXXXXXXX',
    position: new GControlPosition(G_ANCHOR_BOTTOM_LEFT)
};
Andy West