Changeset 7628 for trunk/src


Ignore:
Timestamp:
Mar 30, 2010, 9:27:00 AM (15 years ago)
Author:
Pieter Naber
Message:

Added some contraints, created a index file for a simple test.

Location:
trunk/src
Files:
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/class/KMLFile.class.php

    r7627 r7628  
    2323        }
    2424
    25         function addPlacemark($name, $description, $xcoordinate, $ycoordinate) {
     25        function addPlacemark(KMLPlacemark $placemark) {
     26                $this->KMLPlacemarks[] = $placemark;
     27        }
     28
     29        function addPlacemark(string $name, string $description, float $xcoordinate, float $ycoordinate) {
    2630                $placemark = new KMLPlacemark();
    2731                $placemark->setName($name);
  • trunk/src/class/KMLPlacemark.class.php

    r7627 r7628  
    3737        }
    3838
    39         function setXCoordinate(string $newXCoordinate) {
     39        function setXCoordinate(float $newXCoordinate) {
    4040                $this->xCoordinate = $newXCoordinate;
    4141        }
    4242
    43         function setYCoordinate(string $newYCoordinate) {
     43        function setYCoordinate(float $newYCoordinate) {
    4444                $this->yCoordinate = $newYCoordinate;
    4545        }
  • trunk/src/index.php

    r7627 r7628  
    1010require_once('class/FileHandler.class.php');
    1111require_once('class/KMLFile.class.php');
     12require_once('class/KMLPlacemark.class.php');
     13
     14$kmlPlacemark = new KMLPlacemark();
     15$kmlPlacemark->setName('Test name');
     16$kmlPlacemark->setDescription('Test description');
     17$kmlPlacemark->setXCoordinate(52.138476);
     18$kmlPlacemark->setYCoordinate(4.463046);
    1219
    1320$kml = new KMLFile();
    14 
     21$kml->addPlacemark($kmlPlacemark);
     22echo $kml->toString();
    1523?>
Note: See TracChangeset for help on using the changeset viewer.