$radius = round($matches[1], 2) * $bodgeFactor; $t = getArcCords(array($latC, $lonC, $radius), get_bearing(array($latC, $lonC), array($lat1, $lon1)), get_bearing(array($latC, $lonC), array($lat2, $lon2)), -1, $lat1 * 180 / M_PI, $lon1 * 180 / M_PI); $current->cords .= $t[0]; $current->cords2 .= $t[1]; $current->prev_lat = $lat2 * 180 / M_PI; $current->prev_lon = $lon2 * 180 / M_PI; continue; } if (preg_match("/^CLOCKWISE RADIUS=(.*) CENTRE=([N|S])([0-9]{6}) ([W|E])([0-9]{7}) TO=([N|S])([0-9]{6}) ([W|E])([0-9]{7})/", $a, $matches)) { $current->has_circle = true; $lat1 = $current->prev_lat * M_PI / 180; $lon1 = $current->prev_lon * M_PI / 180; $latC = ConvertCord($matches[3], $matches[2]) * 2 * M_PI / 360; $lonC = ConvertCord($matches[5], $matches[4]) * 2 * M_PI / 360; $lat2 = ConvertCord($matches[7], $matches[6]) * 2 * M_PI / 360; $lon2 = ConvertCord($matches[9], $matches[8]) * 2 * M_PI / 360; $radius = round($matches[1], 2) * $bodgeFactor; $t = getArcCords(array($latC, $lonC, $radius), get_bearing(array($latC, $lonC), array($lat1, $lon1)), get_bearing(array($latC, $lonC), array($lat2, $lon2)), 1, $lat1 * 180 / M_PI, $lon1 * 180 / M_PI); $current->cords .= $t[0]; $current->cords2 .= $t[1]; $current->prev_lat = $lat2 * 180 / M_PI; $current->prev_lon = $lon2 * 180 / M_PI; continue; } // else $out.= $a.""; } sort($classes); $out .= "\r\n map.airspace.load = function (type) {\r\n if (!this.isLoaded(type)) {\r\n this.setLoaded(type, true);\r\n switch (type) {\r\n "; foreach ($classes as $c) { $out .= "\t\t\t\tcase('{$c[0]->class}') :\n"; foreach ($c as $d) {
$lon2 = ConvertCord($matches[9], $matches[8]) * M_PI / 180; $radius = round($matches[1], 2) * $bodgeFactor; $t = getArcCords(array($latC, $lonC, $radius), get_bearing(array($latC, $lonC), array($lat1, $lon1)), get_bearing(array($latC, $lonC), array($lat2, $lon2)), 1, $lat1 * 180 / M_PI, $lon1 * 180 / M_PI); $current->cords .= $t[0]; $current->cords2 = array_merge($current->cords2, $t[1]); $current->prev_lat = $lat2 * 180 / M_PI; $current->prev_lon = $lon2 * 180 / M_PI; continue; } if (preg_match("/^CLOCKWISE RADIUS=(.*) CENTRE=([N|S])([0-9]{6}) ([W|E])([0-9]{7}) TO=([N|S])([0-9]{6}) ([W|E])([0-9]{7})/", $a, $matches)) { $lat1 = $current->prev_lat * M_PI / 180; $lon1 = $current->prev_lon * M_PI / 180; $latC = ConvertCord($matches[3], $matches[2]) * M_PI / 180; $lonC = ConvertCord($matches[5], $matches[4]) * M_PI / 180; $lat2 = ConvertCord($matches[7], $matches[6]) * M_PI / 180; $lon2 = ConvertCord($matches[9], $matches[8]) * M_PI / 180; $radius = round($matches[1], 2) * $bodgeFactor; $t = getArcCords(array($latC, $lonC, $radius), get_bearing(array($latC, $lonC), array($lat1, $lon1)), get_bearing(array($latC, $lonC), array($lat2, $lon2)), -1, $lat1 * 180 / M_PI, $lon1 * 180 / M_PI); $current->cords .= $t[0]; $current->cords2 = array_merge($current->cords2, $t[1]); $current->prev_lat = $lat2 * 180 / M_PI; $current->prev_lon = $lon2 * 180 / M_PI; continue; } // else $out.= $a.""; } sort($classes); $out .= "\r\nfunction airspace(airClass, flightLevel,Top, points, strokeWeight, strokeColour, strokeOpacity, fillColour, fillOpacity, name, type) \r\n{ \r\n var polygon = new google.maps.Polygon({\r\n strokeColor: strokeColour,\r\n strokeWeight: strokeWeight,\r\n clickable:true, \r\n strokeOpacity: strokeOpacity,\r\n path: google.maps.geometry.encoding.decodePath(points), \r\n fillColor: fillColour,\r\n fillOpacity: fillOpacity,\r\n zIndex: (185 - flightLevel),\r\n title:name});\r\n as[airSpaces] = [polygon, airClass, flightLevel, Top,false]; \r\n ++airSpaces; \r\n} \r\n\r\nmaximum_base=7500;\r\nfunction setHeight(val)\r\n{ \r\n maximum_base = val;\r\n}\r\n"; foreach ($classes as $c) { $out .= "\r\nfunction load{$c[0]->class}(bool) { \r\n c{$c[0]->class} = bool; \r\n if(class{$c[0]->class}loaded || !c{$c[0]->class}) return; \r\n class{$c[0]->class}loaded = true; \r\n"; foreach ($c as $d) {