Ignore:
Timestamp:
Mar 30, 2010, 8:51:44 PM (13 years ago)
Author:
Pieter Naber
Message:

Fixed a lot of bugs, introduced KMLFile::parseFile for parsing the node status file

Location:
trunk/src/inc
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/inc/KMLPlacemark.class.php

    r7628 r7631  
    77
    88class KMLPlacemark {
    9         final $template = '
     9        private $template = '
    1010                <placemark>
    1111                        <name>%NAME%</name>
     
    2929        }
    3030
    31         function setName(string $newName) {
     31        function setName($newName) {
    3232                $this->name = $newName;
    3333        }
    3434
    35         function setDescription(string $newDescription) {
    36                 $this->description = $newDescription;
     35        function setDescription($newDescription) {
     36                $this->description = (string) $newDescription;
    3737        }
    3838
    39         function setXCoordinate(float $newXCoordinate) {
    40                 $this->xCoordinate = $newXCoordinate;
     39        function setXCoordinate($newXCoordinate) {
     40                $this->xCoordinate = (double) $newXCoordinate;
    4141        }
    4242
    43         function setYCoordinate(float $newYCoordinate) {
    44                 $this->yCoordinate = $newYCoordinate;
     43        function setYCoordinate($newYCoordinate) {
     44                $this->yCoordinate = (double) $newYCoordinate;
    4545        }
    4646
    4747        function toString() {
    48                 $toString = $template;
     48                $toString = $this->template;
    4949
    50                 $toString = preg_replace('%NAME%', $this->name, $toString);
    51                 $toString = preg_replace('%DESCRIPTION%', $this->description, $toString);
    52                 $toString = preg_replace('%XCOORDINATE%', $this->xCoordinate, $toString);
    53                 $toString = preg_replace('%YCOORDINATE%', $this->yCoordinate, $toString);
     50                $toString = str_replace('%NAME%', $this->name, $toString);
     51                $toString = str_replace('%DESCRIPTION%', $this->description, $toString);
     52                $toString = str_replace('%XCOORDINATE%', $this->xCoordinate, $toString);
     53                $toString = str_replace('%YCOORDINATE%', $this->yCoordinate, $toString);
    5454
    5555                return $toString;
Note: See TracChangeset for help on using the changeset viewer.