Changeset 289

Show
Ignore:
Timestamp:
10/26/05 16:33:55 (3 years ago)
Author:
ogawa
Message:

Remove "LookAt?" element from the output KML.
Add "styleUrl" element to the output.
Because Google Maps now generates WGS84-based coordinates, so the default datum of this script is set to be WGS84.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gmaps2kml/trunk/gmaps2kml.cgi

    r288 r289  
    11#!/usr/bin/perl -w 
    22# gmaps2kml.cgi - Maps the geocode onto Google Earth's KML 
    3 # Hirotaka Ogawa 
     3# Hirotaka Ogawa (hirotaka.ogawa at gmail.com) 
    44 
    55use strict; 
     
    4343  ($lat, $lng) = ($1, $3); 
    4444  ($lat, $lng) = tky2wgs($lat, $lng) 
    45     if $mode eq 'tky' || ($mode ne 'wgs' && $lat > 30 && $lat < 50 && $lng > 115 && $lng < 152); 
     45    if $mode eq 'tky' || ($mode eq 'auto' && $lat > 30 && $lat < 50 && $lng > 115 && $lng < 152); 
    4646  print $q->header('application/vnd.google-earth.kml+xml'); 
    4747  show_kml($lat, $lng, 
     
    6262  $desc 
    6363  <name>$title</name> 
    64   <LookAt> 
    65     <longitude>$lng</longitude> 
    66     <latitude>$lat</latitude> 
    67     <range>540.68</range> 
    68   </LookAt> 
     64  <styleUrl>root://styleMaps#default+nicon=0x304+hicon=0x314</styleUrl> 
    6965  <Point> 
    7066    <coordinates>$lng,$lat,0</coordinates> 
     
    9389        <input type="text" id="ll" name="ll" size="50" value="" /></li> 
    9490    <li>Datum: 
    95         <input type="radio" name="mode" value="" checked="checked" />Auto-select 
    96         <input type="radio" name="mode" value="WGS" />WGS 
    97         <input type="radio" name="mode" value="TKY" />TKY</li> 
     91        <input type="radio" name="mode" value="auto" checked="checked" />Auto-select 
     92        <input type="radio" name="mode" value="wgs" />WGS 
     93        <input type="radio" name="mode" value="tky" />TKY</li> 
    9894    <li>Title: (optional)<br /> 
    9995        <input type="text" name="t" size="50" value="" /></li>