clicking on Direction Service Panel

155 views
Skip to first unread message

Subodh Shah

unread,
Oct 4, 2011, 8:20:38 AM10/4/11
to google-map...@googlegroups.com
Hi,
 
I need to disable clilcking on the direction service panel, which actually updates the map. Or in other words need to remove this connecting link between the map and the direction panel. Is there a way in acheiving this?
 
Any help is much appreciated,
 
Thanks.

BruceB

unread,
Oct 4, 2011, 9:41:08 AM10/4/11
to google-map...@googlegroups.com
You can just choose not to use the setPanel() method that's provided with the DirectionsRenderer, and simply inspect the DirectionsResult object to display the textual directions however you like.

(linked from here).
And then this section of the documentation explain how to examine the DirectionsResult, so you can display them however you like (i.e. event handlers not linked to the map): http://code.google.com/apis/maps/documentation/javascript/services.html#InspectingResults

Subodh Shah

unread,
Oct 6, 2011, 2:03:24 AM10/6/11
to google-map...@googlegroups.com
Hi,
 
Thanks for the response. What I was looking for a simple configurable way for it, rather than again redoing the same what google provides.
 
Thanks for your help.
Subodh

330.png

Tyler

unread,
Oct 21, 2011, 12:03:07 PM10/21/11
to Google Maps JavaScript API v3
I needed to do the same thing without wanting to rewriting what Google
provides. Here's how I accomplished it:

<div id="directions-panel">
<div id="directions-panel-cover"></div>
</div>

div#directions-panel is what I set as the panel in my
DirectionsRenderer.

Here's the relevant CSS:
#directions-panel {
position: relative;
}

#directions-panel-cover {
position: absolute;
width: 100%;
height: 100%;
}

Essentially this creates an empty, transparent div that sits on top of
the directions panel div, so it blocks any mouse inputs. You may need
to tweak the element order or z-index values, depending on your
markup.

Tyler


On Oct 6, 1:03 am, Subodh Shah <subodh9...@gmail.com> wrote:
> Hi,
>
> Thanks for the response. What I was looking for a simple configurable
> way for it, rather than again redoing the same what google provides. [?]
>
> Thanks for your help.
> Subodh
>
>  330.png
> < 1KViewDownload
Reply all
Reply to author
Forward
0 new messages