close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Directions To Here and From Here in info window

Thread began 4/28/2009 6:55 pm by dave.classick353712 | Last modified 11/08/2009 8:31 am by joe5828 | 4654 views | 8 replies |

dave.classick353712

Directions To Here and From Here in info window

Has anyone figured out how to implement "to here" and "from here" directions in the info window of a map created with ProMaps?

Sign in to reply to this post

alpine

I would imagine that you would need to add in some of the following in a custom infowindow (note that the address variable at the end would probably need to be your actual address or a recordset):

<p><b>Driving Directions</b><br>Enter your start address (street, town, postcode):<form action="http://maps.google.com/maps" method="get" target="_blank">' +
'<input type="text" size=40 maxlength=40 name="saddr" id="saddr" value="" /><br><br>' +
'<input value="Get Directions" type="submit">' +
'<input type="hidden" name="daddr" value="' + address + '"></p>

Sign in to reply to this post

Ray BorduinWebAssist

Yeah... there is an example in the prostores demo of directions to here... from here would be almost identical.

It was added manually after the map was created: AboutUs.php

Sign in to reply to this post

troyd

Ray,
This is exactly what I am looking for. I really like how this example has the form built into the information window. I've looked through all of my Pro Maps pdf files and do not find any reference to this. Do you have a link to some direction on creating this type of map?

Thanks,
TroyD

Sign in to reply to this post

Ray BorduinWebAssist

You can view the javascript source from that page to see how it was done. I couldn't find any references that talk about it.

Kind of complex to explain, but you could probably just apply promaps on your page, then hijack that code from the sample and replace your javascript code ... then just update the address.

Sign in to reply to this post

troyd

Thanks Ray,

I had been examining the javascript on that page. But I wasn't sure if it was acceptable practice for me to copy it. I do believe I understand what I need to do. If not, I will most likely post the page in progress and see if I can get you to look at it.

Thanks again,
TroyD

Sign in to reply to this post

stephenr.cohen388705

Which Code to Copy

I am not a php programmer and cannot identify which part of the powerstore-aboutus page code will add the ability of the user to input their address; nor which .js file to use and where in the file the code wold go. Can you be more specific? My site is skandertire.com/directions1.html. Thanks.
Steve

Sign in to reply to this post

Ray BorduinWebAssist

If you aren't a programmer I would copy and paste the entire javascript page and edit the address and API key from there. You won't be able to understand and add individual pieces if you don't understand script in general.

Sign in to reply to this post

joe5828

directions in info window

I have modified the code used to work with the pro maps directions method - it re-loads same page with directions included next to map

<?php do { ?>
var address_0_<?php echo $Recordset; ?> = {
street: '<?php echo str_replace("'", "\'", "".$row_Recordset['address0'] .""); ?>',
city: '<?php echo str_replace("'", "\'", "".$row_Recordset['address1'] .""); ?>',
state: '',
zip: '<?php echo str_replace("'", "\'", "".$row_Recordset['postcode'] .""); ?>',
country: 'UK',
infowindow: 'custom',
infowindowtext: '<span style="font: 10px Verdana, Arial, Helvetica, sans-serif; color: black;"><?php echo str_replace("'", "\'", "<strong>GP:</strong> ".$row_Recordset['firstname'] . " " .$row_Recordset['name'] ."<br>".$row_Recordset['email'] .""); ?></span>' +
'<p style="font: 10px Verdana, Arial, Helvetica, sans-serif; color: black;"><b>Distance & directions</b><br><form name="address" method="get">' +
'<label for="postcode">Your postcode:</label> <input type="text" size=10 maxlength=10 name="postcode" id="postcode" value="" />' +
'<input value="Go" type="submit">' +
'<input type="hidden" name="address" value="<?php echo $row_Recordset['postcode']; ?>"></p>',
full: '<?php echo str_replace("'", "\'", "".$row_Recordset['address0'] .""); ?>, <?php echo str_replace("'", "\'", "".$row_Recordset['address1'] .""); ?>, <?php echo str_replace("'", "\'", "".$row_Recordset['postcode'] .""); ?>, UK',
isdefault: false,
addressType: 'address',
loop: 'Recordset',
latitude: '<?php echo str_replace("'", "\'", "".$row_Recordset['grid_east_m'] .""); ?>',
longitude: '<?php echo str_replace("'", "\'", "".$row_Recordset['grid_north_m'] .""); ?>',
markerStyle: 'Google Traditional (flat)',
markerColor: 'Pacifica'
};

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...