Here it is when i add in that one line of code
http://www.mototips.com/sample/sample.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/
>
<title>Riding Areas</title>
<script src="http://maps.google.com/maps?
file=api&v=2&key=ABQIAAAAK4SdEypaHKfm0OPMRZISEBT42Onpw_fGX3cH9SE-
hTsrnh--IRTwTULoB9lf7RRc-Nlg-yV_cJGdMw" type="text/javascript"></
script>
<script src="http://gmaps-utility-library.googlecode.com/svn/trunk/
markermanager/release/src/markermanager.js"></script>
<script>
var map;
function initialize () {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map_canvas"));
map.enableScrollWheelZoom();
map.setCenter(new GLatLng(39.504041,-99.492187), 5);
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.addMapType(G_PHYSICAL_MAP);
map.setMapType(G_HYBRID_MAP);
addMarkersFromXML();
var myIcon = new GIcon(G_DEFAULT_ICON);
myIcon.image = 'markers/image.png';
myIcon.shadow = 'markers/shadow.png';
myIcon.iconSize = new GSize(32,32);
myIcon.shadowSize = new GSize(48,32);
myIcon.iconAnchor = new GPoint(16,32);
myIcon.infoWindowAnchor = new GPoint(16,0);
myIcon.printImage = 'markers/printImage.gif';
myIcon.mozPrintImage = 'markers/mozPrintImage.gif';
myIcon.printShadow = 'markers/printShadow.gif';
myIcon.transparent = 'markers/transparent.png';
myIcon.imageMap =
[31,0,31,1,31,2,31,3,31,4,31,5,31,6,31,7,31,8,31,9,31,10,31,11,31,12,31,13,31,14,31,15,31,16,31,17,
31,18,31,19,31,20,31,21,31,22,31,23,31,24,31,25,31,26,31,27,31,28,31,29,31,30,31,31,0,31,0,30,0,29,0,28,0,27,0,26,0,25,0,24,0,23,0,22,0,21,0,20,0,19,0,18,0,17,0,16,0,15,0,14,0,13,0,12,0,11,0,10,0,9,0,8,0,7,0,6,0,5,0,4,0,3,0,2,0,1,0,0];
// An array of GIcons, to make the selection easier
var icons = [];
icons[1] = myIcon;
// the icon information is passed to this function
function createMarker(point,htmlString,icontype) {
var marker = new GMarker(point,icons[icontype]);
}
var markerOptions = { icon:myIcon } ;
}
}
function addMarkersFromXML(){
var batch = [];
mgr = new MarkerManager(map);
var request = GXmlHttp.create();
request.open('GET', 'ridingarea1.xml', true);
request.onreadystatechange = function() {
if (request.readyState == 4 && request.status == 200) {
var xmlDoc = request.responseXML;
var xmlrows =
xmlDoc.documentElement.getElementsByTagName("Row");
for (var i = 0; i < xmlrows.length; i++) {
var xmlrow = xmlrows[i];
var xmlcellLongitude =
xmlrow.getElementsByTagName("Longitude")[0];
var xmlcellLatitude =
xmlrow.getElementsByTagName("Latitude")[0];
var point = new GLatLng(parseFloat
(xmlcellLatitude.firstChild.data), parseFloat
(xmlcellLongitude.firstChild.data));
//get the building name
var xmlcellRidingArea =
xmlrow.getElementsByTagName("Riding_Area")
[0];
var celltextRidingArea =
xmlcellRidingArea.firstChild.data;
//get the address
var xmlcellAddress =
xmlrow.getElementsByTagName("Address")[0];
var celltextAddress =
xmlcellAddress.firstChild.data;
//get the ownership
var xmlcellOwnership =
xmlrow.getElementsByTagName("Ownership")[0];
var celltextOwnership =
xmlcellOwnership.firstChild.data;
//get the date built
var xmlcellDateBuilt =
xmlrow.getElementsByTagName("Date_Built")
[0];
var celltextDateBuilt =
xmlcellDateBuilt.firstChild.data;
var icontype =
parseInt(markers[i].getAttribute("icontype"));
var htmlString = "Riding Area: " +
celltextRidingArea + "<br>" +
"Address: " + celltextAddress + "<br>" + "Ownership: " +
celltextOwnership + "<br>" + "More Info: " + celltextDateBuilt;
//var htmlString = 'yes'
var marker = createMarker
(point,htmlString,icontype);
batch.push(marker);
}
mgr.addMarkers(batch,5);
mgr.refresh();
}
}
request.send(null);
}
function createMarker(point,html) {
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
return marker;
}
</script>
</head>
<body onload="initialize()" onunload="GUnload()">
<div id="map_canvas" style="width: 1350px; height: 800px"></div>
<div id="message"></div>
</body>
</html>
I am not getting any errors... I just dont see the marker anymore....
Thank you to larry for trying to help me out :). What is the next
step?
On Jun 10, 11:24 pm, "[email protected]" <[email protected]>
wrote:
> On Jun 10, 11:12 pm, mototips <[email protected]> wrote:
>
> > Mike thank you for your fast reply.
> > I have changed it to to only refer to one icon
>
> But the old version is still at the link you provided. Is the updated
> one somewhere else?
>
>
>
> > now i noticed when i try to set the one icon by adding this line
> > var icontype = parseInt(markers[i].getAttribute("icontype"));
> > thats when it stops showing a marker on the map...?
>
> And the error you get is?
>
> -- Larry
>
>
>
>
>
> > On Jun 10, 10:59 pm, Mike Williams <[email protected]> wrote:
>
> > > Check your Javascript error, then observe that you create ONE icon here:
> > > var myIcon = new GIcon(G_DEFAULT_ICON);
> > > but then you refer to TWO icons here:
> > > var icons = [];
> > > icons[0] = blueIcon;
> > > icons[1] = myIcon;
>
> > > --
> > > Mike Williamshttp://econym.org.uk/gmap
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---