toLatLng() public method

Convert this UTM reference to a latitude and longitude
public toLatLng ( ) : the
return the converted latitude and longitude
示例#1
0
 public function testLatLngSouthernHemisphere()
 {
     $UTMRef = new UTMRef(334786, 6252080, 0, 'H', 56);
     $LatLng = $UTMRef->toLatLng();
     $expected = "(-33.85798, 151.21404)";
     self::assertEquals($expected, $LatLng->__toString());
 }
echo "Converted to OS Grid Ref: " . $os6x->toString() . " - " . $os6x->toSixFigureString();
?>
    </p>

    <h2>Convert UTM Reference to Latitude/Longitude</h2>

    <p>
      <pre>$utm1 = new UTMRef(456463.99, 3335334.05, "E", 12);
echo "UTM Reference: " . $utm1->toString() . "&lt;br /&gt;";
$ll3 = $utm1->toLatLng();
echo "Converted to Lat/Long: " . $ll3->toString();</pre>

      <?php 
$utm1 = new UTMRef(456463.99, 3335334.05, "E", 12);
echo "UTM Reference: " . $utm1->toString() . "<br />";
$ll3 = $utm1->toLatLng();
echo "Converted to Lat/Long: " . $ll3->toString();
?>
    </p>

    <h2>Convert Latitude/Longitude to UTM Reference</h2>

    <p>
      <pre>$ll4 = new LatLng(-60.1167, -111.7833);
echo "Latitude/Longitude: " . $ll4->toString() . "&lt;br /&gt;";
$utm2 = $ll4->toUTMRef();
echo "Converted to UTM Ref: " . $utm2->toString() ;</pre>

      <?php 
$ll4 = new LatLng(-60.1167, -111.7833);
echo "Latitude/Longitude: " . $ll4->toString() . "<br />";