Drawing Control Off the Map?

194 views
Skip to first unread message

Garthan

unread,
Dec 8, 2011, 9:31:36 AM12/8/11
to google-map...@googlegroups.com
I would like to put the Drawing Controls in a Sidebar to the left or right of the map.... any ideas if that might be possible.

Marcelo

unread,
Dec 8, 2011, 10:20:22 AM12/8/11
to Google Maps JavaScript API v3
I've been looking for this too, and in general, I think that
google.maps.ControlPosition ought to have the same "offset" parameter
that GControlPosition used to have in V2.
A workaround I used is to create a small second map with blank tiles,
place that second map where I want the control to be, put the control
on that second map and coordinate things with the main map in the
event handlers. Not pretty, but it achieves the desired effect.

--
Marcelo - http://maps.forum.nu
--

Garthan

unread,
Dec 8, 2011, 11:00:15 AM12/8/11
to Google Maps JavaScript API v3
Ouch... nasty in this case I am specifically interested in the Drawing
Library so making it directly associated with the main map is pretty
necessary

On Dec 8, 9:20 am, Marcelo <marcelo...@hotmail.com> wrote:
> I've been looking for this too, and in general, I think that
> google.maps.ControlPosition ought to have the same "offset" parameter
> that GControlPosition used to have in V2.

If it is a custom control its pretty doable. but if you want the
navigation tool
or the Drawing tools from the recent libraray this is problematic.

If you could pass a parent html element that would also be nice.

> A workaround I used is to create a small second map with blank tiles,
> place that second map where I want the control to be, put the control
> on that second map and coordinate things with the main map in the
> event handlers. Not pretty, but it achieves the desired effect.
>
> --

> Marcelo -http://maps.forum.nu

Garthan

unread,
Dec 8, 2011, 4:22:35 PM12/8/11
to Google Maps JavaScript API v3
I have a technique basically you suppress the drawing Control
and build one of your own that calls setOptions on the manager
its kind of obvious now that I think about it...

Marcelo

unread,
Dec 8, 2011, 4:49:39 PM12/8/11
to Google Maps JavaScript API v3

Yes, I did something similar long ago in V2:
http://maps.forum.nu/temp/MEditControl.jpg
http://maps.forum.nu/temp/MEditControl2.jpg

The constructor for that editor accepts a parent node as parameter,
but I didn't mention it before because, as you say, it is obvious. :-)

chris marx

unread,
May 10, 2013, 9:16:55 PM5/10/13
to google-map...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages