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.
|
|
|
|
|
![]() |
||
Using Google Maps?
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
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! |
|
|
|
#2
|
||||
|
||||
|
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)
|
|
#3
|
|||
|
|||
|
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! |
|
#4
|
||||
|
||||
|
Re: Using Google Maps?
The site looks good, spinal. You have really weird zip codes, though.
|
|
#5
|
|||
|
|||
|
Re: Using Google Maps?
^
|
|
#6
|
|||
|
|||
|
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!
|
|
#7
|
||||
|
||||
|
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. |
|
#8
|
||||
|
||||
|
Re: Using Google Maps?
Quote:
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)
|
|
#9
|
||||
|
||||
|
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.
|
|
#10
|
|||
|
|||
|
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! |
|
#11
|
||||
|
||||
|
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)
|
|
#12
|
|||
|
|||
|
Re: Using Google Maps?
What a star!
Thank you so much! |
|
#13
|
||||
|
||||
|
Re: Using Google Maps?
No worries
Looking good by the way!
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
|
![]() |
| Tags |
| google, maps |
| Thread Tools | |
|
|
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 |