I have tried enabling and disabling this feature in the gmap admin, but the maps still zooms when using the mouse wheel. Any help is appreciated.

Comments

marshallsalinger’s picture

I ended up commenting out the API call in gmap.js.

if (!obj.vars.nomousezoom) {
//map.enableScrollWheelZoom();
}

But, the bug still stands as far as I know. I will look more into it later. Thanks.

mherchel’s picture

I ran into this issue, also, but it only seems to affect IE. I am using Drupal 5.14 and GMAP 5x-1.0

Commenting out that line solved my issue

Taiwan’s picture

I can't get mine to stop it form zooming either. http://www.huntingtonny.net

becw’s picture

Status: Active » Needs review
StatusFileSize
new1.33 KB

The nomousezoom option doesn't work because the line in gmap.js mentioned above should be checking obj.vars.behavior.nomousezoom instead of obj.vars.nomousezoom.

However a similar bug will pop up if you pass a map array with behaviors to theme_gmap(); in theme_gmap(), the behavior array in the $element['#settings'] will obliterate any default behaviors.

The attached patch fixes both these issues.

becw’s picture

StatusFileSize
new1.37 KB

Here's a patch with the same changes for the D5 branch.

Anonymous’s picture

I applied this patch and it does remove the width and height settings if you have a map defined in view as a block and put the size info as a gmap macro.

bcobin’s picture

Same behavior confirmed here. Reverting...

becw’s picture

StatusFileSize
new569 bytes
new556 bytes

bdragon, can we at least get the javascript fix in? that would solve the problem in 90% of cases...

(and I think it's the array_merge_recursive() change, not the js change, that is causing @phpcitizen and @bcobin's width/height setting issues)

becw’s picture

Assigned: Unassigned » becw
Status: Needs review » Fixed

I went ahead and committed the JS fix; the nomousezoom option on the gmap settings page should now behave as expected.

http://drupal.org/cvs?commit=168166
http://drupal.org/cvs?commit=168167

One thing to note is that any time you specify behaviors in a macro (like, [gmap behaviors=+autozoom]), you must specify ALL of the behaviors for that map; it will not inherit the default behaviors as set on the gmap settings page.

bcobin’s picture

Actually, the latest dev version (as of 2/6/09), although it includes the revised code, still doesn't fix the issue - had to comment out the API call.

Not the end of the world, but I thought I'd make a note of it - thanks!

Status: Fixed » Closed (fixed)

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

yesct’s picture

Status: Closed (fixed) » Postponed (maintainer needs more info)

I think this is still an issue...

rares’s picture

subscribing

vthirteen’s picture

Version: 6.x-1.x-dev » 6.x-1.1-rc1
Status: Postponed (maintainer needs more info) » Closed (fixed)

with the last version 6.x-1.1 i can definitely control the zoom on map created through views, set aside the control of general settings at admin/settings/gmap.

in the macro another control should be added:

behavior= +nomousezoom

i guess that the issue can be closed

yogo2000’s picture

It works !
Thanks a lot !

mcpuddin’s picture

StatusFileSize
new619 bytes

I still get this issue where the behaviors from the admin settings are not carried over to the map.

From what I can tell, when the array_merge happens, the gmap_defaults behaviors are overridden because behavior is a subarray. So I broke out behavior handling just like styles. I've included my changes in a patch if someone wants to review them / put them in to the project

becw’s picture

As mentioned in #9, when you specify any behaviors in a macro or custom gmap array, you need to specify all the behaviors you want. This is because of the design of the map array: behaviors are specified as an array of strings ('behavior_name') rather than key-value pairs ('behavior_name' => TRUE). With your patch (as with my patch in #4), it is impossible for any map to NOT use the default set of behaviors--macro and custom gmap array -generated maps could add behaviors, but not remove them.

I'll admit this is somewhat of a limitation, but it is a known part of the current functionality... er, should I say "little-known" there? :)

mcurry’s picture

subscribe

webwriter’s picture

Subscribe

Anonymous’s picture

Subscribe..

Exploratus’s picture

I still have this issue. Anyone figure it out?

jonhattan’s picture

Version: 6.x-1.1-rc1 » 6.x-1.x-dev
Status: Closed (fixed) » Needs work

