Show directions as text?

Jan 28, 2008 at 7:54 PM
Hey, I think that this project is one of the best that I have seen a a very long time. I have been looking for something like this for a very long time. I do have one question though. How would I go about actually showing the directions as text? Thanks.
Coordinator
Jan 28, 2008 at 8:39 PM
Hi, thanks. Please, check out Driving Directions Sample page.
Give me with more details about, if you don't find answer to your question there.
Regards
Jan 28, 2008 at 11:41 PM
Edited Jan 29, 2008 at 12:13 AM
Thanks for the response. Actually what I want is something that will show the diretions as text. For an example we can look at the google map:
http://maps.google.com/maps?f=d&hl=en&geocode=&saddr=Atlanta,+Fulton,+Georgia,+United+States&daddr=Savanah,+Ga&mra=pe&mrcr=0&sll=33.74813,-83.463947&sspn=1.045961,2.554321&ie=UTF8&ll=33.619194,-83.358765&spn=1.047519,2.554321&z=9&om=0
On the left hand side it shows the actual directions. On the right hand side it shows the map with the highlighted route. What I want is something like what is on the left hand side, showing the actual direction for the route.

Thanks
Coordinator
Jan 29, 2008 at 9:24 AM
Actually, if you take a better look at Driving Directions Sample page and read it, you'll find that there is RoutePanelId property of GoogleDirection and then there is div with id which maps that id and where the directions text will go.
And it is up to you where and how that div will be positioned to GoogleMap control in the example it is bellow, but you can place it left, right etc.
You can see the result on Online Demo Page , just look after (bellow) the GoogleMap control.

Here is the section from the page (the important text is made bold and italic):

  • Setting up google map driving directions service
In order to set up the driving directions service of the google map you have to add one or more GoogleDirection items under Directions collection.
Here is an exmple:
<artem:GoogleMap ID="GoogleMap2" runat="server" Zoom="15" Latitude="42.351505" Longitude="-71.094455"
    Key="ABQIAAAAyWjvj4t-s3JAHKCxqTvdRBRoUE3SabIoCOlXH37AOeIM5tsddhRFlUSAS7McYP97vBv9hxsuEq7lWw" Width="560px"
    Height="600px">
    <Directions>
        <artem:GoogleDirection RoutePanelId="route" Text="500 Memorial Drive, Cambridge, MA to Fenway Park, Boston, MA" />
    </Directions>
</artem:GoogleMap>
<div id="route">
</div>

Note the usage of div element with id under GoogleMap Control and the way it is used to set the RoutePanelId in the GoogleDirection item. It will be used by google maps api to render out the directions' route points. If you omit to set the RoutePanelId, route point will not be rendered out and you can omit to add a div on the page, as well.


So for your needs, to position route points text by the left side of GoogleMap control, it should looks something like:
<table>
    <tr>
        <td>
            <!-- The Route panel for route points text here -->
            <div id="routePanel"></div>
        </td>
        <td>
            <!-- GoogleMap control here -->
            <artem:GoogleMap ID="GoogleMap2" runat="server" Zoom="15" Latitude="42.351505" Longitude="-71.094455"
                Key="ABQIAAAAyWjvj4t-s3JAHKCxqTvdRBRoUE3SabIoCOlXH37AOeIM5tsddhRFlUSAS7McYP97vBv9hxsuEq7lWw" Width="560px"
                Height="600px">
                <Directions>
                    <artem:GoogleDirection RoutePanelId="routePanel" Text="500 Memorial Drive, Cambridge, MA to Fenway Park, Boston, MA" />
                </Directions>
            </artem:GoogleMap>
        </td>
    </tr>
</table>

Hope this helps ...
Velio