I want to display the location of the members on my website, but for
some reason the map does not display all the location.
If I go and add the location manully it works, but when I look the
results from the database only a few works and some doesn't display
and I get an error saying that the address was not found.
here is the JS code with the loop that I have in coldfusion.
[code]
<script type="text/javascript">
//<![CDATA[
var map = null;
var geocoder = null;
function initialize() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map_canvas"));
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
geocoder = new GClientGeocoder();
<cfoutput query="qryGetMembers">
var adrs = "";
var display = "";
<cfif vchstateprov EQ "other">
adrs = "#vchcity#, #vchcountrycode#";
display = "#vchcity#, #vchcountrycode#";
showAddress(adrs, display);
<cfelse>
adrs = "#vchcity#, #vchstateprov#,
#vchcountrycode#";
display = "#vchcity#, #vchstateprov#,
#vchcountrycode#";
showAddress(adrs, display);
</cfif>
</cfoutput>
}
}
function showAddress(address, display) {
if (geocoder) {
geocoder.getLatLng(
address,
function(point) {
if (!point) {
//alert(address + " not found");
} else {
map.setCenter(point, 3);
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(display);
});
map.addOverlay(marker);
//marker.openInfoWindowHtml(display);
geocoder.reset()
}
}
);
}
}
//]]>
</script>
[/code]
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---