I confirm this is still an issue if specifying the behaviour in the settings page. Doing it from code works.

ITMonkey’s picture

I am having the issue also, except in my case it seems that the nomousezoom option doesn't work at all, the mouse wheel still controls the zoom function even on the gmap settings screen.

It would appear that when I restored my database after moving my website to a new server the settings table copied across empty = I feel stupid!

amariotti’s picture

Just one thing to note. If you're needing to remove this behavior on your block then add what vthirteen mentioned in comment #14 above. Make sure to add a space before the +nomousezoom if there are other behaviors, otherwise it won't work.

I.E.

[gmap |width=100% |height=200px |control=None |behavior=+autozoom +notype +nomousezoom]
Anonymous’s picture

Subscribe

I am still having this problem, using the latest dev version (2010-Jun-13). Enabled nomousezoom on settings page, works when viewing pages, but not on edit page.

The fix in #1 worked for me.

lolmaus’s picture

Title: Nomousezoom option doesn't work » Nomousezoom option doesn't work: works when viewing pages, but not on edit page
bdragon’s picture

Title: Nomousezoom option doesn't work: works when viewing pages, but not on edit page » Behavior flags not inheriting from defaults properly in macros
Assigned: becw » bdragon
Status: Needs work » Needs review
StatusFileSize
new1.92 KB

Apparently I never implemented proper fallback to defaults on behavior flags when processing macros, so anything not defined by the macro would be false instead of default state.

The syntax of |behavior has supported -flag to turn off flags, and I had always assumed that it was working.

Anything not defined with |behavior was supposed to use the default state, but it was using (unset) instead.

I will be committing the following patch momentarily to all branches.

bdragon’s picture

Status: Needs review » Fixed

Fixed behavior defaulting in macros:

Behavior defaults support in macros:
http://drupal.org/cvs?commit=457660
http://drupal.org/cvs?commit=457662
http://drupal.org/cvs?commit=457664

Inherit default flags when behavior is not defined at all:
http://drupal.org/cvs?commit=457672
http://drupal.org/cvs?commit=457674
http://drupal.org/cvs?commit=457676

Another thing that I should probabaly do is strip out "off" flags for space reasons. However, that's something that should be done on the general level (map cleanup, etc) and as such is a separate task.

From now on, it should always consider |behavior to be a modification of the defaults as originally intended (which means that if your global nomousezoom is on, you should be able to take out +nomousezoom in macros if you want to.)

lolmaus’s picture

Yay!

Sorry, have no chance to test it soon. :(

Status: Fixed » Closed (fixed)

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

bdragon’s picture

Status: Closed (fixed) » Active

Reopening. My followup commit ended up being bogus, as the gmap simpletests point out.

bdragon’s picture

Status: Active » Fixed

Reverted http://drupal.org/cvs?commit=457672.
Reverted http://drupal.org/cvs?commit=457674.
Reverted http://drupal.org/cvs?commit=457676.

http://drupal.org/cvs?commit=480934
http://drupal.org/cvs?commit=480936
http://drupal.org/cvs?commit=480938

The macro should only pull in the behavior flags if the macro itself is twiddling them. If you array_merge() like so, you can still pull in the defaults.

$map = array_merge(gmap_defaults(), gmap_parse_macro($macro));
$map['behavior']['autozoom'] = TRUE;
unset ($map['behavior']['nomousezoom']);

If $map['behavior'] is not set, it will inherit the default during the pre-theming checks anyway.

Status: Fixed » Closed (fixed)

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

vectoroc’s picture

Status: Closed (fixed) » Needs review

Macroses allows to enable and to disable particular behavior (e.g. behavior=-autozoom +collapsehack)
I guess gmap module must apply defaults automatically.

For now I use hook_gmap to apply defaults

    case 'pre_theme_map':
      $defaults = gmap_defaults();
      $map['behavior'] += $defaults['behavior'];
podarok’s picture

Version: 6.x-1.x-dev » 7.x-2.x-dev
Assigned: bdragon » Unassigned
Status: Needs review » Needs work

please, provide patch against latest dev

podarok’s picture

Status: Needs work » Needs review

tests

Status: Needs review » Needs work

The last submitted patch, 337585.patch, failed testing.