Jump to content

Recommended Posts

Posted

Hi all,

 

Have just realised that google maps doesn't work properly on my site due to a PNG workaround script I installed for IE. It seems to not work because of the copyright PNG image on the google map of all things. Anyway it seems there is no way around this so is there an alternative I can test out? Google maps was the only one I was aware of that I could use on my own site. Have looked an MSN but they don't appear to offer the same service.

 

Cheers

 

James

Posted

*Bump*

 

Does no-one know of any alternatives? I am supposed to be running a meeting with the governors tonight showing them the website, I'd ideally like some kind of interactive map, but i'm stuck for ideas. I'm pretty sure MSN does not offer the same service, at least I can't find anything that says they do.

Posted
Meh, I tried to get it done on time, but these things have quite a learning curve to them and the meeting with the governors was at 4pm. It just had to do without lol. They didn't notice anything so it's all well with me.
  • 2 weeks later...
Posted

Sorry Just joined and saw your comments. I would highly recommend windows live.

The aerial photos of the uk are 100x better than googles.

What were you trying to do with the maps?

Posted

With google maps, you can use an API key to incorporate their maps into your own website. You can use funky javascript to make the map appear over the location that you want when someone loads your webpage. It saves you having to create a hyperlink to maps.google.com/755575whatevergoeshere. It makes your site look better this way.

 

Unfortunately though, google maps does not work with my website. This is due to a unique script I installed for PNG images. The google copyright logo on the map in the bottom corner is a PNG image and it crashes the map.

 

Webmans was the only suggestion where I could actually find similar features to google, where you can actually incorporate the map into your site (I managed to find one for yahoo as well).

 

The problem I have is that it is going to take quite a long time to get the code correct (it did for the google maps and this code is different) and i'm not even sure it will work eventually for the same type of reason that googles' didn't work, so i'm reluctant to spend the time trying (I wish they were easier!). At the moment I just have a static image map on my contact page, which does the job but doesn't look as professional. At least I knew that was going to work though.

Posted

The site is *REMOVED* and the link to the google map (as I removed the link from the menu) is *REMOVED*

 

Thanks

(BTW it only doesn't work in IE as that is the browser the PNG image script was for)

Posted

OK mate this is what you need to do.

POST in the url the school address in the following format as seen in the link code here:

(Interactive Map)[/b]

 

This link will open the map.php page.

For this page i have done a hack the reads the lat and long off the google server from a postcode.

 

function geoCode($address) {
 $gaddress = "http://maps.google.com?q=" . urlencode($address);
   $handle = fopen($gaddress, "r");
  $contents = '';
    while (!feof($handle)) {
       $contents .= fread($handle, 8192);
   }
   fclose($handle);
  ereg('viewport: \{center: \{lat: ([0-9.-]{1,}),lng: ([0-9.-]{1,})', $contents, $regs);
   $returnData['lat'] = $regs[1];
   $returnData['lon'] = $regs[2];
   return $returnData;
}
if(isset($_GET['lat']) && isset($_GET['lon'])){
$lat = $_GET['lat'];
$lon = $_GET['lon'];
}else{
$returnData=geoCode($_GET['postcode']);
$lat = $returnData['lat'];
$lon = $returnData['lon'];
}
?>






Virtual Earth / Google Maps - Map
<br />
.clear {<br />
	clear:both;<br />
	height:1px;<br />
	line-height:1px;<br />
}<br />
#contact_back {<br />
	position: absolute;<br />
	width: 170px;<br />
	margin-top: 7px;<br />
	margin-left: 550px;<br />
	z-index: 1001;<br />
	background-color: #0040C4;<br />
	border: 1px solid #000000;<br />
	text-align: center;<br />
	height: 16px;<br />
	font-size: 1.1em;<br />
	text-decoration:none;<br />
	cursor:pointer;<br />
	cursor:pointer;<br />
}<br />
#contact_back a {<br />
	color:#000000;<br />
	text-decoration:none;<br />
<br />
}<br />
#contact_back a:hover {<br />
	color:#000000;<br />
	text-decoration:none;<br />
}<br />





<br />
	var map = null;<br />
	var pinID = 1;<br />
	<br />
	function GetMap(){<br />
		map = new VEMap('myMap');<br />
		map.LoadMap(new VELatLong(<?= $lat;?>, <?= $lon;?>), 12 ,'r' ,false);<br />
	}<br />
	function FindLoc(Loc){<br />
		map.FindLocation(Loc);<br />
	}<br />
	function GetInfo(){<br />
		alert('The top edge of the map on the Web page is at pixel: '+map.GetTop());<br />
		alert('The left edge of the map on the Web page is at pixel: '+map.GetLeft());<br />
		alert('The latitude,longitude at the center of the map is: '+map.GetCenter());<br />
		alert('The current zoom level of the map is: '+map.GetZoomLevel());<br />
		alert('The map control version is: '+VEMap.GetVersion());<br />
	}<br />
	function AddPin(){<br />
		var pin = new VEPushpin(<br />
							pinID,<br />
							map.GetCenter(),<br />
							"images/anchor_sm.jpg",//this is where you can use your own icon or pointer.<br />
							'<? echo (isset($_GET['name']) && $_GET['name']!="")?$_GET['name']:"";?>',<br />
							'<? echo (isset($_GET['address1']) && $_GET['address1']!="")?$_GET['address1']."<br />
":"";?><? echo (isset($_GET['address2']) && $_GET['address2']!="")?$_GET['address2']."<br />
":"";?><? echo (isset($_GET['town']) && $_GET['town']!="")?$_GET['town']."<br />
":"";?><? echo (isset($_GET['county']) && $_GET['county']!="")?$_GET['county']."<br />
":"";?><? echo (isset($_GET['postcode']) && $_GET['postcode']!="")?$_GET['postcode']."<br />
":"";?>'<br />
							);<br />
						map.AddPushpin(pin);<br />
						pinID++;				<br />
		}   <br />





 Contact Us  
 Interactive Map  : 

	< Back to contacts page 
       
	


        
	
	
	
	

 

Let me know how you get on. 8)

Posted

It looks about right to me.

 

Now the reason why i choose virtual earth over google is because of the birds eye view.

 

Go on click on it. See if you can see the school.

Posted
I'm gonna have to look for that CoffeyVille Municipal Airport. Maybe Birmingham Airport just down the road renamed themselves, hehe.
Posted

8O

I dont know tbh. Its the same as just going into google typing in your address and getting the lat & long from there and using it on your own system.

 

I hope not.

Posted
I can't get it to work anyway. Do you know what i did wrong? That map ends up on a remote location on the borders of Kansas and Oklahoma.
Posted

Hmm, dunno what happened with mine the first time lol.

 

You are right, the birds eye view looks quite amazing. I'll remove the little bits of text at the top and incorpororate it. As for using the google servers... i'll look into that and see what I can find.

 

The only other issue is the location it finds with the postcode... it finds a location about 100 metres to the right of the school, is there any easy fix for that?

Posted
To get the coords, go to Google maps UK, double-click where you want the map to centre on, and click 'Link to this page' at the top. The references will be in the resulting URL.
Posted

If you want too just use the lat and long co-ords then remove the top PHP script i wrote and look for the line:

map.LoadMap(new VELatLong(= $lat;?>, = $lon;?>), 12 ,'r' ,false);

and enter the co-ords in the respective places.

Posted
Thanks for that tip webman and thanks for the code plugged, that script will prove very useful. I'll probably add it to the site via an inline frame or external popup(I don't think there is any other way as I cannot easily edit code above the BODY tags of the pages of my site.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...