Welcome to Tech Support Forum home to more then 136,000 problems solved. Issues have included: Spyware, Malware, Virus Issues, Windows, Microsoft, Linux, Networking, Security, Hardware, and Gaming Getting your problem solved is as easy as:
1. Registering for a free account
2. Asking your question
3. Receiving an answer

Registered members:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* See fewer ads.
* And much more..

 



Want to know how to post a question? click here Having problems with spyware and pop-ups? First Steps
Go Back   Tech Support Forum > Design Forum > Web Design & Programming
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read


Web Design & Programming Discussion of web design, and server-side & client-side scripting

Reply
 
LinkBack Thread Tools
Old 01-24-2008, 07:36 AM   #1 (permalink)
Registered User
 
Join Date: Sep 2007
Posts: 10
OS: Vista Business


Question Google Maps - Custom Markers

I have a Google map with the standard markers on a page, below is the code for the map (attachments are not working). Can anyone explain to me what and where I need to do to use a custom image for the marker please.

Thanks in advance.



function load()
{
//<![CDATA[

if (GBrowserIsCompatible()) {


// A function to create the marker and set up the event window
// Dont try to unroll this function. It has to be here for the function closure
// Each instance of the function preserves the contends of a different instance
// of the "marker" and "html" variables which will be needed later when the event triggers.
function createMarker(point,html) {
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
return marker;
}

// Map controls
var map = new GMap2(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(45.91867663909007, 6.9358062744140625),11);


// Markers and info windows

var point = new GLatLng(45.88331671631865, 6.890144348144531);
var marker = createMarker(point,'<table width="200"><tr><td><span class="menuheaderblue"><a href="aiguille-du-midi-ski-lift-info.cfm">Aiguille du Midi</a></span></td></tr><tr><td height="5"></td</tr><tr><td><div align="justify"><span class="maptext">The Aiguille du Midi cable car takes you up to 3842m, where you have a breathtaking 360 degree panorama over the Mont Blanc Massif...<a href="aiguille-du-midi-ski-lift-info.cfm" style="font-size:10px;">More info</a></div></span></td></tr></table>')
map.addOverlay(marker);

var point = new GLatLng(45.934915539780576, 6.8286895751953125);
var marker = createMarker(point,'<table width="200"><tr><td><span class="menuheaderblue"><a href="brevent-ski-lift-info.cfm">Brevent</a></span></td></tr><tr><td height="5"></td</tr><tr><td><div align="justify"><span class="maptext">From the center of Chamonix you can access Brevent via the Planpraz gondola lift. Only a five minute walk up the hill...<a href="brevent-ski-lift-info.cfm" style="font-size:10px;">More info</a></div></span></td></tr></table>')
map.addOverlay(marker);

var point = new GLatLng(45.96093562515123, 6.871604919433594);
var marker = createMarker(point,'<table width="200"><tr><td><span class="menuheaderblue"><a href="flegere-ski-lift-info.cfm">Flegere</a></span></td></tr><tr><td height="5"></td</tr><tr><td><div align="justify"><span class="maptext">The ski area of Flegere can be accessed from the Flegere cable car in the village of Les Praz...<a href="flegere-ski-lift-info.cfm" style="font-size:10px;">More info</a></div></span></td></tr></table>')
map.addOverlay(marker);

var point = new GLatLng(46.00244696408296, 6.943359375);
var marker = createMarker(point,'<table width="200"><tr><td><span class="menuheaderblue"><a href="le-tour-ski-lift-info.cfm">Le Tour</a></span></td></tr><tr><td height="5"></td</tr><tr><td><div align="justify"><span class="maptext">The ski area of Le Tour and Vallorice is situated at the top of the valley and is furthest away from Chamonix, but its worth the journey...<a href="le-tour-ski-lift-info.cfm" style="font-size:10px;">More info</a></div></span></td></tr></table>')
map.addOverlay(marker);

var point = new GLatLng(45.941362020083915, 6.925506591796875);
var marker = createMarker(point,'<table width="200"><tr><td><span class="menuheaderblue"><a href="grands-montets-ski-lift-info.cfm">Grands Montets</a></span></td></tr><tr><td height="5"></td</tr><tr><td><div align="justify"><span class="maptext">Situated above Argentiere, the skiing area of Les Grands Montets can be accessed via the Lognan cable car and the Plan Joran chair lift...<a href="grands-montets-ski-lift-info.cfm" style="font-size:10px;">More info</a></div></span></td></tr></table>')
map.addOverlay(marker);




}

// display a warning if the browser was not compatible
else {
alert("Sorry, the Google Maps API is not compatible with this browser");
}

// This Javascript is based on code provided by the
// Blackpool Community Church Javascript Team
// http://www.commchurch.freeserve.co.uk/
// http://www.econym.demon.co.uk/googlemaps/

//]]>
}
oo.Berserker is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Important Information
Join the #1 Tech Support Forum Today - It's Totally Free!

TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free.

Join TechSupportforum.com Today - Click Here

Reply


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 Off
Pingbacks are Off
Refbacks are Off




All times are GMT -7. The time now is 11:58 AM.



Copyright 2001 - 2009, Tech Support Forum
Home Tips Plus | Outdoor Basecamp | Automotive Support Forum

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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85