Can't use mouse to 'drag' map.

3,394 views
Skip to first unread message

Tim H

unread,
Sep 6, 2011, 6:23:02 PM9/6/11
to google-map...@googlegroups.com
Hi,

I have made a map which does everything I need it to, apart from allow me to move it by dragging with the cursor.
Could someone look at it and see what I have done wrong;

http://www.boatmap.info.

Thank you

Ralph

unread,
Sep 6, 2011, 9:55:01 PM9/6/11
to google-map...@googlegroups.com

>
> >>http://www.boatmap.info
Difficult to say why that's happening, there is a lot of javascript on
your page.

There is also duplicate calls for some scripts.

Might be a good idea to get the map working on a page of it's own and
then try to integrate it to your main page.

Ralph
>
>

Tim H

unread,
Sep 7, 2011, 6:39:51 AM9/7/11
to google-map...@googlegroups.com
Thanks for having a look Ralph.

Currently I can move the map using both the pan control & my arrow keys, but not the cursor?

I think I have found what is causing the error, but don't know how to fix it.

I have a number of adUnits linked to the map.
When I remove the code for these adunits it works fine, but when they are included the I cannot drag the map with the cursor.

The adUnits code I am using is;


var adUnit1Options = {
            format: google.maps.adsense.AdFormat.LEADERBOARD,
            publisherId: "pub-0171437280416273",
            channelNumber: "1017768028",     
            map: map,
            visible: true
            };
var adDiv = document.getElementById("sidebar1");
var adUnit = new google.maps.adsense.AdUnit(adDiv, adUnit1Options);


var adUnit2Options = {
            format: google.maps.adsense.AdFormat.LEADERBOARD,
            publisherId: "pub-0171437280416273",
            channelNumber: "0146614648",   
            map: map,
            visible: true
            };
var adDiv = document.getElementById("sidebar2");
var adUnit = new google.maps.adsense.AdUnit(adDiv, adUnit2Options);

var adUnit3Options = {
            format: google.maps.adsense.AdFormat.SKYSCRAPER,
            publisherId: "pub-0171437280416273",
            channelNumber: "9116349306",   
            map: map,
            visible: true
            };
var adDiv = document.getElementById("sidebar3");
var adUnit = new google.maps.adsense.AdUnit(adDiv, adUnit3Options);


Any help would be appreciated.

Thanks


xelawho

unread,
Sep 7, 2011, 9:31:44 AM9/7/11
to Google Maps JavaScript API v3
I'm guessing you've already tried to override the conflict by setting
mapOptions to map:draggable?

Tim H

unread,
Sep 7, 2011, 1:19:12 PM9/7/11
to google-map...@googlegroups.com
Tried - doesn't make any difference I'm afraid
Message has been deleted

xelawho

unread,
Sep 7, 2011, 2:49:31 PM9/7/11
to Google Maps JavaScript API v3
On Sep 7, 11:19 am, Tim H <ad...@boatmap.info> wrote:

> Tried - doesn't make any difference I'm afraid

I don't know much about adUnits, but I doubt you can use them like
that. They definitely seem to be breaking the map.

I would try giving them unique names and making all 3 global variables
Reply all
Reply to author
Forward
0 new messages