Thanks Adrian,

If you try it, you can see the map is generated, it's just the placing of
the marker that's the issue.



-----Original Message-----
From: Adrian Lynch [mailto:[EMAIL PROTECTED]
Sent: 24 February 2008 10:55
To: CF-Talk
Subject: RE: Google Map API


After a quick scan, and maybe not the source of the problem, but you are
passing in the lat and long the wrong way in a few places.

GLatLng(#dLongitude#, #dLatitude#) should be GLatLng(#dLatitude#,
#dLongitude#)

Adrian

-----Original Message-----
From: Jenny Gavin-Wear
Sent: 23 February 2008 17:25
To: CF-Talk
Subject: Google Map API


Got the following working nicely, thanks to sources for code.

Just one thing not happening, no marker is showing ... any ideas please?

TIA for any help, Jenny


Can be seen working at :
http://84.43.72.133/ftol/ftol-devel/Maps-API/untitled.cfm


<cfset session.GoogleKey =
"ABQIAAAAQWU08SSpxE_NHRopjjFIaRT77izB2FjZNNGJnuNuoc8rFYTfeBSB_tuGNK7BO6Mdxnm
e9fXR4yn-_Q">

<cfif isdefined("form.address")>
<cfset session.Address = "#form.address#">
<cfset session.Gaddress = replace(session.Address, " ", "+", "ALL")>

<cfoutput>
<cfhttp
url="http://maps.google.com/maps/geo?q=#session.Gaddress#&output=xml&key=#se
ssion.googleKey#" method="get" resolveurl="yes" redirect="yes"
charset="utf-8">
</cfhttp>
</cfoutput>
<cfscript>
xml = XMLParse(CFHTTP.FileContent);
</cfscript>
<CFOUTPUT>
<cfset dLatitude =
#ListGetAt(xml.kml.Response.Placemark.Point.coordinates.XmlText, 1)#>
<cfset dLongitude =
#ListGetAt(xml.kml.Response.Placemark.Point.coordinates.XmlText, 2)#>
</CFOUTPUT>
        <cfoutput>
    <script
src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAQWU08SSpxE
_NHRopjjFIaRT77izB2FjZNNGJnuNuoc8rFYTfeBSB_tuGNK7BO6Mdxnme9fXR4yn-_Q"
      type="text/javascript"></script>
    <script type="text/javascript">
    //<![CDATA[
    function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
        map.setCenter(new GLatLng(#dLongitude#, #dLatitude#), 13);
                map.addControl(new GLargeMapControl());
                map.centerAndZoom(new GPoint(#dLongitude#, #dLatitude#), 3);
                var point = new GPoint(#dLongitude#, #dLatitude#);
                var marker = new GMarker(point);
                map.addOverlay(marker);
      }
    }
    //]]>
    </script>
    </cfoutput>
<cfelse>
<cfset session.address = "">
</cfif>

<!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";>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Google Maps JavaScript API Example</title>
  </head>
<body onload="load()" onunload="GUnload()">
<table width="900" border="0" cellspacing="0" cellpadding="5">
  <tr>
    <td>
    <table width="100%" border="0" cellspacing="0" cellpadding="5">
    <form action="" method="post" name="address">

      <tr>
        <td>Address</td>
        <td><input name="Address" type="text" id="Address" size="30" /></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td><input name="Submit" type="submit" id="Submit" value="Submit"
/></td>
      </tr>
      </form>
    </table>
    </td>
    <td width="500"><div id="map" style="width: 500px; height:
300px"></div></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><div align="center">
        <cfif isdefined("session.address") and session.address neq "">
        <cfoutput>Laditude is #dLatitude#, Longitude is #dLongitude#</cfoutput>
    </cfif>
    </div></td>
  </tr>
</table>
</body>
</html>




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299880
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to