Jump to content

google map shows when I put it there, but not if I put it there... ??


Recommended Posts

Ok,  I have a really basic php page set up to provide members of a profile system edit their details.  I'm trying to emplement a google map to show the zip code but if I put the div in the place I want it, it doesn't show.  First some code:

 

$map_insert_html='<div id="map_canvas" style="width:10%; height:10%"></div>';

 

This works :

<table width="100%" border="1">
<tr>
	<td width="10%" valign="top">
	<?php

		switch($member_status) {
			case 'main_admin':
				include("main_menu.php");
				break;
		}

	?>

	</td>
	<td valign="top">

		<?php
			if ($output_str!='') {
				echo $output_str .'<br />';
			}
			echo $detail_form_html;
        
		?>
	</td>
	<td>

	</td>

</tr>
</table>
<?php
echo $map_insert_html;
?>

 

And this doesn't :

 

<table width="100%" border="1">
<tr>
	<td width="10%" valign="top">
	<?php

		switch($member_status) {
			case 'main_admin':
				include("main_menu.php");
				break;

	}

	?>

	</td>
	<td valign="top">

		<?php
			if ($output_str!='') {
				echo $output_str .'<br />';
			}
			echo $detail_form_html.$map_insert_html;
        
		?>
	</td>
	<td>

	</td>

</tr>
</table>

 

Maybe the table covers it up?  I'm not sure what to look for, I don't know what the problem is!

 

Any help on this is very appreciated!

Thanks

Nick

Thanks for the fast reply!

 

I have already went over $detail_form_html a few times.  I will do so again.

 

If I reverse the lines

 

echo $map_insert_html;

echo '<br />';

echo $detail_form_html;

 

It still doesn't work.  If there was still a problem with $detail_form_html, wouldn't the map show?

 

Again, thanks for the prompt reply.  You make a good point and I will search over the code again!

 

Nick

It has something to do with the table re-sizing after the map is rendered.

 

[sOLVED]

changed

$map_insert_html='<div id="map_canvas" style="width:10%; height:10%"></div>';

to

$map_insert_html='<div id="map_canvas" style="width:100px; height:100px"></div>';

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.