PageRenderTime 44ms CodeModel.GetById 9ms app.highlight 26ms RepoModel.GetById 1ms app.codeStats 0ms

/examples/MarkerManagerDemo/bin-release/srcview/source/MarkerManagerDemo.mxml.html

http://gmaps-utility-library-flash.googlecode.com/
HTML | 86 lines | 77 code | 8 blank | 1 comment | 0 complexity | 2630f858ed15fc4502aa6159688bda2e 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>MarkerManagerDemo.mxml</title>
 7<link rel="stylesheet" type="text/css" href="../SourceStyles.css"/>
 8</head>
 9
10<body><pre><span class="MXMLProcessing_Instruction">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;</span>
11<span class="MXMLComment">&lt;!--</span><span class="MXMLComment">
12 Copyright 2008 Google Inc. 
13 Licensed under the Apache License, Version 2.0:
14    http://www.apache.org/licenses/LICENSE-2.0
15</span><span class="MXMLComment">--&gt;</span>
16<span class="MXMLComponent_Tag">&lt;mx:Application</span><span class="MXMLDefault_Text"> xmlns:mx=&quot;</span><span class="MXMLString">http://www.adobe.com/2006/mxml</span><span class="MXMLDefault_Text">&quot;
17  width=&quot;</span><span class="MXMLString">100%</span><span class="MXMLDefault_Text">&quot; height=&quot;</span><span class="MXMLString">100%</span><span class="MXMLDefault_Text">&quot; layout=&quot;</span><span class="MXMLString">absolute</span><span class="MXMLDefault_Text">&quot; viewSourceURL=&quot;</span><span class="MXMLString">srcview/index.html</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">&gt;</span>
18 <span class="MXMLComponent_Tag">&lt;mx:Panel</span><span class="MXMLDefault_Text"> title=&quot;</span><span class="MXMLString">Google Maps Marker Manager Demo</span><span class="MXMLDefault_Text">&quot; width=&quot;</span><span class="MXMLString">100%</span><span class="MXMLDefault_Text">&quot; height=&quot;</span><span class="MXMLString">100%</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">&gt;</span>
19  <span class="MXMLComponent_Tag">&lt;mx:UIComponent</span><span class="MXMLDefault_Text"> id=&quot;</span><span class="MXMLString">mapHolder</span><span class="MXMLDefault_Text">&quot;
20      initialize=&quot;</span><span class="ActionScriptDefault_Text">onHolderCreated</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span>;<span class="MXMLDefault_Text">&quot;
21      resize=&quot;</span><span class="ActionScriptDefault_Text">onHolderResized</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span><span class="MXMLDefault_Text">&quot;
22      width=&quot;</span><span class="MXMLString">100%</span><span class="MXMLDefault_Text">&quot; height=&quot;</span><span class="MXMLString">100%</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
23 <span class="MXMLComponent_Tag">&lt;/mx:Panel&gt;</span>
24 <span class="MXMLSpecial_Tag">&lt;mx:Script&gt;</span>
25    <span class="ActionScriptOperator">&lt;!</span><span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptDefault_Text">CDATA</span><span class="ActionScriptBracket/Brace">[</span>
26      <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">com</span>.<span class="ActionScriptDefault_Text">google</span>.<span class="ActionScriptDefault_Text">maps</span>.<span class="ActionScriptDefault_Text">LatLng</span>;
27      <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">com</span>.<span class="ActionScriptDefault_Text">google</span>.<span class="ActionScriptDefault_Text">maps</span>.<span class="ActionScriptDefault_Text">LatLngBounds</span>;
28      <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">com</span>.<span class="ActionScriptDefault_Text">google</span>.<span class="ActionScriptDefault_Text">maps</span>.<span class="ActionScriptDefault_Text">Map</span>;
29      <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">com</span>.<span class="ActionScriptDefault_Text">google</span>.<span class="ActionScriptDefault_Text">maps</span>.<span class="ActionScriptDefault_Text">MapEvent</span>;
30      <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">com</span>.<span class="ActionScriptDefault_Text">google</span>.<span class="ActionScriptDefault_Text">maps</span>.<span class="ActionScriptDefault_Text">MapMouseEvent</span>;
31      <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">com</span>.<span class="ActionScriptDefault_Text">google</span>.<span class="ActionScriptDefault_Text">maps</span>.<span class="ActionScriptDefault_Text">MapType</span>;
32      <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">com</span>.<span class="ActionScriptDefault_Text">google</span>.<span class="ActionScriptDefault_Text">maps</span>.<span class="ActionScriptDefault_Text">services</span>.<span class="ActionScriptDefault_Text">ClientGeocoder</span>;
33      <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">com</span>.<span class="ActionScriptDefault_Text">google</span>.<span class="ActionScriptDefault_Text">maps</span>.<span class="ActionScriptDefault_Text">services</span>.<span class="ActionScriptDefault_Text">GeocodingEvent</span>;
34      <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">com</span>.<span class="ActionScriptDefault_Text">google</span>.<span class="ActionScriptDefault_Text">maps</span>.<span class="ActionScriptDefault_Text">overlays</span>.<span class="ActionScriptDefault_Text">Marker</span>;
35      <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">com</span>.<span class="ActionScriptDefault_Text">google</span>.<span class="ActionScriptDefault_Text">maps</span>.<span class="ActionScriptDefault_Text">overlays</span>.<span class="ActionScriptDefault_Text">MarkerOptions</span>;
36      <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">com</span>.<span class="ActionScriptDefault_Text">google</span>.<span class="ActionScriptDefault_Text">maps</span>.<span class="ActionScriptDefault_Text">InfoWindowOptions</span>;
37      <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">controls</span>.<span class="ActionScriptDefault_Text">Alert</span>;
38      <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">com</span>.<span class="ActionScriptDefault_Text">google</span>.<span class="ActionScriptDefault_Text">maps</span>.<span class="ActionScriptDefault_Text">controls</span>.<span class="ActionScriptDefault_Text">ZoomControl</span>;
39      <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">com</span>.<span class="ActionScriptDefault_Text">google</span>.<span class="ActionScriptDefault_Text">maps</span>.<span class="ActionScriptDefault_Text">examples</span>.<span class="ActionScriptDefault_Text">MarkerManager</span>;
40
41      <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">map</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Map</span>;
42      <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">marker</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Marker</span>;
43
44      <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">onHolderCreated</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Event</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span> <span class="ActionScriptBracket/Brace">{</span>
45        <span class="ActionScriptDefault_Text">map</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Map</span><span class="ActionScriptBracket/Brace">()</span>;
46        <span class="ActionScriptDefault_Text">map</span>.<span class="ActionScriptDefault_Text">key</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;ABQIAAAA7QUChpcnvnmXxsjC7s1fCxQGj0PqsCtxKvarsoS-iqLdqZSKfxTd7Xf-2rEc_PC9o8IsJde80Wnj4g&quot;</span>;
47        <span class="ActionScriptDefault_Text">map</span>.<span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">MapEvent</span>.<span class="ActionScriptDefault_Text">MAP_READY</span>, <span class="ActionScriptDefault_Text">onMapReady</span><span class="ActionScriptBracket/Brace">)</span>;
48        <span class="ActionScriptDefault_Text">mapHolder</span>.<span class="ActionScriptDefault_Text">addChild</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">map</span><span class="ActionScriptBracket/Brace">)</span>;
49      <span class="ActionScriptBracket/Brace">}</span>
50
51      <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">onHolderResized</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Event</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span> <span class="ActionScriptBracket/Brace">{</span>
52        <span class="ActionScriptDefault_Text">map</span>.<span class="ActionScriptDefault_Text">setSize</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Point</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">mapHolder</span>.<span class="ActionScriptDefault_Text">width</span>, <span class="ActionScriptDefault_Text">mapHolder</span>.<span class="ActionScriptDefault_Text">height</span><span class="ActionScriptBracket/Brace">))</span>;
53      <span class="ActionScriptBracket/Brace">}</span>
54
55      <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">getRandomPoint</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">LatLng</span> <span class="ActionScriptBracket/Brace">{</span>
56        <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">lat</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Number</span> <span class="ActionScriptOperator">=</span> 48.25 <span class="ActionScriptOperator">+</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">Math</span>.<span class="ActionScriptDefault_Text">random</span><span class="ActionScriptBracket/Brace">()</span> <span class="ActionScriptOperator">-</span> 0.5<span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">*</span>14.5;
57        <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">lng</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Number</span> <span class="ActionScriptOperator">=</span> 11.00 <span class="ActionScriptOperator">+</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">Math</span>.<span class="ActionScriptDefault_Text">random</span><span class="ActionScriptBracket/Brace">()</span> <span class="ActionScriptOperator">-</span> 0.5<span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">*</span>36.0;
58        <span class="ActionScriptReserved">return</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">LatLng</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">Math</span>.<span class="ActionScriptDefault_Text">round</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">lat</span><span class="ActionScriptOperator">*</span>10<span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">/</span>10, <span class="ActionScriptDefault_Text">Math</span>.<span class="ActionScriptDefault_Text">round</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">lng</span><span class="ActionScriptOperator">*</span>10<span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">/</span>10<span class="ActionScriptBracket/Brace">)</span>;
59      <span class="ActionScriptBracket/Brace">}</span>
60
61      <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">getWeatherMarkers</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">n</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">int</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Array</span> <span class="ActionScriptBracket/Brace">{</span>
62        <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">batch</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Array</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Array</span><span class="ActionScriptBracket/Brace">()</span>;
63        <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">n</span>; <span class="ActionScriptOperator">++</span><span class="ActionScriptDefault_Text">i</span><span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptBracket/Brace">{</span>
64          <span class="ActionScriptDefault_Text">batch</span>.<span class="ActionScriptDefault_Text">push</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Marker</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">getRandomPoint</span><span class="ActionScriptBracket/Brace">()</span>, <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">MarkerOptions</span><span class="ActionScriptBracket/Brace">({</span><span class="ActionScriptDefault_Text">hasShadow</span><span class="ActionScriptOperator">:</span> <span class="ActionScriptReserved">false</span><span class="ActionScriptBracket/Brace">})))</span>;
65          <span class="ActionScriptComment">//batch.push(new Marker(getRandomPoint(), new MarkerOptions({hasShadow: true})));
66</span>        <span class="ActionScriptBracket/Brace">}</span>
67        <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">batch</span>;
68      <span class="ActionScriptBracket/Brace">}</span>
69
70      <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">onMapReady</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Event</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span> <span class="ActionScriptBracket/Brace">{</span>
71        <span class="ActionScriptDefault_Text">map</span>.<span class="ActionScriptDefault_Text">enableScrollWheelZoom</span><span class="ActionScriptBracket/Brace">()</span>;
72        <span class="ActionScriptDefault_Text">map</span>.<span class="ActionScriptDefault_Text">enableContinuousZoom</span><span class="ActionScriptBracket/Brace">()</span>;
73        <span class="ActionScriptDefault_Text">map</span>.<span class="ActionScriptDefault_Text">setCenter</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">LatLng</span><span class="ActionScriptBracket/Brace">(</span>48.25, 11.00<span class="ActionScriptBracket/Brace">)</span>, 4,
74                      <span class="ActionScriptDefault_Text">MapType</span>.<span class="ActionScriptDefault_Text">NORMAL_MAP_TYPE</span><span class="ActionScriptBracket/Brace">)</span>;
75        <span class="ActionScriptDefault_Text">map</span>.<span class="ActionScriptDefault_Text">addControl</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">ZoomControl</span><span class="ActionScriptBracket/Brace">())</span>;
76        <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">mgr</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">MarkerManager</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">MarkerManager</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">map</span>, <span class="ActionScriptBracket/Brace">{})</span>;
77        <span class="ActionScriptDefault_Text">mgr</span>.<span class="ActionScriptDefault_Text">addMarkers</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">getWeatherMarkers</span><span class="ActionScriptBracket/Brace">(</span>20<span class="ActionScriptBracket/Brace">)</span>, 3<span class="ActionScriptBracket/Brace">)</span>;
78        <span class="ActionScriptDefault_Text">mgr</span>.<span class="ActionScriptDefault_Text">addMarkers</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">getWeatherMarkers</span><span class="ActionScriptBracket/Brace">(</span>200<span class="ActionScriptBracket/Brace">)</span>, 6<span class="ActionScriptBracket/Brace">)</span>;
79        <span class="ActionScriptDefault_Text">mgr</span>.<span class="ActionScriptDefault_Text">addMarkers</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">getWeatherMarkers</span><span class="ActionScriptBracket/Brace">(</span>1000<span class="ActionScriptBracket/Brace">)</span>, 8<span class="ActionScriptBracket/Brace">)</span>;
80        <span class="ActionScriptDefault_Text">mgr</span>.<span class="ActionScriptDefault_Text">refresh</span><span class="ActionScriptBracket/Brace">()</span>;
81      <span class="ActionScriptBracket/Brace">}</span>
82
83    <span class="ActionScriptBracket/Brace">]]</span><span class="ActionScriptOperator">&gt;</span>
84  <span class="MXMLSpecial_Tag">&lt;/mx:Script&gt;</span>
85<span class="MXMLComponent_Tag">&lt;/mx:Application&gt;</span></pre></body>
86</html>