Changeset 7773 for trunk/src/inc/KMLLine.class.php
- Timestamp:
- Apr 15, 2010, 10:40:35 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/inc/KMLLine.class.php
r7765 r7773 19 19 </description> 20 20 <LookAt> 21 <longitude>%LONGITUDE %</longitude>22 <latitude>%LATITUDE %</latitude>21 <longitude>%LONGITUDE1%</longitude> 22 <latitude>%LATITUDE1%</latitude> 23 23 <altitude>0</altitude> 24 24 <heading>0</heading> … … 29 29 <LineString> 30 30 <coordinates> 31 % X1%, %Y1%, 0.32 % X2%, %Y2%, 0.31 %LONGITUDE1%, %LATITUDE1%, 0. 32 %LONGITUDE2%, %LATITUDE2%, 0. 33 33 </coordinates> 34 34 </LineString> … … 38 38 private $name; // Name of the line 39 39 private $description; // Description of the line 40 private $longitude; // Longitude of the line41 private $latitude; // Latitude of the line42 40 private $style; // Style of the line 43 private $ x1; // Start Xof line44 private $ y1; // Start Yof line45 private $ x2; // End Xof line46 private $ y2; // End Yof line41 private $longitude1; // Start longitude of line 42 private $latitude1; // Start latitude of line 43 private $longitude2; // End longitude of line 44 private $latitude2; // End latitude of line 47 45 48 46 /* … … 59 57 $this->latitude = 0; 60 58 $this->style = LINE_BLACK; 61 $this-> x1 = 0;62 $this-> y1 = 0;63 $this-> x2 = 0;64 $this-> y2 = 0;59 $this->longitude1 = 0; 60 $this->latitude1 = 0; 61 $this->longitude2 = 0; 62 $this->latitude2 = 0; 65 63 } 66 64 … … 106 104 107 105 /* 108 * Function: setLongitude109 * Description: Setting the longitude of the placemark110 * Parameters: double $newLongitude111 * Returns: -112 */113 function setLongitude($newLongitude) {114 $this->longitude = (double) $newLongitude;115 }116 117 /*118 * Function: setLatitude119 * Description: Setting the latitude of the placemark120 * Parameters: double $newLatitude121 * Returns: -122 */123 function setLatitude($newLatitude) {124 $this->latitude = (double) $newLatitude;125 }126 127 /*128 106 * Function: setStyle 129 107 * Description: Setting the style of the placemark … … 136 114 137 115 /* 138 * Function: set X1139 * Description: Setting the X1 of the placemark140 * Parameters: double $new X1116 * Function: setLongitude1 117 * Description: Setting the longitude1 of the placemark 118 * Parameters: double $newLongitude 141 119 * Returns: - 142 120 */ 143 function setX1($newX1) { 144 $this->x1 = (double) $newX1; 121 function setLongitude1($newLongitude) { 122 $this->longitude1 = (double) $newLongitude; 123 } 124 125 /* 126 * Function: setLatitude1 127 * Description: Setting the latitude1 of the placemark 128 * Parameters: double $newLatitude 129 * Returns: - 130 */ 131 function setLatitude1($newLatitude) { 132 $this->latitude1 = (double) $newLatitude; 145 133 } 146 134 147 135 /* 148 * Function: set Y1149 * Description: Setting the Y1of the placemark150 * Parameters: double $new Y1136 * Function: setLongitude2 137 * Description: Setting the longitude2 of the placemark 138 * Parameters: double $newLongitude 151 139 * Returns: - 152 140 */ 153 function set Y1($newY1) {154 $this-> y1 = (double) $newY1;141 function setLongitude2($newLongitude) { 142 $this->longitude2 = (double) $newLongitude; 155 143 } 156 144 157 145 /* 158 * Function: set X2159 * Description: Setting the X2 of the placemark160 * Parameters: double $new X2146 * Function: setLatitude2 147 * Description: Setting the latitude2 of the placemark 148 * Parameters: double $newLatitude 161 149 * Returns: - 162 150 */ 163 function set X2($newX2) {164 $this-> x2 = (double) $newX2;151 function setLatitude2($newLatitude) { 152 $this->latitude2 = (double) $newLatitude; 165 153 } 166 154 167 155 /* 168 * Function: setY2169 * Description: Setting the Y2 of the placemark170 * Parameters: double $newY2171 * Returns: -156 * Function: isConnected 157 * Description: Check if it is really a line or just a dot 158 * Parameters: - 159 * Returns: true if the line is connected, otherwise false 172 160 */ 173 function setY2($newY2) { 174 $this->y2 = (double) $newY2; 161 function isConnected() { 162 if (($this->latitude2 == 0) || ($this->longitude2 == 0)) { 163 return false; 164 } 165 166 // This is a line! 167 return true; 175 168 } 176 169 … … 187 180 $toString = str_replace('%NAME%', $this->name, $toString); 188 181 $toString = str_replace('%DESCRIPTION%', $this->description, $toString); 189 $toString = str_replace('%LONGITUDE%', $this->longitude, $toString);190 $toString = str_replace('%LATITUDE%', $this->latitude, $toString);191 182 $toString = str_replace('%STYLE%', $this->style, $toString); 192 $toString = str_replace('% X1%', $this->x1, $toString);193 $toString = str_replace('% Y1%', $this->y1, $toString);194 $toString = str_replace('% X2%', $this->x2, $toString);195 $toString = str_replace('% Y2%', $this->y2, $toString);183 $toString = str_replace('%LONGITUDE1%', $this->longitude1, $toString); 184 $toString = str_replace('%LATITUDE1%', $this->latitude1, $toString); 185 $toString = str_replace('%LONGITUDE2%', $this->longitude2, $toString); 186 $toString = str_replace('%LATITUDE2%', $this->latitude2, $toString); 196 187 197 188 return $toString;
Note:
See TracChangeset
for help on using the changeset viewer.