_Bat_ Posted February 12, 2007 Posted February 12, 2007 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
_Bat_ Posted February 19, 2007 Author Posted February 19, 2007 *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.
timbo343 Posted February 19, 2007 Posted February 19, 2007 http://www.live.com have got their own alternative. Just like google tho.
_Bat_ Posted February 19, 2007 Author Posted February 19, 2007 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.
plugged_in Posted February 28, 2007 Posted February 28, 2007 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?
plugged_in Posted February 28, 2007 Posted February 28, 2007 Hey if you want something really fun check this out then. http://www.isoma.net/games/goggles.html bewarned its addictive!!
_Bat_ Posted February 28, 2007 Author Posted February 28, 2007 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.
plugged_in Posted February 28, 2007 Posted February 28, 2007 Hi James, Whats the url of your website and i will get a look for you mate. kind regards Plugged_in
_Bat_ Posted February 28, 2007 Author Posted February 28, 2007 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)
plugged_in Posted February 28, 2007 Posted February 28, 2007 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)
_Bat_ Posted February 28, 2007 Author Posted February 28, 2007 I think I got that right... maybe I misunderstood you though.
plugged_in Posted February 28, 2007 Posted February 28, 2007 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.
plugged_in Posted February 28, 2007 Posted February 28, 2007 the other quick think in the code for the javascript you will see i have made a comment about the pin. Should be self explanatory.
_Bat_ Posted February 28, 2007 Author Posted February 28, 2007 I'm gonna have to look for that CoffeyVille Municipal Airport. Maybe Birmingham Airport just down the road renamed themselves, hehe.
webman Posted February 28, 2007 Posted February 28, 2007 Isn't geocode lookup using that method against Google TOS?
plugged_in Posted February 28, 2007 Posted February 28, 2007 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.
_Bat_ Posted February 28, 2007 Author Posted February 28, 2007 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.
plugged_in Posted February 28, 2007 Posted February 28, 2007 eh? i have just looked at the link and it works fine. i can see you are beside yardley park. Clear your cache and try it IE >> tools >> options >> delete files. This is the link i used and it comes up in IE7 and Firefox. http://www.theovalprimary.co.uk/maps/map.php?name=The%20Oval%20Primary%20School&address1=Whittington%20Oval&address2=&town=Birmingham&county=West%20Midlands&postcode=B33%208JG
_Bat_ Posted February 28, 2007 Author Posted February 28, 2007 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?
webman Posted February 28, 2007 Posted February 28, 2007 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.
plugged_in Posted February 28, 2007 Posted February 28, 2007 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.
_Bat_ Posted February 28, 2007 Author Posted February 28, 2007 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.
plugged_in Posted February 28, 2007 Posted February 28, 2007 no stress dude. Do you mind me asking why you cant edit above the BODY tags?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now