Skip to main content
BurtleEd
Known Participant
March 22, 2010
解決済み

Google Maps and KMZ files

  • March 22, 2010
  • 返信数 1.
  • 1193 ビュー

Does anyone know how to get Coldfusion to display a KMZ layer on a google map? I have a google map that has multiple layers and it works great but we would like the map to display a KMZ file as a layer. The KMZ file is located on the root of the web directory.

!---Start of Map--->
   <script src=http://maps.google.com/maps?file=api&v=2&key=mykey
            type="text/javascript"></script>
            <script src="http://earthcode.com/downloads/gzoom.js" type="text/javascript"></script>
      <script src="http://gmaps-utility-library.googlecode.com/svn/trunk/markermanager/1.1/src/markermanager.js"></script>
         <script type="text/javascript">
    function initialize() {
    
   if (GBrowserIsCompatible()) {
 
  <!---Map 1--->
  var map1 = new GMap2(document.getElementById("map_canvas1"));
        map1.setCenter(new GLatLng(31.970804,-86.682129), 4);
  map1.setMapType(G_HYBRID_MAP);
  map1.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/shadow50.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:&nbsp</b>" + contact + "<br /><b>ICAO:&nbsp</b>" + icao + "&nbsp&nbsp&nbsp&nbsp&nbsp<B>IWWC:&nbsp</b>"+iwwc);
          });
          return marker;
        }
<!---/** OVERLAYS MAP 1**/--->

map1.addOverlay(createMarker(new GLatLng(41.939,-72.688), "Bradley International Airport", "DSN 220-2312", "KBDL", "CT3", "A"));

    このトピックへの返信は締め切られました。
    解決に役立った回答 ilssac

    ColdFusion is going to have nothing to do with KMZ and Google Maps.  Google Maps are a client technology that use JavaScript.  Have your CFML deliver the proper JavaScript that the Google Maps API is expecting inside of some relevant HTML and the browsers that can will display your desired map.

    ColdFusion won't even know it has happend, it has moved on to another request.

    返信数 1

    ilssac
    ilssac解決!
    Inspiring
    March 22, 2010

    ColdFusion is going to have nothing to do with KMZ and Google Maps.  Google Maps are a client technology that use JavaScript.  Have your CFML deliver the proper JavaScript that the Google Maps API is expecting inside of some relevant HTML and the browsers that can will display your desired map.

    ColdFusion won't even know it has happend, it has moved on to another request.