I am using Google Map v3 Shortcode Plugin
Each post would have its own Google Map already (for ex: [map address="New York, USA" z="15" marker=”yes” ])
I want my users to type in their location (or not) and get direction - which should cause it to create a new Google Map with the direction route.
So I wrote:
<form class="searchform" action="<?php the_permalink(); ?>" method="post" >
<input type="text" value="<?php echo $address; ?>" name="directions_search" class="field s">
<input type="submit" value="Get Directions" name="submit" class="submit button"> </form>
<?php if(isset($_POST['directions_search'])){
$address = htmlspecialchars($_POST['directions_search']); echo do_shortcode('[map address="Queens, New York" z="15" marker=”yes” start= "'. $address .'" end="New York, USA"]'); } ?>
The new Google Map with direction route doesn't appear - I think because 2 maps cannot exist at the same time. How can I get the new map to appear?
If input is blank, how do I get the Current Location of the user? (for ex: in CityGuide wp theme or in regular Google Map)
Thanks!