This is a discussion on "[SOLVED] Google maps createMarker()" within the JavaScript Forum section. This forum, and the thread "[SOLVED] Google maps createMarker() are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] Google maps createMarker()
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
[SOLVED] Google maps createMarker()
Hi I am trying to place a marker on my embedded google map.....but as my knowledge of javascript is minimal I am struggling!!!!!
Here is the code I have in my <header> tag
the map is being displayed but not the marker.....any help as to where I am going wrong??? Last edited by Rakuli; Oct 9th, 2007 at 05:47. Reason: Please use [html][/html] tags when posting code. |
|
|
|
|||
|
Re: Google maps createMarker()
I suggest you use something else, entirely!
If you are using Dreamweaver, check this out (it's 100% free): Tools for Google This is a small extension for Dreamweaver that allows you to quickly insert maps and other things from Google into your web page. If you are not using Dreamweaver, tell me what you're using. I might be able to help, anyway. Cheers, SWagner
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
|
|
|||
|
Re: Google maps createMarker()
Hello
I am using Visual Web Developer.... I think I am getting there slowly but surely with javascript.... I have this code so far that loads the map but not the marker function load() { var point = new GLatLng(53.4227, -2.9509) if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map")); map.setCenter(point, 13); createMarker(point, 'We are here!'); map.addOverlay(marker); } function createMarker(point, html) { var marker = new GMarker(point); GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); return marker; } } The page is loading but with errors on page....I seems to be failing on the line createMarker(point, 'We are here!'); any ideas what Ive done wrong??? |
|
|||
|
Re: Google maps createMarker()
OK. First of all, where did you get this code? Usually a code is "handed out" with some sort of explanation...
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
|
|
|||
|
Re: Google maps createMarker()
Its OK problem solved.......I wasnt creating an instance of the object 'marker'.....the one inside the function createMarker was outside the scope of the main function. I just needed to add
var marker = createMarker(point, 'We are here!'); when calling the function. The code by the way was courtesy of google maps api. I just adapted it a bit |
|
|||
|
Re: [SOLVED] Google maps createMarker()
OK. Sounds great. The variable call sometimes throws people off
Regards, SWagner
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
|
![]() |
| 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 |
| Google Maps Question | uqwebdesign | Web Page Design | 2 | Feb 17th, 2007 08:02 |
| Using Google Maps? | blizeH | Webforumz Cafe | 12 | Dec 21st, 2006 15:30 |
| Google Maps... | craig | Webforumz Cafe | 1 | Nov 27th, 2006 16:37 |