Seemingly simple question/problem: How to specify the position of the control on GMap
I have a GMap display built with Views with the GMap Style option. I have the following macro in my style options settings: [gmap zoom=10 |width=800px |height=400px |control=Small |nomousezoom=true].
As well, all my GMap default settings (/admin/settings/gmap) are properly configured. Everything works great, and my GMap Views display works as intended. However, I have one simple request: to change the default position of the control from the top left anchor to bottom right.
I've tried every possible approach. Using hook_gmap, theme_gmap, and nothing worked.
I've also followed the documentation here
http://code.google.com/apis/maps/documentation/javascript/v2/controls.html#Control_Positioning
and included the following javascript function in my custom module according to the API documentation
//The id of the GMap generated by Views & GMap is "gmap-auto1map-gmap0"
drupal_add_js("$(document).ready(function() {
var map = Drupal.gmap.getMap('gmap-auto1map-gmap0');
var mapTypeControl = new GMapTypeControl();
var bottomRight = new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(10,10));
map.addControl(new GMapTypeControl(), bottomRight);
map.addControl(new GSmallMapControl());
});", 'inline');STILL haven't been able to figure this one out! Someone PLEASE shed some light on how to make this work. Simply moving the control from the default position to another position.
Note also that I would like the custom control position be specific to a single map only (in my case "gmap-auto1map-gmap0") and not target other GMaps (I have multiple GMaps across the site).
Comments
A suggestion
Hi,
I would post your issue in the contributed module, "gmap" issue queue.
....
Isn't your whole issue with gmap, not the Drupal API?
moved it to the issue queue.
moved it to the issue queue. thanks.