Changeset 7631 for trunk/src/inc/KMLPlacemark.class.php
- Timestamp:
- Mar 30, 2010, 8:51:44 PM (15 years ago)
- Location:
- trunk/src/inc
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/inc/KMLPlacemark.class.php
r7628 r7631 7 7 8 8 class KMLPlacemark { 9 final$template = '9 private $template = ' 10 10 <placemark> 11 11 <name>%NAME%</name> … … 29 29 } 30 30 31 function setName( string$newName) {31 function setName($newName) { 32 32 $this->name = $newName; 33 33 } 34 34 35 function setDescription( string$newDescription) {36 $this->description = $newDescription;35 function setDescription($newDescription) { 36 $this->description = (string) $newDescription; 37 37 } 38 38 39 function setXCoordinate( float$newXCoordinate) {40 $this->xCoordinate = $newXCoordinate;39 function setXCoordinate($newXCoordinate) { 40 $this->xCoordinate = (double) $newXCoordinate; 41 41 } 42 42 43 function setYCoordinate( float$newYCoordinate) {44 $this->yCoordinate = $newYCoordinate;43 function setYCoordinate($newYCoordinate) { 44 $this->yCoordinate = (double) $newYCoordinate; 45 45 } 46 46 47 47 function toString() { 48 $toString = $t emplate;48 $toString = $this->template; 49 49 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); 54 54 55 55 return $toString;
Note:
See TracChangeset
for help on using the changeset viewer.