PageRenderTime 37ms CodeModel.GetById 16ms app.highlight 14ms RepoModel.GetById 2ms app.codeStats 0ms

/examples/KMLParser/bin-release/srcview/source/com/adobe/xml/syndication/kml/Coordinates.as.html

http://gmaps-utility-library-flash.googlecode.com/
HTML | 71 lines | 61 code | 9 blank | 1 comment | 0 complexity | 643f5a0858da1bebac40b7ddb986c6bd MD5 | raw file
 1<!-- saved from url=(0014)about:internet -->
 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 3<html xmlns="http://www.w3.org/1999/xhtml">
 4<head>
 5<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
 6<title>Coordinates.as</title>
 7<link rel="stylesheet" type="text/css" href="../../../../../../SourceStyles.css"/>
 8</head>
 9
10<body><pre>
11<span class="ActionScriptpackage">package</span> <span class="ActionScriptDefault_Text">com</span>.<span class="ActionScriptDefault_Text">adobe</span>.<span class="ActionScriptDefault_Text">xml</span>.<span class="ActionScriptDefault_Text">syndication</span>.<span class="ActionScriptDefault_Text">kml</span>
12<span class="ActionScriptBracket/Brace">{</span>
13    <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">com</span>.<span class="ActionScriptDefault_Text">adobe</span>.<span class="ActionScriptDefault_Text">xml</span>.<span class="ActionScriptDefault_Text">syndication</span>.<span class="ActionScriptDefault_Text">Namespaces</span>;
14
15
16    <span class="ActionScriptASDoc">/**
17    *    Class that represents an Entry element within an Atom feed
18    * 
19    *     @langversion ActionScript 3.0
20    *    @playerversion Flash 8.5
21    *    @tiptext
22    * 
23    *     @see http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.4.1.2
24    */</span>
25    <span class="ActionScriptReserved">public</span> <span class="ActionScriptclass">class</span> <span class="ActionScriptDefault_Text">Coordinates</span> 
26    <span class="ActionScriptBracket/Brace">{</span>
27        <span class="ActionScriptComment">//todo: add constants for the enum values?
28</span>        
29        <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">kml</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Namespace</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">Namespaces</span>.<span class="ActionScriptDefault_Text">KML_NS</span>;
30
31        <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">_coordsList</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Array</span>;        
32  
33        <span class="ActionScriptASDoc">/**
34        *    Constructor for class.
35        * 
36        *    @param x An XML document that contains an individual Entry element from 
37        *    an Aton XML feed.
38        *
39        */</span>    
40        <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">Coordinates</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">string</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span><span class="ActionScriptBracket/Brace">)</span>
41        <span class="ActionScriptBracket/Brace">{</span>
42            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">stringSplit</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Array</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">string</span>.<span class="ActionScriptDefault_Text">split</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot; &quot;</span><span class="ActionScriptBracket/Brace">)</span>;
43            
44            <span class="ActionScriptDefault_Text">_coordsList</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Array</span><span class="ActionScriptBracket/Brace">()</span>;
45            <span class="ActionScriptReserved">for</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">i</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Number</span> <span class="ActionScriptOperator">=</span> 0; <span class="ActionScriptDefault_Text">i</span> <span class="ActionScriptOperator">&lt;</span> <span class="ActionScriptDefault_Text">stringSplit</span>.<span class="ActionScriptDefault_Text">length</span>; <span class="ActionScriptDefault_Text">i</span><span class="ActionScriptOperator">++</span><span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptBracket/Brace">{</span>
46                <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">coordinate</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Object</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Object</span><span class="ActionScriptBracket/Brace">()</span>;
47                <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">coordString</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Array</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">stringSplit</span><span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptDefault_Text">i</span><span class="ActionScriptBracket/Brace">]</span>.<span class="ActionScriptDefault_Text">split</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;,&quot;</span><span class="ActionScriptBracket/Brace">)</span>;
48                <span class="ActionScriptDefault_Text">coordinate</span>.<span class="ActionScriptDefault_Text">lon</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">coordString</span><span class="ActionScriptBracket/Brace">[</span>0<span class="ActionScriptBracket/Brace">]</span>;
49                <span class="ActionScriptDefault_Text">coordinate</span>.<span class="ActionScriptDefault_Text">lat</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">coordString</span><span class="ActionScriptBracket/Brace">[</span>1<span class="ActionScriptBracket/Brace">]</span>;
50                <span class="ActionScriptDefault_Text">coordinate</span>.<span class="ActionScriptDefault_Text">alt</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">coordString</span><span class="ActionScriptBracket/Brace">[</span>2<span class="ActionScriptBracket/Brace">]</span>;
51                <span class="ActionScriptDefault_Text">_coordsList</span>.<span class="ActionScriptDefault_Text">push</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">coordinate</span><span class="ActionScriptBracket/Brace">)</span>;
52            <span class="ActionScriptBracket/Brace">}</span>
53        <span class="ActionScriptBracket/Brace">}</span>
54         
55         
56         <span class="ActionScriptASDoc">/**
57        *    A String that contains the title for the entry.
58        */</span>    
59        <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">get</span> <span class="ActionScriptDefault_Text">coordsList</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Array</span>
60        <span class="ActionScriptBracket/Brace">{</span>
61            <span class="ActionScriptReserved">return</span> <span class="ActionScriptReserved">this</span>.<span class="ActionScriptDefault_Text">_coordsList</span>;
62         <span class="ActionScriptBracket/Brace">}</span>
63         
64         <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">toString</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span> <span class="ActionScriptBracket/Brace">{</span>
65             <span class="ActionScriptReserved">return</span> <span class="ActionScriptString">&quot;Coords&quot;</span>;
66             <span class="ActionScriptComment">//return &quot;Coordinates: &quot; + &quot; lat: &quot; + this._lat + &quot; lon: &quot; + this._lon + &quot; alt: &quot; + this._alt;
67</span>         <span class="ActionScriptBracket/Brace">}</span>
68    <span class="ActionScriptBracket/Brace">}</span>
69<span class="ActionScriptBracket/Brace">}</span>
70</pre></body>
71</html>