Using Google Maps?

This is a discussion on "Using Google Maps?" within the Webforumz Cafe section. This forum, and the thread "Using Google Maps? are both part of the Community category.



Go Back   Webforumz.com > Community > Webforumz Cafe

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Dec 16th, 2006, 14:07
Junior Member
Join Date: Oct 2006
Location: UK
Age: 23
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Using Google Maps?

Hi guys!

First of all I apologise if this is in the wrong category, I really wasn't sure where to put it!

I'd love to put a Google map onto my site in this way;



Basically with a few controls, showing the exact location and a bit of information about the page. Or if that's not possible, even just showing the exact location with that 'A' button type thing.

I've tried implementing the map onto the site but it's just showing the address in some very wierd way, and also showing an area in Spain and I've no idea how to change it.

Any advice or ideas please?

Many thanks!
Reply With Quote

  #2 (permalink)  
Old Dec 16th, 2006, 14:23
spinal007's Avatar
Moderator
Join Date: Mar 2004
Location: Good Ol'London
Age: 22
Posts: 1,620
Blog Entries: 1
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via ICQ to spinal007 Send a message via MSN to spinal007 Send a message via Yahoo to spinal007 Send a message via Skype™ to spinal007
Re: Using Google Maps?

See this:
http://www.pinesandneedles.com/Chris...ristmas-Trees/
http://www.pinesandneedles.com/Chris...ristmas-Trees/

You can copy the HTML and Javascript used to generate the map....

To get the coordinates to your map, find the point using the Google Maps website, click on 'Link to this page' then get the latitude and longitude coordinates from the url...
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
Reply With Quote
  #3 (permalink)  
Old Dec 16th, 2006, 14:48
Junior Member
Join Date: Oct 2006
Location: UK
Age: 23
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Using Google Maps?

Huge thanks for the code! That's perfect; exactly what I'm after!

Having a bit of trouble implementing it though; http://www.thebelfryhotel.co.uk/

Any ideas what I've done wrong please? Also, what is the code with lots of percentage signs? i.e. "%72%6F%6E%"

Thanks again!
Reply With Quote
  #4 (permalink)  
Old Dec 16th, 2006, 23:05
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Using Google Maps?

The site looks good, spinal. You have really weird zip codes, though.
Reply With Quote
  #5 (permalink)  
Old Dec 17th, 2006, 15:22
Junior Member
Join Date: Oct 2006
Location: UK
Age: 23
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Using Google Maps?

^
Reply With Quote
  #6 (permalink)  
Old Dec 17th, 2006, 21:10
Junior Member
Join Date: Oct 2006
Location: UK
Age: 23
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Using Google Maps?

Sorry to bump this yet again, but if you get a chance to have a quick look that'd be great, thanks!
Reply With Quote
  #7 (permalink)  
Old Dec 18th, 2006, 11:57
spinal007's Avatar
Moderator
Join Date: Mar 2004
Location: Good Ol'London
Age: 22
Posts: 1,620
Blog Entries: 1
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via ICQ to spinal007 Send a message via MSN to spinal007 Send a message via Yahoo to spinal007 Send a message via Skype™ to spinal007
Re: Using Google Maps?

fwxAttachEvent(window, "load", function(){ ... });
...is my own script for attaching window events.

You should just use...
window.onload = function(){ ... };

These....
%72%6F%6E
...are encoded HTML.

The site is run by a CMS and the user might end up putting > < ' " in the text used in the label. I encode it so to avoid runtime errors and undefined strings...

Remember to load the google map script...
<script src="http://maps.google.com/maps?file=api&v=2&key=YOUR_KEY_GOES_HERE&" type="text/javascript"></script>

Then all you need is something like...
window.onload = function(){
var GoogleMap1 = new GMap2(document.getElementById("GoogleMap1"));
GoogleMap1.addControl(new GSmallMapControl());
GoogleMap1.addControl(new GMapTypeControl());
GoogleMap1.setCenter(new GLatLng(51.526, -0.191), 15);
var GoogleMap1point = new GLatLng(51.819247, -2.480292);
var GoogleMap1marker = new GMarker(GoogleMap1point, 1);
GoogleMap1.addOverlay(GoogleMap1marker);
GoogleMap1marker.openInfoWindowHtml("Hello world!");
};
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)

Last edited by spinal007; Dec 18th, 2006 at 12:02.
Reply With Quote
  #8 (permalink)  
Old Dec 18th, 2006, 12:04
spinal007's Avatar
Moderator
Join Date: Mar 2004
Location: Good Ol'London
Age: 22
Posts: 1,620
Blog Entries: 1
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via ICQ to spinal007 Send a message via MSN to spinal007 Send a message via Yahoo to spinal007 Send a message via Skype™ to spinal007
Re: Using Google Maps?

Quote:
Originally Posted by ryanfait View Post
The site looks good, spinal. You have really weird zip codes, though.
LOL, Thanks Ryan...

I think London postcodes are great...
W# for west London
N# for North London
S# for South London
and so on....

Never mind the rest of the UK though...
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
Reply With Quote
  #9 (permalink)  
Old Dec 18th, 2006, 12:19
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Using Google Maps?

That's cool. We just have five boring numbers. And sometimes you can use a hyphen and add four more if you feel like it. Go figure.
Reply With Quote
  #10 (permalink)  
Old Dec 18th, 2006, 12:41
Junior Member
Join Date: Oct 2006
Location: UK
Age: 23
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Using Google Maps?

Huge thanks again for the info and code, I've updated it accordingly (I think I've done it right?) and it's still not showing for some reason

Iv'e obviously gone wrong somewhere, but can't see any errors, hmm!
Reply With Quote
  #11 (permalink)  
Old Dec 19th, 2006, 14:30
spinal007's Avatar
Moderator
Join Date: Mar 2004
Location: Good Ol'London
Age: 22
Posts: 1,620
Blog Entries: 1
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via ICQ to spinal007 Send a message via MSN to spinal007 Send a message via Yahoo to spinal007 Send a message via Skype™ to spinal007
Re: Using Google Maps?

This is the problem...
<body onload="load()" onunload="GUnload()">
...causes an error when the page loads and JS execution stops
Just use '<body>'

##############

Wrong element IDs:
var GoogleMap1 = new GMap2(document.getElementById("GoogleMap1"));
<div id="map" style="width: 500px; height: 300px"></div>
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
Reply With Quote
  #12 (permalink)  
Old Dec 20th, 2006, 23:39
Junior Member
Join Date: Oct 2006
Location: UK
Age: 23
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Using Google Maps?

What a star!

Thank you so much!
Reply With Quote
  #13 (permalink)  
Old Dec 21st, 2006, 15:30
spinal007's Avatar
Moderator
Join Date: Mar 2004
Location: Good Ol'London
Age: 22
Posts: 1,620
Blog Entries: 1
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via ICQ to spinal007 Send a message via MSN to spinal007 Send a message via Yahoo to spinal007 Send a message via Skype™ to spinal007
Re: Using Google Maps?

No worries
Looking good by the way!
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
Reply With Quote
Reply

Tags
google, maps

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
google maps pas2gether ASP.NET Forum 4 Oct 27th, 2007 06:41
Google Maps Question uqwebdesign Web Page Design 2 May 14th, 2007 16:53
lmao at google maps! bruno89 Webforumz Cafe 12 Apr 18th, 2007 11:08
Google Maps Question uqwebdesign Web Page Design 2 Feb 17th, 2007 08:02
Google Maps... craig Webforumz Cafe 1 Nov 27th, 2006 16:37


All times are GMT. The time now is 11:01.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43