This is my google map script. maybe there's something wrong in it. :(
//start
<img src="<?=base_url()?>images/smallmap.gif"
width="24"
height="15" /><a href="#TB_inline?height=450&width=600&inlineId=<?=
$services[$i]['site_id'];?>&modal=true" class="thickbox">Map it!</a>|
<a href="#" class="lnkstyle2">Get directions </a>
<div id="<?=$services[$i]['site_id'];?>">
<div id="map<?=$i?>" style="width: 570px; height: 370px"
align="center"></div>
<p><input type="button" onclick="tb_remove()" type="submit"
value="close" />
</p>
</div>
<script type="text/javascript">
//<![CDATA[
window.onunload=GUnload();
var map;
var start;
if (GBrowserIsCompatible()) {
var opts = { onMarkersSetCallback: processMarkers,
resultList : G_GOOGLEBAR_RESULT_LIST_SUPPRESS,
suppressInitialResultSelection : true, showOnLoad: true, size:new GSize
(370,570)};
map<?=$services[$i]['site_id']?> = new GMap2
(document.getElementById("map<?=$i?>"), {googleBarOptions: opts});
map<?=$services[$i]['site_id']?>.addControl(new
GSmallMapControl());
start = new GLatLng(37.50972584293751,-97.3828125);
map<?=$services[$i]['site_id']?>.setCenter(start, 3);
if(map<?=$services[$i]['site_id']?>.isLoaded()){
locateAddress();
}
map<?=$services[$i]['site_id']?>.checkResize();
document.getElementById("<?=$services[$i]['site_id'];?
>").style.display = "none";
}
function locateAddress() {
var address = '<?=$services[$i]['address']?>';
var geocoder = new GClientGeocoder();
if (geocoder) {
geocoder.getLatLng(
address,
function(point) {
if (!point) {
address = address + " not found."
var marker<?=$services[$i]['site_id']?> = new
GMarker(new GLatLng
(37.50972584293751,-97.3828125 ));
map<?=$services[$i]['site_id']?>.addOverlay(marker<?=
$services[$i]['site_id']?>);
marker<?=$services[$i]['site_id']?>.openInfoWindowHtml
(address);
start = point;
} else {
shopInfoForm = "<div align='left'><b><?=$services[$i]
['site_name'];?></b><br />"
<?php
if($services[$i]['is_premium']){
echo
"'<b>Description:</b><i>".$services[$i]
['description']."</i><br />'+";
}
?>
"<a
href='<?=$services[$i]['url'];?>'><?=$services[$i]['url'];?
></a></div>";
map<?=$services[$i]['site_id']?>.setCenter(point, 14);
var marker<?=$services[$i]['site_id']?> = new GMarker
(point);
map<?=$services[$i]['site_id']?>.addOverlay(marker<?=
$services[$i]['site_id']?>);
marker<?=$services[$i]['site_id']?>.openInfoWindowHtml
(shopInfoForm);
start = point;
}
}
);
}
}
function processMarkers(markers) {
// note: markers is an array of LocalResult
var table = document.createElement('table');
var tbody = document.createElement('tbody');
table.appendChild(tbody);
// document.getElementById("results").appendChild(table);
// getDirections(markers, tbody, 0);
}
function getDirections(markers, tbody, num) {
var lat = markers[num].result.lat;
var lng = markers[num].result.lng;
var dir = new GDirections();
GEvent.addListener(dir, "load", function() {
var tr = document.createElement('tr');
var td = document.createElement('td');
td.appendChild(document.createTextNode(markers
[num].result.titleNoFormatting));
tr.appendChild(td);
var td = document.createElement('td');
td.innerHTML = dir.getDistance().html;
tr.appendChild(td);
tbody.appendChild(tr);
if ((num+1) < markers.length) getDirections(markers, tbody,
(num+1));
});
dir.load("from: " + start.lat() + "," + start.lng() + " to: " +
lat + "," + lng);
}
//]]>
</script>
On Dec 24, 8:29 am, Rossko <[email protected]> wrote:
> > here's the map again:http://mwdshosting.com/~homecare/services/1/3
>
> That page is a bit broken altogether.
> In IE6 , I get a "not implemented" error before even looking at any
> map.
>
> The same page in FF2 does not show Rudem health care at all, it is
> instead on
> http://mwdshosting.com/~homecare/services/1/6
>
> FF2 gives an error on this line (before attempting any map)
> window.onunload=GUnload();
> presumably because the Google maps API has not yet been loaded,
> although I can't see where you actually try to load it.
>
> I can get no map from Rudem Health care from 'map it' or 'directions'
> links.
>
> The page gives 122 errors in the W3C validator, I would guess the
> error that is significant for your problem would be the DOCTYPE issue.
>
> Maybe you should try to test your map in a simple page first, without
> all the extra stuff (thickbox,slideshows and multiple maps).
>
> cheers, Ross K
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---