Click here to Skip to main content
15,884,605 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to display google maps for current addresses, but unfortunately only a world map appears on the site.

The code:

<iframe src="<?php echo $data['post'] . ' ' . $data['city'] . ' ' . $data['street'] . ' ' . $data['number']; ?>&output=embed"></iframe>

What I have tried:

Looks like this in browser:

<iframe src=" Cityname Street name 1&output=embed"></iframe>

What might be the problem?
Updated 8-Mar-23 21:45pm

1 solution

If I feed it a valid address (such as my current location or Buckingham Palace) in place of your filler, it works with the iframe:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <meta name="generator" content="PSPad editor,">
        <iframe src=" Palace, London&output=embed"></iframe>
So start by checking your location is spelled correctly and describes an actual address.
Share this answer
István Balogh 9-Mar-23 3:48am    
The name of the street got changed, but they didn't update it on google maps, so it couldn't find the address, Thank you for your time!!
OriginalGriff 9-Mar-23 4:25am    
You're welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900