Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
I have Block with map location, that is visible withlocation node:
e.g node about the best beaches with Block map with beach location.
And on this map I can't see control about zoom (left, hight corner).
» Gmap location - Unable to add control to the "Location map" block
In the function gmap_location_block_view(), line 754 of gmap_location.module in the gmap-5.x-1.0-beta3 (and previous) the 'controltype' is overridden.
I commented out line 754: //$map['controltype'] = 'None';
I was then able to include the "controltype=Small" in the "Map Macro" setting of the "Location map" block.
There are other overridden properties in this function as well.
The above also works for me (thanks BeatnikDude) but, I'm unable to get the control to show for the map type, ie I'd like the user to be able to choose between Map, Hybrid and Satellite.
Comments
Comment #1
leobaby commentedI am having the same problem, and I am also unable to set the zoom. It's as if the macro has no effect.
Comment #2
UnicornSong commentedme too
I am using the gMap block, this is the macro:
If i change the width this effects the map ( so I know Im looking at the right macro ), however i cannot get the control to show!
subscribing...
Comment #3
o0_Enigma_0o commentedsubscribing...
Comment #4
beatnikdude commentedsubscribing... Can't get gmap zoom controls on the map block.
Comment #5
fiLi commentedSubscribing... (me too)
Comment #6
beatnikdude commentedIn the function gmap_location_block_view(), line 754 of gmap_location.module in the gmap-5.x-1.0-beta3 (and previous) the 'controltype' is overridden.
I commented out line 754:
//$map['controltype'] = 'None';I was then able to include the "controltype=Small" in the "Map Macro" setting of the "Location map" block.
There are other overridden properties in this function as well.
Comment #7
loko commentedBeatnikDude Thank You !!!
Work for me.
$map['controltype'] = 'None';I have in 721 line.Cheers for you.
Comment #8
Mysterious Britain commentedThe above also works for me (thanks BeatnikDude) but, I'm unable to get the control to show for the map type, ie I'd like the user to be able to choose between Map, Hybrid and Satellite.
Anyone know how to fix this?
Comment #9
najibx commentedyes, commented out line 754: //$map['controltype'] = 'None'; now shows the control.
also change $map['behavior']['autozoom'] = FALSE;
TRUE to FALSE to it take the zoom level stated in the block
Why that is uncommented/set to TRUE in the first place? causing setting in block being ignored?
Comment #10
bdragon commentedBecause I hadn't gotten around to fixing up the default macros and taking out my workarounds.
This should now work properly.
http://drupal.org/cvs?commit=140184
http://drupal.org/cvs?commit=140187
Comment #11
najibx commentedoic. I can confirm that this is working as expected. No need to tweak the codes. Just do modification at the block config.
thanks man !
Comment #12
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #13
user654 commented.
Comment #14
user654 commented.
Comment #15
kenorb commentedFollow-up: #1986108: Zoom (not Scale) Control not showing on map