Insert dynamic map in HTML

0

I would like to be able to insert a dynamic map in my application.

Right now what I have is a button, which takes me to google maps with the dynamic address I have, and the truth that works without problem

Example:

<a href="http://maps.google.com/?q=<?php echo $row['direccion']; ?>">Direccion: <?php echo $row['direccion']; ?></a>

What I want now is to create an inframe of google maps but that is dynamic too, I have trashed a bit and I have used something like that, but it does not work

<iframe src="https://www.google.com/maps/embed?pb=<?php $row['direccion']; ?>" width="600" height="450" frameborder="0" style="border:0" allowfullscreen></iframe>
    
asked by Tefef 30.04.2018 в 12:55
source

1 answer

1

Okay, my problem was that I did not do an echo as well Alvaro told me, I leave the complete code with the api for those who have the same doubt that I had:

<iframe width="600" height="450" frameborder="0" style="border:0"
src="https://www.google.com/maps/embed/v1/place?q=<?php echo $_POST['direccion']; ?>&key=MI_API_KEY" allowfullscreen></iframe>
    
answered by 30.04.2018 / 13:13
source