featureArray, $aFeature); } public function toGeoJSON () { $str = ""; $str .= "{\"type\": \"FeatureCollection\", \"features\": ["; $len = count($this->featureArray); if ($len > 0) { for ($i=0; $i < $len; $i++) { if ($i > 0) { $str .= ","; } $str .= $this->featureArray[$i]->toGeoJSON(); } } $str .= "]}"; return $str; } } ?>