We are using ColdFusion 8 and I love google maps but I am trying to
get my map to display an HTML table with XML data on a new page when a
user clicks on an icon point on the map. I'm stumped. Can you see if
you can make sense on this? Currenlty the code below works great but I
am not sure how to make the google code do more.
<cfset mapLocationsP =
"#input_xml.externalInfo.mapLocationsP.xmlText#" />
<cfset mapICAOP = "#input_xml.externalInfo.mapICAOP.xmlText#" />
<cfset mapIWWCP = "#input_xml.externalInfo.mapIWWCP.xmlText#" />
<cfset mapPhoneP = "#input_xml.externalInfo.mapPhoneP.xmlText#" />
<cfset overviewFRNP = "#input_xml.externalInfo.overviewFRNP.xmlText#" /
>
<cfset overviewMOAP = "#input_xml.externalInfo.overviewMOAP.xmlText#" /
>
<title><cfoutput>#map1Title#</cfoutput></title>
<script src="http://maps.google.com/maps?file=api&v=2&"
type="text/javascript"></script>
<script type="text/javascript">
function initialize() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(<cfoutput>#mapCenterlat#</
cfoutput>,<cfoutput>#mapCenterlong#</cfoutput>),
<cfoutput>#mapCenterSize#</cfoutput>);
map.setMapType(<cfoutput>#mapType#</cfoutput>);
map.setUIToDefault();
// Create a base icon for all of our markers that specifies
the
// shadow, icon dimensions, etc.
var baseIcon = new GIcon(G_DEFAULT_ICON);
baseIcon.shadow = "http://www.google.com/mapfiles/
shadow51.png";
baseIcon.iconSize = new GSize(20, 34);
baseIcon.shadowSize = new GSize(37, 34);
baseIcon.iconAnchor = new GPoint(9, 34);
baseIcon.infoWindowAnchor = new GPoint(9, 2);
// Creates a marker whose info window displays the letter
corresponding
// to the given index.
function createMarker(point, title, contact, icao, iwwc,
letter) {
// Create a lettered icon for this point using our icon
class
var letteredIcon = new GIcon(baseIcon);
letteredIcon.image = "http://www.google.com/mapfiles/
marker"+letter+".png";
// Set up our GMarkerOptions object
markerOptions = { icon:letteredIcon, title:title };
var marker = new GMarker(point, markerOptions);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<u><b>" + title + "</b></u><br /
><b>Phone: </b>" + contact + "<br /><b>ICAO: </b>" + icao +
"     <B>IWWC: </b>"+iwwc);
});
return marker;
}
/** ADD OVERLAYS **/
map.addOverlay(createMarker(new GLatLng(<cfoutput>#mapLatA#</
cfoutput>,<cfoutput>#mapLonA#</cfoutput>), "<cfoutput>#mapLocationsA#</
cfoutput>", "<cfoutput>#mapPhoneA#</cfoutput>", "<cfoutput>#mapICAOA#</
cfoutput>", "<cfoutput>#mapIWWCA#</cfoutput>", "A"));
<body style="margin:0px; padding:0px;" onload="initialize()"
onunload="GUnload()">
<div id="map_canvas" style="width: 100%; height: 700px;"></div>
</body>
--
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.