i was sure i used to have these std pan/zoom controls on my maps; but they are no longer showing up: http://screencast.com/t/nXe2EemD

anyone know how to enable these?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

liquidcms’s picture

Title: how to enable pan/zoom controls » pan/zoom controls disapeared
Category: support » bug

no support help so i'll change to a bug as they were there and seemed to have disappeared; likely due to rel update.. but will check that next.

UziTech’s picture

Version: 7.x-2.x-dev » 7.x-2.7

Same issue only it seems controls randomly come and go.

I was setting some defaults for the gmap when I noticed the controls weren't there. Then I changed a couple other things and saved the configuration and the controls were there. Now I can refresh the page and about 1 in every 10 times I refresh the controls are there 9 out of 10 the controls are gone.

Any idea where to start looking for the bug?

bgprior’s picture

+1

bgprior’s picture

I think the explanation in my case was that I was also running the Device Geolocation module. It also uses the Google Maps API. I was getting a "you have included the Google Maps API multiple times on this page. This may cause unexpected errors" warning. Disabling the Device Geolocation module allowed the zoom controls to show up on the Google Map.

bgprior’s picture

It has started happening again (controls not visible). nomousezoom also doesn't work in gmap config, but does from macros.

I've tried installing the latest dev version. It doesn't help.

No showstopper js errors like last time. A few CSS gripes, but nothing that looks like it would cause it.

I had a look at the Maps API v3 documentation, and it looks like a lot of objects and functions have been renamed, mostly for additional control or functionality. There's no "controltype", which appears to be what the gmap code is still targeting.

Is this just a question of the gmap code still targeting a lot of API v2 calls?

hutch’s picture

A recent Google dev announcement has this:

The following Map options were deprecated a long time ago and are no
longer respected: navigationControl and navigationControlOptions.

These are still being implemented in gmap.js

They have been replaced by
zoomControl
zoomControlOptions
ZoomControlStyle

bgprior’s picture

Version: 7.x-2.7 » 7.x-2.8-beta1
FileSize
1.82 KB

Thanks. So all that's needed to get the zoom control back is to change gmap.js as per the attached diff? It worked for me.

Obviously, it would be nicer to take advantage of the more granular control in the new API, and choose which if any of zoom, pan and rotate controls are wanted, and in what style. But this works for me as a quick fix to get zoom back.

hutch’s picture

It's not quite as simple as that, the settings are now divided into two.

panControl: (true or false)

zoomControl: (true or false)

zoomControlOptions: {style: controltype}

where controltype is one of
google.maps.ZoomControlStyle.DEFAULT
google.maps.ZoomControlStyle.SMALL
google.maps.ZoomControlStyle.LARGE

hutch’s picture

Version: 7.x-2.8-beta1 » 7.x-2.x-dev
FileSize
2.3 KB

Here is a patch on current dev made in a fresh git clone.
Use patch -p1 < gmap-zoomcontrol-1851028.patch

It fixes the zoomControl and adds panControl

It also sets mapTypeControl to false if mtc is "none"

panControl could do with its own setting in gmap_settings_ui.inc

bgprior’s picture

Fantastic. Thanks. Hopefully can be built in to next release.

elshae’s picture

Version: 7.x-2.x-dev » 6.x-2.0-beta3

Hey I am using the D6 version 6.x-2.0-beta3 and I am having the same issue. Was the D6 version also affected by what was mentioned above? My understanding is that changes in the API brought this? Is there anyway in the macro to tell it to show pan/zoom? or am I forced to patch? Can I use this patch in D6?

Sorry for all of the questions, but I have been at it all day and I am thinking this post is on the money with what's going on with our end of things.

Thank you.

hutch’s picture

I made a fresh git clone of 6.x-2.x and copied the patch into the gmap folder, ran
patch -p1 < gmap-zoomcontrol-1851028.patch
Output was

patching file js/gmap.js
Hunk #2 succeeded at 331 (offset 1 line).

So it patched allright and it looks allright, I have no D6 rig to test it on but I would guess it will, on current dev of course.

elshae’s picture

Thank you for such a speedy response! I shall test in a dev enviro first :)

elshae’s picture

Just wanted to report that I used the patch on the latest 6.x-2.x-dev version and was very successful. Pan and zoom controls are back :).

Many thanks!

acrosman’s picture

The patch failed for me against 6.x-2.0-beta3, but succeeded against 6.x-2.x-dev (from May 14, 2013).

JKingsnorth’s picture

Title: pan/zoom controls disapeared » Pan/zoom controls disappeared
Version: 6.x-2.0-beta3 » 7.x-2.x-dev
Status: Active » Needs review

The patched in #9 worked great for me. So that's 2 positive reviews.

(I suppose the correct method is to get it patched in D7 and then look at the backport to D6?)

stefan.korn’s picture

Patch from #9 worked for me as well in D7 - Thanks a lot. I think this should be included in the dev and prod version soon, because I think it is a major issue for this great module.

JKingsnorth’s picture

Status: Needs review » Reviewed & tested by the community

That's 3 positives against the patch in #9, marking as RTBC.

podarok’s picture

Status: Reviewed & tested by the community » Fixed

#9 commited pushed to 7.x-2.x-dev
will be tagged in next upcoming release
Thanks!!!

kenorb’s picture

izmeez’s picture

Does this also need to be ported to 6.x-2.x-dev I don't see it in the commits there? Thanks.

JKingsnorth’s picture

Version: 7.x-2.x-dev » 6.x-2.x-dev
Status: Fixed » Patch (to be ported)

Setting as 'to be ported' then.

raprieto’s picture

#9 worked for me also.

Collins405’s picture

Perfect #9 worked a charm!

caktux’s picture

#9 works great with 6.x-2.x but it does need a setting for panControl

podarok’s picture

Status: Patch (to be ported) » Needs review

#9: gmap-zoomcontrol-1851028.patch queued for re-testing.

Wappie08’s picture

Thanks, #9 worked fine for me on 6.x-2.0-beta3 (patched by hand), so if patch is compatible with 6.x-2.x-dev it's RTBC.

Greets

hutch’s picture

Here is the same patch as in #9 but explicitly made on gmap 6.x-2.x-dev

dunx’s picture

Did the same as #27. All good.

I just need to get my markers back now.

podarok’s picture

Status: Needs review » Fixed

#28 commited pushed to 6.x-2.x-dev
Thanks!!!

brisath’s picture

Latest dev fixed the issue for me, thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

typo

afagioli’s picture

Status: Closed (fixed) » Needs review
afagioli’s picture

Always usefull check latest commits. gmap has: https://drupal.org/node/33591/commits

I had my pan/zoom reappeard with http://drupalcode.org/project/gmap.git/blob_plain/e196906:/js/gmap.js

thanks

Status: Needs review » Needs work

The last submitted patch, 28: gmap-zoomcontrol-D6-1851028.patch, failed testing.

crutch’s picture

#9 worked with 7.x-2.8

Dubs’s picture

Issue summary: View changes

+1 from me too. It would be good to get this committed to 7.

manikandan.btech’s picture

@hutch It's worked for me. Thank you very much.