Needs work
Project:
GMap Module
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Nov 2008 at 22:56 UTC
Updated:
25 Feb 2013 at 16:57 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
marshallsalinger commentedI 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.
Comment #2
mherchelI 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
Comment #3
Taiwan commentedI can't get mine to stop it form zooming either. http://www.huntingtonny.net
Comment #4
becw commentedThe nomousezoom option doesn't work because the line in gmap.js mentioned above should be checking
obj.vars.behavior.nomousezoominstead ofobj.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.
Comment #5
becw commentedHere's a patch with the same changes for the D5 branch.
Comment #6
Anonymous (not verified) commentedI 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.
Comment #7
bcobin commentedSame behavior confirmed here. Reverting...
Comment #8
becw commentedbdragon, 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)
Comment #9
becw commentedI 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.Comment #10
bcobin commentedActually, 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!
Comment #12
yesct commentedI think this is still an issue...
Comment #13
rares commentedsubscribing
Comment #14
vthirteen commentedwith 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:
i guess that the issue can be closed
Comment #15
yogo2000 commentedIt works !
Thanks a lot !
Comment #16
mcpuddin commentedI 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
Comment #17
becw commentedAs 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? :)
Comment #18
mcurry commentedsubscribe
Comment #19
webwriter commentedSubscribe
Comment #20
Anonymous (not verified) commentedSubscribe..
Comment #21
Exploratus commentedI still have this issue. Anyone figure it out?
Comment #22
jonhattanI confirm this is still an issue if specifying the behaviour in the settings page. Doing it from code works.
Comment #23
ITMonkey commentedI 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!
Comment #24
amariotti commentedJust 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.
Comment #25
Anonymous (not verified) commentedSubscribe
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.
Comment #26
lolmaus commentedComment #27
bdragon commentedApparently 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.
Comment #28
bdragon commentedFixed 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.)
Comment #29
lolmaus commentedYay!
Sorry, have no chance to test it soon. :(
Comment #31
bdragon commentedReopening. My followup commit ended up being bogus, as the gmap simpletests point out.
Comment #32
bdragon commentedReverted 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.
If $map['behavior'] is not set, it will inherit the default during the pre-theming checks anyway.
Comment #34
vectoroc commentedMacroses 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
Comment #36
podarokplease, provide patch against latest dev
Comment #37
podaroktests