<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>parpue.net &#187; javascript</title>
	<atom:link href="http://parpue.net/category/web/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://parpue.net</link>
	<description>Flash, Flex, デザイン等自分の好きなことを好きなようにやってます</description>
	<lastBuildDate>Wed, 12 Aug 2009 17:46:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Flashで緯度経度情報つきの画像情報をFlickrから受け取る。</title>
		<link>http://parpue.net/web/996</link>
		<comments>http://parpue.net/web/996#comments</comments>
		<pubDate>Sun, 12 Jul 2009 17:42:36 +0000</pubDate>
		<dc:creator>okm</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[WEB]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[音楽]]></category>
		<category><![CDATA[actionscript3]]></category>
		<category><![CDATA[as3flickrlib]]></category>
		<category><![CDATA[flickr]]></category>

		<guid isPermaLink="false">http://parpue.net/?p=996</guid>
		<description><![CDATA[				ちょっと前にも書いた気がするが、
				最近は画像に、撮影した場所の緯度経度情報が埋め込める。
				そんでもって、緯度経度の情報付きの画像を、
				Flickrに保存しておくことができる。
				とい [...]]]></description>
			<content:encoded><![CDATA[				<p>ちょっと前にも書いた気がするが、<br />
				最近は画像に、撮影した場所の緯度経度情報が埋め込める。<br />
				そんでもって、緯度経度の情報付きの画像を、<br />
				<a href="http://www.flickr.com/photos/parpue" target="_blank">Flickr</a>に保存しておくことができる。</p>
				<p>というわけで、Flickrに位置情報付きの画像を置いておいて、<br />
				Flash＋GoogleMaps上に展開とかしたいなーと思って調べてみたところ、<br />
				FlsahからFlickrに接続するための<a href="http://code.google.com/p/as3flickrlib/" target="_blank">as3flickrlib</a>というのを発見。<br />
				しかしこのライブラリが長いこと更新されていない・・・。</p>
				<p>というわけで、作りたいものの下調べがてら、<br />
				このライブラリで位置情報である、<br />
				ジオタグ付きの情報を取得できるようにするやり方を調べた。</p>
				<p><span id="more-996"></span></p>
				<p><del datetime="2009-07-13T03:20:47+00:00">Photos.as, PhotoSets.asの２つのファイル</del><br />
				（訂正）Photos.as, PhotoSets.as, MethodGroupHelper.asの３つのファイルを、<br />
				以下な感じで修正すれば、ジオタグを取得できる。</p>
				<p>■ Photos.as</p>
				<div class="igBar"><span id="lactionscript-7"><a href="#" onclick="javascript:showPlainTxt('actionscript-7'); return false;">&gt;&gt;text</a></span></div>
				<div class="syntax_hilite"><span class="langName">ACTIONSCRIPT:</span>
				<div id="actionscript-7">
				<div class="actionscript">
				<ol start="70" style="margin:0px; padding:0px" >
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _notes:<span style="color: #0066CC;">Array</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _tags:<span style="color: #0066CC;">Array</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _urls:<span style="color: #0066CC;">Array</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// okm add </span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _latitude:<span style="color: #0066CC;">String</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _longitude:<span style="color: #0066CC;">String</span>; </li>
				</ol>
				</div>
				</div>
				</div>
				<div class="igBar"><span id="lactionscript-8"><a href="#" onclick="javascript:showPlainTxt('actionscript-8'); return false;">&gt;&gt;text</a></span></div>
				<div class="syntax_hilite"><span class="langName">ACTIONSCRIPT:</span>
				<div id="actionscript-8">
				<div class="actionscript">
				<ol start="543" style="margin:0px; padding:0px" >
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> latitude<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">String</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> _latitude;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">set</span> latitude<span style="color: #66cc66;">&#40;</span>value:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _latitude = value;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> longitude<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">String</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> _longitude;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">set</span> longitude<span style="color: #66cc66;">&#40;</span>value:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _longitude = value;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> </li>
				</ol>
				</div>
				</div>
				</div>
				<p>■PhotoSets.as</p>
				<div class="igBar"><span id="lactionscript-9"><a href="#" onclick="javascript:showPlainTxt('actionscript-9'); return false;">&gt;&gt;text</a></span></div>
				<div class="syntax_hilite"><span class="langName">ACTIONSCRIPT:</span>
				<div id="actionscript-9">
				<div class="actionscript">
				<ol start="609" style="margin:0px; padding:0px" >
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #808080; font-style: italic;">//　okm add</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getPhotosExtras<span style="color: #66cc66;">&#40;</span> photoset_id:<span style="color: #0066CC;">String</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MethodGroupHelper.<span style="color: #006600;">invokeMethod</span><span style="color: #66cc66;">&#40;</span> _service, getPhotos_result, </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #ff0000;">"flickr.photosets.getPhotos"</span>, </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">false</span>,</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">new</span> NameValuePair<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">"photoset_id"</span>, photoset_id <span style="color: #66cc66;">&#41;</span>,</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">new</span> NameValuePair<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">"extras"</span>, <span style="color: #ff0000;">"geo"</span> <span style="color: #66cc66;">&#41;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> </li>
				</ol>
				</div>
				</div>
				</div>
				<p>
				extras にとりたい情報を適当に追加すれば、返してくれる情報も増える。</p>
				<p>■MethodGroupHelper.as</p>
				<div class="igBar"><span id="lactionscript-10"><a href="#" onclick="javascript:showPlainTxt('actionscript-10'); return false;">&gt;&gt;text</a></span></div>
				<div class="syntax_hilite"><span class="langName">ACTIONSCRIPT:</span>
				<div id="actionscript-10">
				<div class="actionscript">
				<ol start="84" style="margin:0px; padding:0px" >
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #b1b100;">for</span> each <span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">var</span> p:<span style="color: #0066CC;">XML</span> <span style="color: #b1b100;">in</span> <span style="color: #0066CC;">xml</span>.<span style="color: #006600;">photoset</span>.<span style="color: #006600;">photo</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> photo:Photo = <span style="color: #000000; font-weight: bold;">new</span> Photo<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; photo.<span style="color: #006600;">id</span> = p.@id.<span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; photo.<span style="color: #006600;">secret</span> = p.@secret.<span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; photo.<span style="color: #006600;">title</span> = p.@title.<span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; photo.<span style="color: #006600;">server</span> = <span style="color: #0066CC;">parseInt</span><span style="color: #66cc66;">&#40;</span> p.@server <span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// okm add</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; photo.<span style="color: #006600;">latitude</span> = p.@latitude.<span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; photo.<span style="color: #006600;">longitude</span> = p.@longitude.<span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; photoSet.<span style="color: #006600;">photos</span>.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span> photo <span style="color: #66cc66;">&#41;</span>;&nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> </li>
				</ol>
				</div>
				</div>
				</div>
				<p>あとは、↓な感じで情報を取得すればOK.</p>
				<div class="igBar"><span id="lactionscript-11"><a href="#" onclick="javascript:showPlainTxt('actionscript-11'); return false;">&gt;&gt;text</a></span></div>
				<div class="syntax_hilite"><span class="langName">ACTIONSCRIPT:</span>
				<div id="actionscript-11">
				<div class="actionscript">
				<ol style="margin:0px; padding:0px" >
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">fls = <span style="color: #000000; font-weight: bold;">new</span> FlickrService<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"APIキー"</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">photoSets = <span style="color: #000000; font-weight: bold;">new</span> PhotoSets<span style="color: #66cc66;">&#40;</span>fls<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">fls.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>FlickrResultEvent.<span style="color: #006600;">PHOTOSETS_GET_PHOTOS</span>, GetPhptosComplete<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">photoSets.<span style="color: #006600;">getPhotosExtras</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"SetsのID"</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">〜〜〜〜</li>
				<li style="color:#26536A;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> GetPhptosComplete<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:FlickrResultEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//photoSetの写真のタイトルとURLを配列に格納</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i:uint; i &lt;e.<span style="color: #0066CC;">data</span>.<span style="color: #006600;">photoSet</span>.<span style="color: #006600;">photos</span>.<span style="color: #0066CC;">length</span> ;i++<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">data</span>.<span style="color: #006600;">photoSet</span>.<span style="color: #006600;">photos</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">title</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">data</span>.<span style="color: #006600;">photoSet</span>.<span style="color: #006600;">photos</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">id</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">data</span>.<span style="color: #006600;">photoSet</span>.<span style="color: #006600;">photos</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">latitude</span><span style="color: #66cc66;">&#41;</span>;&nbsp; &nbsp; &nbsp;<span style="color: #808080; font-style: italic;">// 緯度経度も取得可能</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">data</span>.<span style="color: #006600;">photoSet</span>.<span style="color: #006600;">photos</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">longitude</span><span style="color: #66cc66;">&#41;</span>;&nbsp; <span style="color: #808080; font-style: italic;">//</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;"><span style="color: #66cc66;">&#125;</span> </li>
				</ol>
				</div>
				</div>
				</div>
				<p>こんな感じで返してくれます。</p>
				<div class="igBar"><span id="lxml-12"><a href="#" onclick="javascript:showPlainTxt('xml-12'); return false;">&gt;&gt;text</a></span></div>
				<div class="syntax_hilite"><span class="langName">XML:</span>
				<div id="xml-12">
				<div class="xml">
				<ol style="margin:0px; padding:0px" >
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;</span>?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">"1.0"</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">"utf-8"</span> ?<span style="font-weight: bold; color: black;">&gt;</span></span></li>
				<li style="color:#26536A;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;rsp</span> <span style="color: #000066;">stat</span>=<span style="color: #ff0000;">"ok"</span><span style="font-weight: bold; color: black;">&gt;</span></span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;photoset</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"72157620666800332"</span> <span style="color: #000066;">primary</span>=<span style="color: #ff0000;">"3666954753"</span> <span style="color: #000066;">owner</span>=<span style="color: #ff0000;">"25111802@N08"</span> <span style="color: #000066;">ownername</span>=<span style="color: #ff0000;">"----"</span> <span style="color: #000066;">page</span>=<span style="color: #ff0000;">"1"</span> per_<span style="color: #000066;">page</span>=<span style="color: #ff0000;">"500"</span> <span style="color: #000066;">perpage</span>=<span style="color: #ff0000;">"500"</span> <span style="color: #000066;">pages</span>=<span style="color: #ff0000;">"1"</span> <span style="color: #000066;">total</span>=<span style="color: #ff0000;">"24"</span><span style="font-weight: bold; color: black;">&gt;</span></span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;photo</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"3666954753"</span> <span style="color: #000066;">secret</span>=<span style="color: #ff0000;">"----"</span> <span style="color: #000066;">server</span>=<span style="color: #ff0000;">"3541"</span> <span style="color: #000066;">farm</span>=<span style="color: #ff0000;">"4"</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">"shimokita_0024"</span> <span style="color: #000066;">isprimary</span>=<span style="color: #ff0000;">"1"</span> <span style="color: #000066;">latitude</span>=<span style="color: #ff0000;">"35.665071"</span> <span style="color: #000066;">longitude</span>=<span style="color: #ff0000;">"139.66531"</span> <span style="color: #000066;">accuracy</span>=<span style="color: #ff0000;">"16"</span> place_<span style="color: #000066;">id</span>=<span style="color: #ff0000;">"dtJZJhabCZm.78Qz9A"</span> <span style="color: #000066;">woeid</span>=<span style="color: #ff0000;">"28528566"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;photo</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"3667761046"</span> <span style="color: #000066;">secret</span>=<span style="color: #ff0000;">"----"</span> <span style="color: #000066;">server</span>=<span style="color: #ff0000;">"3338"</span> <span style="color: #000066;">farm</span>=<span style="color: #ff0000;">"4"</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">"shimokita_0023"</span> <span style="color: #000066;">isprimary</span>=<span style="color: #ff0000;">"0"</span> <span style="color: #000066;">latitude</span>=<span style="color: #ff0000;">"35.665002"</span> <span style="color: #000066;">longitude</span>=<span style="color: #ff0000;">"139.665412"</span> <span style="color: #000066;">accuracy</span>=<span style="color: #ff0000;">"16"</span> place_<span style="color: #000066;">id</span>=<span style="color: #ff0000;">"dtJZJhabCZm.78Qz9A"</span> <span style="color: #000066;">woeid</span>=<span style="color: #ff0000;">"28528566"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;photo</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"3666954587"</span> <span style="color: #000066;">secret</span>=<span style="color: #ff0000;">"----"</span> <span style="color: #000066;">server</span>=<span style="color: #ff0000;">"3323"</span> <span style="color: #000066;">farm</span>=<span style="color: #ff0000;">"4"</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">"shimokita_0022"</span> <span style="color: #000066;">isprimary</span>=<span style="color: #ff0000;">"0"</span> <span style="color: #000066;">latitude</span>=<span style="color: #ff0000;">"35.663729"</span> <span style="color: #000066;">longitude</span>=<span style="color: #ff0000;">"139.666517"</span> <span style="color: #000066;">accuracy</span>=<span style="color: #ff0000;">"16"</span> place_<span style="color: #000066;">id</span>=<span style="color: #ff0000;">"INaV6gKbCZlVrYnlFA"</span> <span style="color: #000066;">woeid</span>=<span style="color: #ff0000;">"28528453"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;photo</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"3667760848"</span> <span style="color: #000066;">secret</span>=<span style="color: #ff0000;">"----"</span> <span style="color: #000066;">server</span>=<span style="color: #ff0000;">"2563"</span> <span style="color: #000066;">farm</span>=<span style="color: #ff0000;">"3"</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">"shimokita_0020"</span> <span style="color: #000066;">isprimary</span>=<span style="color: #ff0000;">"0"</span> <span style="color: #000066;">latitude</span>=<span style="color: #ff0000;">"35.663106"</span> <span style="color: #000066;">longitude</span>=<span style="color: #ff0000;">"139.667609"</span> <span style="color: #000066;">accuracy</span>=<span style="color: #ff0000;">"16"</span> place_<span style="color: #000066;">id</span>=<span style="color: #ff0000;">"INaV6gKbCZlVrYnlFA"</span> <span style="color: #000066;">woeid</span>=<span style="color: #ff0000;">"28528453"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;photo</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"3667760770"</span> <span style="color: #000066;">secret</span>=<span style="color: #ff0000;">"----"</span> <span style="color: #000066;">server</span>=<span style="color: #ff0000;">"3300"</span> <span style="color: #000066;">farm</span>=<span style="color: #ff0000;">"4"</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">"shimokita_0021"</span> <span style="color: #000066;">isprimary</span>=<span style="color: #ff0000;">"0"</span> <span style="color: #000066;">latitude</span>=<span style="color: #ff0000;">"35.662354"</span> <span style="color: #000066;">longitude</span>=<span style="color: #ff0000;">"139.666976"</span> <span style="color: #000066;">accuracy</span>=<span style="color: #ff0000;">"16"</span> place_<span style="color: #000066;">id</span>=<span style="color: #ff0000;">"INaV6gKbCZlVrYnlFA"</span> <span style="color: #000066;">woeid</span>=<span style="color: #ff0000;">"28528453"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/photoset<span style="font-weight: bold; color: black;">&gt;</span></span></span></li>
				<li style="color:#26536A;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/rsp<span style="font-weight: bold; color: black;">&gt;</span></span></span> </li>
				</ol>
				</div>
				</div>
				</div>
				<p>次は、実際にFlashでGoogleMapsへの展開を挑戦予定！</p>
]]></content:encoded>
			<wfw:commentRss>http://parpue.net/web/996/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Google ストリートビューで鬼ごっこ</title>
		<link>http://parpue.net/web/259</link>
		<comments>http://parpue.net/web/259#comments</comments>
		<pubDate>Mon, 25 Aug 2008 11:07:00 +0000</pubDate>
		<dc:creator>okm</dc:creator>
				<category><![CDATA[WEB]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[googlemaps]]></category>
		<category><![CDATA[ストリードビュー]]></category>
		<category><![CDATA[鬼ごっこ]]></category>

		<guid isPermaLink="false">http://parpue.net/?p=259</guid>
		<description><![CDATA[				北海道までライジングサンを見に遊びにいってきました。ただいま！
				今回は、現在までのストリートビューのプログラムを組み合わせて、
				地図上を複数のキャラクターが動き回るサンプルを作ってみました。
				クリックで新しいウィンドウにサンプル表示
				一応IEでも確認しましたが、FireFox３環境を激しく推奨。
				（IE謎のエラーがたまにでる・・・）
				基本は、以前のサンプルの自動で動き回るキャラクターを複数にしただけです。
				当たり判定とかも加えてゲームらしくしようかと思ったんですが、そこは挫折しましたｗ
				↓以下ソース全部
				
				&#62;&#62;text
				JAVASCRIPT:
				
				
				
				var lastPanoId = null;&#160; &#160; &#160; &#160; &#160;// 最後にいた場所のPanoID
				var nowLatLng;
				var map;
				var streetViewClient;
				var streetPanorama;
				&#160;
				var enemyList = &#91;&#93;;
				var enemyMarker;
				&#160;
				var zakoIcon;
				&#160;
				// GoogleMapsの初期化
				function initMap&#40;lat, lng&#41;&#123;
				&#160; &#160; map = new GMap2&#40;document.getElementById&#40;"map"&#41;&#41;;
				&#160; &#160; map.disableDragging&#40;&#41;;
				&#160; &#160; var ctrlObj = new GMapTypeControl&#40;&#41;;
				&#160; &#160; var pos = new GControlPosition&#40;G_ANCHOR_BOTTOM_RIGHT, new GSize&#40;5, 15&#41;&#41;;
				&#160; &#160; map.addControl&#40;ctrlObj, pos&#41;;
				&#160; &#160; map.setCenter&#40;new GLatLng&#40;lat, lng&#41;, 18&#41;;
				&#160; &#160; initMarker&#40;&#41;;
				&#160; &#160; initPanorama&#40;lat,  [...]]]></description>
			<content:encoded><![CDATA[				<p>北海道までライジングサンを見に遊びにいってきました。ただいま！</p>
				<p>今回は、現在までのストリートビューのプログラムを組み合わせて、<br />
				地図上を複数のキャラクターが動き回るサンプルを作ってみました。</p>
				<p><a href="http://parpue.net/samples/street/" target="_blank">クリックで新しいウィンドウにサンプル表示</a></p>
				<p>一応IEでも確認しましたが、FireFox３環境を激しく推奨。<br />
				（IE謎のエラーがたまにでる・・・）</p>
				<p>基本は、以前のサンプルの自動で動き回るキャラクターを複数にしただけです。<br />
				当たり判定とかも加えてゲームらしくしようかと思ったんですが、そこは挫折しましたｗ</p>
				<p>↓以下ソース全部<br />
				<span id="more-259"></span></p>
				<div class="igBar"><span id="ljavascript-14"><a href="#" onclick="javascript:showPlainTxt('javascript-14'); return false;">&gt;&gt;text</a></span></div>
				<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
				<div id="javascript-14">
				<div class="javascript">
				<ol style="margin:0px; padding:0px" >
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #003366; font-weight: bold;">var</span> lastPanoId = <span style="color: #003366; font-weight: bold;">null</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900; font-style: italic;">// 最後にいた場所のPanoID</span></li>
				<li style="color:#26536A;"><span style="color: #003366; font-weight: bold;">var</span> nowLatLng;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #003366; font-weight: bold;">var</span> map;</li>
				<li style="color:#26536A;"><span style="color: #003366; font-weight: bold;">var</span> streetViewClient;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #003366; font-weight: bold;">var</span> streetPanorama;</li>
				<li style="color:#26536A;">&nbsp;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #003366; font-weight: bold;">var</span> enemyList = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;</li>
				<li style="color:#26536A;"><span style="color: #003366; font-weight: bold;">var</span> enemyMarker;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;"><span style="color: #003366; font-weight: bold;">var</span> zakoIcon;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;"><span style="color: #009900; font-style: italic;">// GoogleMapsの初期化</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #003366; font-weight: bold;">function</span> initMap<span style="color: #66cc66;">&#40;</span>lat, lng<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; map = <span style="color: #003366; font-weight: bold;">new</span> GMap2<span style="color: #66cc66;">&#40;</span>document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"map"</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; map.<span style="color: #006600;">disableDragging</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> ctrlObj = <span style="color: #003366; font-weight: bold;">new</span> GMapTypeControl<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> pos = <span style="color: #003366; font-weight: bold;">new</span> GControlPosition<span style="color: #66cc66;">&#40;</span>G_ANCHOR_BOTTOM_RIGHT, <span style="color: #003366; font-weight: bold;">new</span> GSize<span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;color:#800000;">5</span>, <span style="color: #CC0000;color:#800000;">15</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; map.<span style="color: #006600;">addControl</span><span style="color: #66cc66;">&#40;</span>ctrlObj, pos<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; map.<span style="color: #006600;">setCenter</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #66cc66;">&#40;</span>lat, lng<span style="color: #66cc66;">&#41;</span>, <span style="color: #CC0000;color:#800000;">18</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; initMarker<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; initPanorama<span style="color: #66cc66;">&#40;</span>lat, lng<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;"><span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;"><span style="color: #003366; font-weight: bold;">function</span> initMarker<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; zakoIcon = <span style="color: #003366; font-weight: bold;">new</span> GIcon<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; zakoIcon.<span style="color: #006600;">image</span> = <span style="color: #3366CC;">"./zako_front.gif"</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; zakoIcon.<span style="color: #006600;">iconSize</span> = <span style="color: #003366; font-weight: bold;">new</span> GSize<span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;color:#800000;">30</span>, <span style="color: #CC0000;color:#800000;">57</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; zakoIcon.<span style="color: #006600;">iconAnchor</span> = <span style="color: #003366; font-weight: bold;">new</span> GPoint<span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;color:#800000;">15</span>, <span style="color: #CC0000;color:#800000;">57</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #003366; font-weight: bold;">function</span> initPanorama<span style="color: #66cc66;">&#40;</span>lat, lng<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; streetViewClient = <span style="color: #003366; font-weight: bold;">new</span> GStreetviewClient;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; streetPanorama = <span style="color: #003366; font-weight: bold;">new</span> GStreetviewPanorama<span style="color: #66cc66;">&#40;</span>document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"pano"</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; nowLatLng = <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #66cc66;">&#40;</span>lat, lng<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; streetViewClient.<span style="color: #006600;">getNearestPanoramaLatLng</span><span style="color: #66cc66;">&#40;</span>nowLatLng, <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>latlng<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>latlng == <span style="color: #003366; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"pano"</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">style</span>.<span style="color: #006600;">display</span> = <span style="color: #3366CC;">"none"</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; nowLatLng = latlng;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; streetPanorama.<span style="color: #006600;">setLocationAndPOV</span><span style="color: #66cc66;">&#40;</span>nowLatLng, <span style="color: #66cc66;">&#123;</span>yaw: <span style="color: #CC0000;color:#800000;">180</span>, pitch: <span style="color: #CC0000;color:#800000;">0</span>, zoom: -<span style="color: #CC0000;color:#800000;">1</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; GEvent.<span style="color: #006600;">addListener</span><span style="color: #66cc66;">&#40;</span>streetPanorama, </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">"yawchanged"</span>, </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>yaw<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;changeYaw<span style="color: #66cc66;">&#40;</span>yaw<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; GEvent.<span style="color: #006600;">addListener</span><span style="color: #66cc66;">&#40;</span>streetPanorama, </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">"initialized"</span>, </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>location<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;panoramaInitialized<span style="color: #66cc66;">&#40;</span>location<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// キャラクタを配置</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; enemyOptions = <span style="color: #66cc66;">&#91;</span> <span style="color: #66cc66;">&#123;</span> lat:<span style="color: #CC0000;color:#800000;">35</span>.<span style="color: #CC0000;color:#800000;">661821</span>, lng:<span style="color: #CC0000;color:#800000;">139</span>.<span style="color: #CC0000;color:#800000;">666685</span><span style="color: #66cc66;">&#125;</span>,</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#123;</span> lat:<span style="color: #CC0000;color:#800000;">35</span>.<span style="color: #CC0000;color:#800000;">662404</span>, lng:<span style="color: #CC0000;color:#800000;">139</span>.<span style="color: #CC0000;color:#800000;">665810</span><span style="color: #66cc66;">&#125;</span>,</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#123;</span> lat:<span style="color: #CC0000;color:#800000;">35</span>.<span style="color: #CC0000;color:#800000;">66215</span>,&nbsp; lng:<span style="color: #CC0000;color:#800000;">139</span>.<span style="color: #CC0000;color:#800000;">665270</span><span style="color: #66cc66;">&#125;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#93;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">for</span><span style="color: #66cc66;">&#40;</span>i = <span style="color: #CC0000;color:#800000;">0</span>; i &lt;enemyOptions.<span style="color: #006600;">length</span>; i++<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> enemy = <span style="color: #003366; font-weight: bold;">new</span> Object;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; enemy.<span style="color: #006600;">lat</span> = enemyOptions<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#91;</span><span style="color: #3366CC;">"lat"</span><span style="color: #66cc66;">&#93;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; enemy.<span style="color: #006600;">lng</span> = enemyOptions<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#91;</span><span style="color: #3366CC;">"lng"</span><span style="color: #66cc66;">&#93;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; enemy.<span style="color: #006600;">marker</span> = <span style="color: #003366; font-weight: bold;">new</span> GMarker<span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #66cc66;">&#40;</span>enemy.<span style="color: #006600;">lat</span>, enemy.<span style="color: #006600;">lng</span><span style="color: #66cc66;">&#41;</span>,<span style="color: #66cc66;">&#123;</span>draggable:<span style="color: #003366; font-weight: bold;">false</span>, icon:zakoIcon<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; map.<span style="color: #006600;">addOverlay</span><span style="color: #66cc66;">&#40;</span>enemy.<span style="color: #006600;">marker</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; enemy.<span style="color: #006600;">moveInterval</span> = setInterval<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"toNextPanorama("</span>+i+<span style="color: #3366CC;">")"</span>, <span style="color: #CC0000;color:#800000;">2000</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; enemyList<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span> = enemy;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;"><span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;"><span style="color: #009900; font-style: italic;">// 次の位置へ移動</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #003366; font-weight: bold;">function</span> toNextPanorama<span style="color: #66cc66;">&#40;</span>enemy_num<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> enemy = enemyList<span style="color: #66cc66;">&#91;</span>enemy_num<span style="color: #66cc66;">&#93;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; clearInterval<span style="color: #66cc66;">&#40;</span>enemy.<span style="color: #006600;">moveInterval</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; enemy.<span style="color: #006600;">pt</span> = map.<span style="color: #006600;">fromLatLngToContainerPixel</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #66cc66;">&#40;</span>enemy.<span style="color: #006600;">lat</span>, enemy.<span style="color: #006600;">lng</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;"><span style="color: #009900; font-style: italic;">/*</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; if(enemy.pt.x&gt; 210 &amp;&amp; enemy.pt.x &lt;230 &amp;&amp; enemy.pt.y&gt; 192 &amp;&amp; enemy.pt.y &lt;270){</span></li>
				<li style="color:#26536A;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; //alert(&quot;hit&quot;);</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; }</span></li>
				<li style="color:#26536A;"><span style="color: #009900; font-style: italic;">*/</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// 現在の表示位置の緯度経度を取得</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; streetViewClient.<span style="color: #006600;">getNearestPanorama</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #66cc66;">&#40;</span>enemy.<span style="color: #006600;">lat</span>, enemy.<span style="color: #006600;">lng</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>streetData<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> neighbourCount = streetData.<span style="color: #006600;">links</span>.<span style="color: #006600;">length</span>; <span style="color: #009900; font-style: italic;">// 隣接するパノラマの数</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> nextPanoId; <span style="color: #009900; font-style: italic;">// 次に向かうパノラマのID</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>neighbourCount == <span style="color: #CC0000;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// 隣接するパノラマが１つだった場合はそこへ移動</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; enemy.<span style="color: #006600;">nextYaw</span> = streetData.<span style="color: #006600;">links</span><span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">yaw</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nextPanoId = streetData.<span style="color: #006600;">links</span><span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">panoId</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">while</span><span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;i = Math.<span style="color: #006600;">floor</span><span style="color: #66cc66;">&#40;</span> Math.<span style="color: #006600;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> * neighbourCount <span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>enemy.<span style="color: #006600;">lastPanoId</span> != streetData.<span style="color: #006600;">links</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">panoId</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nextPanoId = streetData.<span style="color: #006600;">links</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">panoId</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;enemy.<span style="color: #006600;">nextYaw</span> = streetData.<span style="color: #006600;">links</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">yaw</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">break</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; enemy.<span style="color: #006600;">lastPanoId</span> = streetData.<span style="color: #006600;">location</span>.<span style="color: #006600;">panoId</span>;&nbsp; &nbsp; &nbsp;<span style="color: #009900; font-style: italic;">// 今いた場所を覚えておく</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; streetViewClient.<span style="color: #006600;">getPanoramaById</span><span style="color: #66cc66;">&#40;</span> nextPanoId,</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>nextStreetData<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;enemy.<span style="color: #006600;">nowLatLng</span> = nextStreetData.<span style="color: #006600;">location</span>.<span style="color: #006600;">latlng</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">var</span> pov = streetPanorama.<span style="color: #006600;">getPOV</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nowYaw = pov.<span style="color: #006600;">yaw</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>nowYaw&gt; <span style="color: #CC0000;color:#800000;">360</span><span style="color: #66cc66;">&#41;</span> nowYaw -= <span style="color: #CC0000;color:#800000;">360</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>Math.<span style="color: #006600;">abs</span><span style="color: #66cc66;">&#40;</span>nowYaw - enemy.<span style="color: #006600;">nextYaw</span><span style="color: #66cc66;">&#41;</span>&gt; <span style="color: #CC0000;color:#800000;">180</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>nowYaw&gt; enemy.<span style="color: #006600;">nextYaw</span><span style="color: #66cc66;">&#41;</span> enemy.<span style="color: #006600;">nextYaw</span> += <span style="color: #CC0000;color:#800000;">360</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;map.<span style="color: #006600;">removeOverlay</span><span style="color: #66cc66;">&#40;</span>enemy.<span style="color: #006600;">marker</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;zakoIcon.<span style="color: #006600;">image</span> = getIconFromYaw<span style="color: #66cc66;">&#40;</span>enemy.<span style="color: #006600;">nextYaw</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;enemy.<span style="color: #006600;">marker</span> = <span style="color: #003366; font-weight: bold;">new</span> GMarker<span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #66cc66;">&#40;</span>enemy.<span style="color: #006600;">nowLatLng</span>.<span style="color: #006600;">lat</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>, enemy.<span style="color: #006600;">nowLatLng</span>.<span style="color: #006600;">lng</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>,<span style="color: #66cc66;">&#123;</span>draggable:<span style="color: #003366; font-weight: bold;">false</span>, icon:zakoIcon<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;map.<span style="color: #006600;">addOverlay</span><span style="color: #66cc66;">&#40;</span>enemy.<span style="color: #006600;">marker</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;enemy.<span style="color: #006600;">lat</span> = enemy.<span style="color: #006600;">nowLatLng</span>.<span style="color: #006600;">lat</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;enemy.<span style="color: #006600;">lng</span> = enemy.<span style="color: #006600;">nowLatLng</span>.<span style="color: #006600;">lng</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;enemy.<span style="color: #006600;">pt</span> = map.<span style="color: #006600;">fromLatLngToContainerPixel</span><span style="color: #66cc66;">&#40;</span>enemy.<span style="color: #006600;">nowLatLng</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;"><span style="color: #009900; font-style: italic;">/*</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if(enemy.pt.x&gt; 210 &amp;&amp; enemy.pt.x &lt;230 &amp;&amp; enemy.pt.y&gt; 192 &amp;&amp; enemy.pt.y &lt;270){</span></li>
				<li style="color:#26536A;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//alert(&quot;hit&quot;);</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></li>
				<li style="color:#26536A;"><span style="color: #009900; font-style: italic;">*/</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;enemy.<span style="color: #006600;">moveInterval</span> = setInterval<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"toNextPanorama("</span>+enemy_num+<span style="color: #3366CC;">")"</span>, <span style="color: #CC0000;color:#800000;">2000</span><span style="color: #66cc66;">&#41;</span>; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;enemyList<span style="color: #66cc66;">&#91;</span>enemy_num<span style="color: #66cc66;">&#93;</span> = enemy;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #003366; font-weight: bold;">function</span> getIconFromYaw<span style="color: #66cc66;">&#40;</span>yaw<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; gifFile = <span style="color: #3366CC;">"./zako_f.gif"</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> yaw&gt; <span style="color: #CC0000;color:#800000;">360</span> <span style="color: #66cc66;">&#41;</span> yaw -= <span style="color: #CC0000;color:#800000;">360</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> yaw&gt;= <span style="color: #CC0000;color:#800000;">315</span> || yaw &lt;<span style="color: #CC0000;color:#800000;">45</span>&nbsp; <span style="color: #66cc66;">&#41;</span> gifFile = <span style="color: #3366CC;">"./zako_back.gif"</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> yaw&gt;= <span style="color: #CC0000;color:#800000;">45</span> &amp;&amp; yaw &lt; <span style="color: #CC0000;color:#800000;">135</span> <span style="color: #66cc66;">&#41;</span> gifFile = <span style="color: #3366CC;">"./zako_right.gif"</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> yaw&gt;= <span style="color: #CC0000;color:#800000;">135</span> &amp;&amp; yaw &lt; <span style="color: #CC0000;color:#800000;">225</span> <span style="color: #66cc66;">&#41;</span> gifFile = <span style="color: #3366CC;">"./zako_front.gif"</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> yaw&gt;= <span style="color: #CC0000;color:#800000;">225</span> || yaw &lt;<span style="color: #CC0000;color:#800000;">315</span> <span style="color: #66cc66;">&#41;</span> gifFile = <span style="color: #3366CC;">"./zako_left.gif"</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> gifFile;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #003366; font-weight: bold;">function</span> changeYaw<span style="color: #66cc66;">&#40;</span>yaw<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> gifFile;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> yaw&gt; <span style="color: #CC0000;color:#800000;">360</span> <span style="color: #66cc66;">&#41;</span> yaw -= <span style="color: #CC0000;color:#800000;">360</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> yaw&gt;= <span style="color: #CC0000;color:#800000;">315</span> || yaw &lt;<span style="color: #CC0000;color:#800000;">45</span>&nbsp; <span style="color: #66cc66;">&#41;</span> gifFile = <span style="color: #3366CC;">"ue.gif"</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> yaw&gt;= <span style="color: #CC0000;color:#800000;">45</span> &amp;&amp; yaw &lt; <span style="color: #CC0000;color:#800000;">135</span> <span style="color: #66cc66;">&#41;</span> gifFile = <span style="color: #3366CC;">"migi.gif"</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> yaw&gt;= <span style="color: #CC0000;color:#800000;">135</span> &amp;&amp; yaw &lt; <span style="color: #CC0000;color:#800000;">225</span> <span style="color: #66cc66;">&#41;</span> gifFile = <span style="color: #3366CC;">"shita.gif"</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> yaw&gt;= <span style="color: #CC0000;color:#800000;">225</span> || yaw &lt;<span style="color: #CC0000;color:#800000;">315</span> <span style="color: #66cc66;">&#41;</span> gifFile = <span style="color: #3366CC;">"hidari.gif"</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"girl"</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">innerHTML</span> = <span style="color: #3366CC;">'&lt;img src=&quot;'</span>+ gifFile +<span style="color: #3366CC;">'&quot; alt=&quot;gial&quot;/&gt;'</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #003366; font-weight: bold;">function</span> panoramaInitialized<span style="color: #66cc66;">&#40;</span>location<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; map.<span style="color: #006600;">panTo</span><span style="color: #66cc66;">&#40;</span>location.<span style="color: #006600;">latlng</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #66cc66;">&#125;</span> </li>
				</ol>
				</div>
				</div>
				</div>
]]></content:encoded>
			<wfw:commentRss>http://parpue.net/web/259/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ストリートビューと地図の連携</title>
		<link>http://parpue.net/web/249</link>
		<comments>http://parpue.net/web/249#comments</comments>
		<pubDate>Wed, 13 Aug 2008 11:24:12 +0000</pubDate>
		<dc:creator>okm</dc:creator>
				<category><![CDATA[WEB]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[googlemaps]]></category>
		<category><![CDATA[ストリートビュー]]></category>

		<guid isPermaLink="false">http://parpue.net/?p=249</guid>
		<description><![CDATA[				前回は、自動で下北をぐるぐる歩き回らせるのを作りましたが、
				今回はストリートビューを自分でマウスで移動させて、地図のほうの位置を変更させるという、
				まさに、本家でやれ！なものを作って見ました。
	 [...]]]></description>
			<content:encoded><![CDATA[				<p>前回は、自動で下北をぐるぐる歩き回らせるのを作りましたが、<br />
				今回はストリートビューを自分でマウスで移動させて、地図のほうの位置を変更させるという、<br />
				まさに、本家でやれ！なものを作って見ました。<br />
				自動でウロウロに比べたら簡単。<br />
				動きは本家と変わらないですが、しいて言うならキャラクタが向き変えるところでしょうか。</p>
				<p>前回の自動でウロウロと、今回の自分でウロウロ組み合わせると、<br />
				ストリートビュー鬼ごっこゲームができそうですね。</p>
				<p><span id="more-249"></span><br />
				↓今回はストリートビューのほうをマウスで操作</p>
				<div id="pano" style="width:400px;height:300px;border:solid 1px">
				<input type="button" onClick="initMap(35.66188145562874,139.6673360466957);" value="ここをクリックでスタート"/></div>
				<div style="position:relative">
				<div id="map" style="width:400px;height:300px;border:solid 1px;position:relative"></div>
				<div id="girl" style="width:40px;height:60px;position:absolute;top:92px;left:180px"><img src="/common/image/shita.gif"/></div>
				</div>
				<div style="clear:both"></div>
				<p>ストリートビューの角度の変更イベントが <strong>yawchanged</strong>、<br />
				位置の変更イベントが <strong>initialized</strong> で得られます。<br />
				それに応じて、キャラクターの向きと、地図の位置を変更してやっています。</p>
				<p>ソースコード全部</p>
				<div class="igBar"><span id="ljavascript-16"><a href="#" onclick="javascript:showPlainTxt('javascript-16'); return false;">&gt;&gt;text</a></span></div>
				<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
				<div id="javascript-16">
				<div class="javascript">
				<ol style="margin:0px; padding:0px" >
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #003366; font-weight: bold;">var</span> lastPanoId = <span style="color: #003366; font-weight: bold;">null</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900; font-style: italic;">// 最後にいた場所のPanoID</span></li>
				<li style="color:#26536A;"><span style="color: #003366; font-weight: bold;">var</span> nowLatLng;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #003366; font-weight: bold;">var</span> map;</li>
				<li style="color:#26536A;"><span style="color: #003366; font-weight: bold;">var</span> streetViewClient;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #003366; font-weight: bold;">var</span> streetPanorama;</li>
				<li style="color:#26536A;">&nbsp;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #009900; font-style: italic;">// GoogleMapsの初期化</span></li>
				<li style="color:#26536A;"><span style="color: #003366; font-weight: bold;">function</span> initMap<span style="color: #66cc66;">&#40;</span>lat, lng<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp;map = <span style="color: #003366; font-weight: bold;">new</span> GMap2<span style="color: #66cc66;">&#40;</span>document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"map"</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp;map.<span style="color: #006600;">disableDragging</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">var</span> ctrlObj = <span style="color: #003366; font-weight: bold;">new</span> GMapTypeControl<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">var</span> pos = <span style="color: #003366; font-weight: bold;">new</span> GControlPosition<span style="color: #66cc66;">&#40;</span>G_ANCHOR_BOTTOM_RIGHT, <span style="color: #003366; font-weight: bold;">new</span> GSize<span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;color:#800000;">5</span>, <span style="color: #CC0000;color:#800000;">15</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp;map.<span style="color: #006600;">addControl</span><span style="color: #66cc66;">&#40;</span>ctrlObj, pos<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp;map.<span style="color: #006600;">setCenter</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #66cc66;">&#40;</span>lat, lng<span style="color: #66cc66;">&#41;</span>, <span style="color: #CC0000;color:#800000;">18</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp;initPanorama<span style="color: #66cc66;">&#40;</span>lat, lng<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;"><span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;"><span style="color: #003366; font-weight: bold;">function</span> initPanorama<span style="color: #66cc66;">&#40;</span>lat, lng<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; streetViewClient = <span style="color: #003366; font-weight: bold;">new</span> GStreetviewClient;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; streetPanorama = <span style="color: #003366; font-weight: bold;">new</span> GStreetviewPanorama<span style="color: #66cc66;">&#40;</span>document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"pano"</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; nowLatLng = <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #66cc66;">&#40;</span>lat, lng<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; streetViewClient.<span style="color: #006600;">getNearestPanoramaLatLng</span><span style="color: #66cc66;">&#40;</span>nowLatLng, <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>latlng<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>latlng == <span style="color: #003366; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"pano"</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">style</span>.<span style="color: #006600;">display</span> = <span style="color: #3366CC;">"none"</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; nowLatLng = latlng;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; streetPanorama.<span style="color: #006600;">setLocationAndPOV</span><span style="color: #66cc66;">&#40;</span>nowLatLng, <span style="color: #66cc66;">&#123;</span>yaw: <span style="color: #CC0000;color:#800000;">180</span>, pitch: <span style="color: #CC0000;color:#800000;">0</span>, zoom: -<span style="color: #CC0000;color:#800000;">1</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; GEvent.<span style="color: #006600;">addListener</span><span style="color: #66cc66;">&#40;</span>streetPanorama, </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">"yawchanged"</span>, </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>yaw<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;changeYaw<span style="color: #66cc66;">&#40;</span>yaw<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; GEvent.<span style="color: #006600;">addListener</span><span style="color: #66cc66;">&#40;</span>streetPanorama, </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">"initialized"</span>, </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>location<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;panoramaInitialized<span style="color: #66cc66;">&#40;</span>location<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;">&nbsp;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span></li>
				<li style="color:#26536A;"><span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;"><span style="color: #003366; font-weight: bold;">function</span> changeYaw<span style="color: #66cc66;">&#40;</span>yaw<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> gifFile;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> yaw&gt; <span style="color: #CC0000;color:#800000;">360</span> <span style="color: #66cc66;">&#41;</span> yaw -= <span style="color: #CC0000;color:#800000;">360</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> yaw&gt;= <span style="color: #CC0000;color:#800000;">315</span> || yaw &lt;<span style="color: #CC0000;color:#800000;">45</span>&nbsp; <span style="color: #66cc66;">&#41;</span> gifFile = <span style="color: #3366CC;">"/common/image/ue.gif"</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> yaw&gt;= <span style="color: #CC0000;color:#800000;">45</span> &amp;&amp; yaw &lt; <span style="color: #CC0000;color:#800000;">135</span> <span style="color: #66cc66;">&#41;</span> gifFile = <span style="color: #3366CC;">"/common/image/migi.gif"</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> yaw&gt;= <span style="color: #CC0000;color:#800000;">135</span> &amp;&amp; yaw &lt; <span style="color: #CC0000;color:#800000;">225</span> <span style="color: #66cc66;">&#41;</span> gifFile = <span style="color: #3366CC;">"/common/image/shita.gif"</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> yaw&gt;= <span style="color: #CC0000;color:#800000;">225</span> || yaw &lt;<span style="color: #CC0000;color:#800000;">315</span> <span style="color: #66cc66;">&#41;</span> gifFile = <span style="color: #3366CC;">"/common/image/hidari.gif"</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"girl"</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">innerHTML</span> = <span style="color: #3366CC;">'&lt;img src=&quot;'</span>+ gifFile +<span style="color: #3366CC;">'&quot; alt=&quot;gial&quot;/&gt;'</span>;</li>
				<li style="color:#26536A;"><span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;"><span style="color: #003366; font-weight: bold;">function</span> panoramaInitialized<span style="color: #66cc66;">&#40;</span>location<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; map.<span style="color: #006600;">panTo</span><span style="color: #66cc66;">&#40;</span>location.<span style="color: #006600;">latlng</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;"><span style="color: #66cc66;">&#125;</span> </li>
				</ol>
				</div>
				</div>
				</div>
				<p>そういえば、私事ですが、結婚パーティーではここでも書いた、<br />
				ビンゴの景品のクジ用のAirアプリを無事プロジェクターで動作させることができました。</p>
				<p>ものを作って人に喜んでもらうのは、本当にうれしいですね。</p>
				<p>ライブのほうも無事(?)成功しました。<br />
				レポートは<a href="http://chocolataste-planner.jp/">バンドのホームページ</a>のほうに、書こうかなと思います。</p>
				<p>ところで、前から開発合宿みたいなものを一度してみたかったんですが、<br />
				今度それが叶いそうです。</p>
				<p>2泊3日で、どんなものができるのか、このBlogでもレポートしていきたいと思います。8/22~24 の予定。</p>
]]></content:encoded>
			<wfw:commentRss>http://parpue.net/web/249/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Googleストリートビューでもっと下北をウロウロさせる！</title>
		<link>http://parpue.net/web/241</link>
		<comments>http://parpue.net/web/241#comments</comments>
		<pubDate>Thu, 07 Aug 2008 08:59:34 +0000</pubDate>
		<dc:creator>okm</dc:creator>
				<category><![CDATA[WEB]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[デザイン]]></category>
		<category><![CDATA[googlemaps]]></category>
		<category><![CDATA[ストリードビュー]]></category>

		<guid isPermaLink="false">http://parpue.net/?p=241</guid>
		<description><![CDATA[				前作ったやつを、もうちょっと作りこみ。
				曲がるときもっとスムーズに曲がってくれるようにして、歩くスピードをアップ。
				ちょっとコレで、ゲームなぞ作ってみようかなーとか。
				FlashPlayer9必須みたいです。
				環境によってはすごい重いかもしれません。
				↓実行サンプルとソース
				
				
				
				
				
				
				
				
				曲がるときのイージングをJavaScriptのタイマーで強引にやって、
				もっとさくさく歩くようにしました。
				setInterval で角度をちょっとずつ動かしています。
				&#62;&#62;text
				JAVASCRIPT:
				
				
				
				// onEnterFrame的になめらかに曲がる
				function yawPan&#40;&#41;&#123;
				&#160; &#160; &#160;var pov = streetPanorama.getPOV&#40;&#41;;
				&#160; &#160; &#160;if&#40;Math.abs&#40; nowYaw - nextYaw &#41; &#60;5 &#41;&#123;
				&#160; &#160; &#160; &#160; &#160;clearInterval&#40;yawInterval&#41;;
				&#160; &#160; &#160; &#160; &#160;moveNextPanorama&#40;&#41;;
				&#160; &#160; &#160;&#125;else&#123;
				&#160; &#160; &#160; &#160; &#160;nowYaw += &#40;nextYaw - nowYaw&#41; * 0.2;
				&#160; &#160; &#160; &#160; &#160;pov.yaw = nowYaw;
				&#160; &#160; &#160; &#160; &#160;streetPanorama.setPOV&#40;pov&#41;;
				&#160; &#160; &#160;&#125;
				&#125; 
				
				
				
				
				たまに隣のポジションの緯度経度の取得に失敗することがあるようですが、
				基本的には、ほっとくとどこまでも歩いていきます。
				緯度経度取得に頼らないで、panoIDで隣を取得していくように変えようかしら。
				↓以下ソース全部
				&#62;&#62;text
				JAVASCRIPT:
				
				
				
				var lastPanoId = null;&#160; &#160; &#160;  [...]]]></description>
			<content:encoded><![CDATA[				<p><a href="http://parpue.net/?p=196">前作ったやつ</a>を、もうちょっと作りこみ。<br />
				曲がるときもっとスムーズに曲がってくれるようにして、歩くスピードをアップ。</p>
				<p>ちょっとコレで、ゲームなぞ作ってみようかなーとか。</p>
				<p>FlashPlayer9必須みたいです。<br />
				環境によってはすごい重いかもしれません。</p>
				<p>↓実行サンプルとソース<br />
				<span id="more-241"></span></p>
				<div id="pano" style="width:400px;height:300px;border:solid 1px">
				<input type="button" onClick="initMap(35.66188145562874,139.6673360466957);" value="ここをクリックでスタート"/></div>
				<div style="position:relative">
				<div id="map" style="width:400px;height:300px;border:solid 1px;position:relative"></div>
				<div id="girl" style="width:40px;height:60px;position:absolute;top:92px;left:180px"><img src="/common/image/shita.gif"/></div>
				</div>
				<div style="clear:both"></div>
				<p>曲がるときのイージングをJavaScriptのタイマーで強引にやって、<br />
				もっとさくさく歩くようにしました。</p>
				<p>setInterval で角度をちょっとずつ動かしています。</p>
				<div class="igBar"><span id="ljavascript-19"><a href="#" onclick="javascript:showPlainTxt('javascript-19'); return false;">&gt;&gt;text</a></span></div>
				<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
				<div id="javascript-19">
				<div class="javascript">
				<ol style="margin:0px; padding:0px" >
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #009900; font-style: italic;">// onEnterFrame的になめらかに曲がる</span></li>
				<li style="color:#26536A;"><span style="color: #003366; font-weight: bold;">function</span> yawPan<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">var</span> pov = streetPanorama.<span style="color: #006600;">getPOV</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>Math.<span style="color: #006600;">abs</span><span style="color: #66cc66;">&#40;</span> nowYaw - nextYaw <span style="color: #66cc66;">&#41;</span> &lt;<span style="color: #CC0000;color:#800000;">5</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;clearInterval<span style="color: #66cc66;">&#40;</span>yawInterval<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;moveNextPanorama<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nowYaw += <span style="color: #66cc66;">&#40;</span>nextYaw - nowYaw<span style="color: #66cc66;">&#41;</span> * <span style="color: #CC0000;color:#800000;">0</span>.<span style="color: #CC0000;color:#800000;">2</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pov.<span style="color: #006600;">yaw</span> = nowYaw;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;streetPanorama.<span style="color: #006600;">setPOV</span><span style="color: #66cc66;">&#40;</span>pov<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;"><span style="color: #66cc66;">&#125;</span> </li>
				</ol>
				</div>
				</div>
				</div>
				<p>たまに隣のポジションの緯度経度の取得に失敗することがあるようですが、<br />
				基本的には、ほっとくとどこまでも歩いていきます。</p>
				<p>緯度経度取得に頼らないで、panoIDで隣を取得していくように変えようかしら。</p>
				<p>↓以下ソース全部</p>
				<div class="igBar"><span id="ljavascript-20"><a href="#" onclick="javascript:showPlainTxt('javascript-20'); return false;">&gt;&gt;text</a></span></div>
				<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
				<div id="javascript-20">
				<div class="javascript">
				<ol style="margin:0px; padding:0px" >
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #003366; font-weight: bold;">var</span> lastPanoId = <span style="color: #003366; font-weight: bold;">null</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900; font-style: italic;">// 最後にいた場所のPanoID</span></li>
				<li style="color:#26536A;"><span style="color: #003366; font-weight: bold;">var</span> nowLatLng;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #003366; font-weight: bold;">var</span> map;</li>
				<li style="color:#26536A;"><span style="color: #003366; font-weight: bold;">var</span> streetViewClient;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #003366; font-weight: bold;">var</span> streetPanorama;</li>
				<li style="color:#26536A;"><span style="color: #003366; font-weight: bold;">var</span> nextYaw;&nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// 次に向かう方向</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #003366; font-weight: bold;">var</span> nowYaw;</li>
				<li style="color:#26536A;">&nbsp;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #003366; font-weight: bold;">var</span> moveInterval; <span style="color: #009900; font-style: italic;">// 移動のインターバル用</span></li>
				<li style="color:#26536A;"><span style="color: #003366; font-weight: bold;">var</span> yawInterval;&nbsp; <span style="color: #009900; font-style: italic;">// 向きを変えてから移動するため</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #003366; font-weight: bold;">function</span> initMap<span style="color: #66cc66;">&#40;</span>lat, lng<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp;map = <span style="color: #003366; font-weight: bold;">new</span> GMap2<span style="color: #66cc66;">&#40;</span>document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"map"</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp;map.<span style="color: #006600;">disableDragging</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">var</span> ctrlObj = <span style="color: #003366; font-weight: bold;">new</span> GMapTypeControl<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">var</span> pos = <span style="color: #003366; font-weight: bold;">new</span> GControlPosition<span style="color: #66cc66;">&#40;</span>G_ANCHOR_BOTTOM_RIGHT, <span style="color: #003366; font-weight: bold;">new</span> GSize<span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;color:#800000;">5</span>, <span style="color: #CC0000;color:#800000;">15</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp;map.<span style="color: #006600;">addControl</span><span style="color: #66cc66;">&#40;</span>ctrlObj, pos<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp;map.<span style="color: #006600;">setCenter</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #66cc66;">&#40;</span>lat, lng<span style="color: #66cc66;">&#41;</span>, <span style="color: #CC0000;color:#800000;">18</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp;initPanorama<span style="color: #66cc66;">&#40;</span>lat, lng<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #003366; font-weight: bold;">function</span> initPanorama<span style="color: #66cc66;">&#40;</span>lat, lng<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp;streetViewClient = <span style="color: #003366; font-weight: bold;">new</span> GStreetviewClient;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp;streetPanorama = <span style="color: #003366; font-weight: bold;">new</span> GStreetviewPanorama<span style="color: #66cc66;">&#40;</span>document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"pano"</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp;nowLatLng = <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #66cc66;">&#40;</span>lat, lng<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp;streetViewClient.<span style="color: #006600;">getNearestPanoramaLatLng</span><span style="color: #66cc66;">&#40;</span>nowLatLng, <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>latlng<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>latlng == <span style="color: #003366; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"pano"</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">style</span>.<span style="color: #006600;">display</span> = <span style="color: #3366CC;">"none"</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; nowLatLng = latlng;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; streetPanorama.<span style="color: #006600;">setLocationAndPOV</span><span style="color: #66cc66;">&#40;</span>nowLatLng, <span style="color: #66cc66;">&#123;</span>yaw: <span style="color: #CC0000;color:#800000;">180</span>, pitch: <span style="color: #CC0000;color:#800000;">0</span>, zoom: -<span style="color: #CC0000;color:#800000;">1</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>; </li>
				<li style="color:#26536A;">&nbsp;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #009900; font-style: italic;">/* 移動時に手動で変更</span></li>
				<li style="color:#26536A;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; GEvent.addListener(streetPanorama, </span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;yawchanged&quot;, </span></li>
				<li style="color:#26536A;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; function(yaw){</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; changeYaw(yaw);</span></li>
				<li style="color:#26536A;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; });&nbsp; &nbsp; &nbsp; &nbsp;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #009900; font-style: italic;">*/</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// 3秒後に移動</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; moveInterval = setInterval<span style="color: #66cc66;">&#40;</span>toNextPanorama, <span style="color: #CC0000;color:#800000;">2000</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;"><span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;"><span style="color: #003366; font-weight: bold;">function</span> changeYaw<span style="color: #66cc66;">&#40;</span>yaw<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> gifFile;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> yaw&gt; <span style="color: #CC0000;color:#800000;">360</span> <span style="color: #66cc66;">&#41;</span> yaw -= <span style="color: #CC0000;color:#800000;">360</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> yaw&gt;= <span style="color: #CC0000;color:#800000;">315</span> || yaw &lt;<span style="color: #CC0000;color:#800000;">45</span>&nbsp; <span style="color: #66cc66;">&#41;</span> gifFile = <span style="color: #3366CC;">"/common/image/ue.gif"</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> yaw&gt;= <span style="color: #CC0000;color:#800000;">45</span> &amp;&amp; yaw &lt; <span style="color: #CC0000;color:#800000;">135</span> <span style="color: #66cc66;">&#41;</span> gifFile = <span style="color: #3366CC;">"/common/image/migi.gif"</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> yaw&gt;= <span style="color: #CC0000;color:#800000;">135</span> &amp;&amp; yaw &lt; <span style="color: #CC0000;color:#800000;">225</span> <span style="color: #66cc66;">&#41;</span> gifFile = <span style="color: #3366CC;">"/common/image/shita.gif"</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> yaw&gt;= <span style="color: #CC0000;color:#800000;">225</span> || yaw &lt;<span style="color: #CC0000;color:#800000;">315</span> <span style="color: #66cc66;">&#41;</span> gifFile = <span style="color: #3366CC;">"/common/image/hidari.gif"</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"girl"</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">innerHTML</span> = <span style="color: #3366CC;">'&lt;img src=&quot;'</span>+ gifFile +<span style="color: #3366CC;">'&quot; alt=&quot;gial&quot;/&gt;'</span>;</li>
				<li style="color:#26536A;"><span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;"><span style="color: #009900; font-style: italic;">// 現在の表示位置から一番近いStreetViewDataを取得し、そこから隣接するパノラマに移動する</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #003366; font-weight: bold;">function</span> toNextPanorama<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp;clearInterval<span style="color: #66cc66;">&#40;</span>moveInterval<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp;<span style="color: #009900; font-style: italic;">// 現在の表示位置の緯度経度を取得</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp;streetViewClient.<span style="color: #006600;">getNearestPanorama</span><span style="color: #66cc66;">&#40;</span>nowLatLng, <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>streetData<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> neighbourCount = streetData.<span style="color: #006600;">links</span>.<span style="color: #006600;">length</span>; <span style="color: #009900; font-style: italic;">// 隣接するパノラマの数</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> nextPanoId; <span style="color: #009900; font-style: italic;">// 次に向かうパノラマのID</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>neighbourCount == <span style="color: #CC0000;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// 隣接するパノラマが１つだった場合はそこへ移動</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nextYaw = streetData.<span style="color: #006600;">links</span><span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">yaw</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;nextPanoId = streetData.<span style="color: #006600;">links</span><span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">panoId</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">while</span><span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;i = Math.<span style="color: #006600;">floor</span><span style="color: #66cc66;">&#40;</span> Math.<span style="color: #006600;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> * neighbourCount <span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>lastPanoId != streetData.<span style="color: #006600;">links</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">panoId</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nextPanoId = streetData.<span style="color: #006600;">links</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">panoId</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nextYaw = streetData.<span style="color: #006600;">links</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">yaw</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">break</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; lastPanoId = streetData.<span style="color: #006600;">location</span>.<span style="color: #006600;">panoId</span>;&nbsp; &nbsp; &nbsp;<span style="color: #009900; font-style: italic;">// 今いた場所を覚えておく</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; streetViewClient.<span style="color: #006600;">getPanoramaById</span><span style="color: #66cc66;">&#40;</span> nextPanoId,</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>nextStreetData<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nowLatLng = nextStreetData.<span style="color: #006600;">location</span>.<span style="color: #006600;">latlng</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> pov = streetPanorama.<span style="color: #006600;">getPOV</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nowYaw = pov.<span style="color: #006600;">yaw</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>nowYaw&gt; <span style="color: #CC0000;color:#800000;">360</span><span style="color: #66cc66;">&#41;</span> nowYaw -= <span style="color: #CC0000;color:#800000;">360</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>Math.<span style="color: #006600;">abs</span><span style="color: #66cc66;">&#40;</span>nowYaw - nextYaw<span style="color: #66cc66;">&#41;</span>&gt; <span style="color: #CC0000;color:#800000;">180</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>nowYaw&gt; nextYaw<span style="color: #66cc66;">&#41;</span> nextYaw += <span style="color: #CC0000;color:#800000;">360</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span> nowYaw += <span style="color: #CC0000;color:#800000;">360</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; yawInterval = setInterval<span style="color: #66cc66;">&#40;</span>yawPan, <span style="color: #CC0000;color:#800000;">100</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp;<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;"><span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;"><span style="color: #009900; font-style: italic;">// onEnterFrame的になめらかに曲がる</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #003366; font-weight: bold;">function</span> yawPan<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">var</span> pov = streetPanorama.<span style="color: #006600;">getPOV</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>Math.<span style="color: #006600;">abs</span><span style="color: #66cc66;">&#40;</span> nowYaw - nextYaw <span style="color: #66cc66;">&#41;</span> &lt;<span style="color: #CC0000;color:#800000;">5</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;clearInterval<span style="color: #66cc66;">&#40;</span>yawInterval<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;moveNextPanorama<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nowYaw += <span style="color: #66cc66;">&#40;</span>nextYaw - nowYaw<span style="color: #66cc66;">&#41;</span> * <span style="color: #CC0000;color:#800000;">0</span>.<span style="color: #CC0000;color:#800000;">2</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pov.<span style="color: #006600;">yaw</span> = nowYaw;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;streetPanorama.<span style="color: #006600;">setPOV</span><span style="color: #66cc66;">&#40;</span>pov<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #003366; font-weight: bold;">function</span> moveNextPanorama<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; clearInterval<span style="color: #66cc66;">&#40;</span>yawInterval<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// さらに次のポイントへ移動へ</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; map.<span style="color: #006600;">panTo</span><span style="color: #66cc66;">&#40;</span>nowLatLng<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// 移動</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">　　changeYaw<span style="color: #66cc66;">&#40;</span>nextYaw<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; streetPanorama.<span style="color: #006600;">followLink</span><span style="color: #66cc66;">&#40;</span>nextYaw<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; moveInterval = setInterval<span style="color: #66cc66;">&#40;</span>toNextPanorama, <span style="color: #CC0000;color:#800000;">1500</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;"><span style="color: #66cc66;">&#125;</span> </li>
				</ol>
				</div>
				</div>
				</div>
]]></content:encoded>
			<wfw:commentRss>http://parpue.net/web/241/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Googleストリートビューで勝手に下北沢周辺を散歩するやつ作ってみた</title>
		<link>http://parpue.net/web/196</link>
		<comments>http://parpue.net/web/196#comments</comments>
		<pubDate>Wed, 06 Aug 2008 09:59:44 +0000</pubDate>
		<dc:creator>okm</dc:creator>
				<category><![CDATA[WEB]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[デザイン]]></category>
		<category><![CDATA[googlemaps]]></category>
		<category><![CDATA[ストリートビュー]]></category>

		<guid isPermaLink="false">http://parpue.net/?p=196</guid>
		<description><![CDATA[				
				Googleストリートビュー、日本地域も対応して、にぎやかな事になってますね。
				自分の住んでるところとか、なつかしのあの場所とか見ると本当におもしろい！
				周囲を360度パノラマで見ること [...]]]></description>
			<content:encoded><![CDATA[				<p><img src="http://parpue.net/wp-content/uploads/street.png" alt="" title="street" width="453" height="170" class="alignnone size-full wp-image-197" /></p>
				<p>Googleストリートビュー、日本地域も対応して、にぎやかな事になってますね。<br />
				自分の住んでるところとか、なつかしのあの場所とか見ると本当におもしろい！</p>
				<p>周囲を360度パノラマで見ることができることにもびっくりです。</p>
				<p>というわけで、さっそくGoogleMapsと、このストリートビューを使って、<br />
				下北界隈を勝手に散歩するようなものを作ってみた。</p>
				<p>↓以下続き<br />
				<span id="more-196"></span></p>
				<div style="padding-left:20px">
				<table>
				<tr>
				<td>
				<div id="pano" style="width:360px;height:300px;border:solid 1px">
				<input type="button" onClick="initMap(35.66188145562874,139.6673360466957);" value="ここをクリックでスタート"/></div>
				</td>
				<td>
				<div style="position:relative">
				<div id="map" style="width:360px;height:300px;border:solid 1px;position:relative"></div>
				<div id="girl" style="width:40px;height:60px;position:absolute;top:120px;left:160px"><img src="/common/image/shita.gif"/></div>
				</div>
				<div style="clear:both"></div>
				</td>
				</tr>
				</table>
				</div>
				<p>画像は、<b>マウスドラッグやアイコンクリックで回転</b>することができます。<br />
				<b>キャラクタが向いている方向が、表示されている画像の方向</b>です。<br />
				<b>移動については制御不能です。勝手に散歩し続けます。</b></p>
				<p>まだリファレンスの日本語化ができていないようなので、<br />
				→<a href="http://code.google.com/intl/en/apis/maps/documentation/reference.html" target="_blank">http://code.google.com/intl/en/apis/maps/documentation/reference.html</a>　<br />
				を読みながら作ってみました。</p>
				<p>独特な関数が多かったですが、作ってて面白かったです。</p>
				<p>今回目をつけたのが、GStreetviewDataクラスのlinkパラメータ。<br />
				「Array of GStreetviewLink」<br />
				Links to neighbouring panoramas, if any. (Since 2.104)</p>
				<p>とあり、<strong>お隣のパノラマ画像がある位置の情報</strong>が取れるようです。</p>
				<p>あとは迷路プログラムのような感じで作り上げました。</p>
				<p>現在位置から移動できる隣接のポイントを取得<br />
				　↓<br />
				取得したもののうち、前いたポイントではないものを選択して移動</p>
				<p>コレを繰り返すことによって、<br />
				直線を進み、交差点ではランダムに曲がります。</p>
				<p>以下ソースコード全文です。initMap(緯度、経度)でお散歩スタートです。</p>
				<div class="igBar"><span id="ljavascript-22"><a href="#" onclick="javascript:showPlainTxt('javascript-22'); return false;">&gt;&gt;text</a></span></div>
				<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
				<div id="javascript-22">
				<div class="javascript">
				<ol style="margin:0px; padding:0px" >
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #003366; font-weight: bold;">var</span> lastPanoId = <span style="color: #003366; font-weight: bold;">null</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900; font-style: italic;">// 最後にいた場所のPanoID</span></li>
				<li style="color:#26536A;"><span style="color: #003366; font-weight: bold;">var</span> nowLatLng;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #003366; font-weight: bold;">var</span> map;</li>
				<li style="color:#26536A;"><span style="color: #003366; font-weight: bold;">var</span> streetViewClient;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #003366; font-weight: bold;">var</span> streetPanorama;</li>
				<li style="color:#26536A;"><span style="color: #003366; font-weight: bold;">var</span> moveInterval;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;"><span style="color: #003366; font-weight: bold;">function</span> initMap<span style="color: #66cc66;">&#40;</span>lat, lng<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp;map = <span style="color: #003366; font-weight: bold;">new</span> GMap2<span style="color: #66cc66;">&#40;</span>document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"map"</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp;map.<span style="color: #006600;">disableDragging</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">var</span> ctrlObj = <span style="color: #003366; font-weight: bold;">new</span> GMapTypeControl<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">var</span> pos = <span style="color: #003366; font-weight: bold;">new</span> GControlPosition<span style="color: #66cc66;">&#40;</span>G_ANCHOR_BOTTOM_RIGHT, <span style="color: #003366; font-weight: bold;">new</span> GSize<span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;color:#800000;">5</span>, <span style="color: #CC0000;color:#800000;">15</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp;map.<span style="color: #006600;">addControl</span><span style="color: #66cc66;">&#40;</span>ctrlObj, pos<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp;map.<span style="color: #006600;">setCenter</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #66cc66;">&#40;</span>lat, lng<span style="color: #66cc66;">&#41;</span>, <span style="color: #CC0000;color:#800000;">18</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp;initPanorama<span style="color: #66cc66;">&#40;</span>lat, lng<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;"><span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;"><span style="color: #003366; font-weight: bold;">function</span> initPanorama<span style="color: #66cc66;">&#40;</span>lat, lng<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp;streetViewClient = <span style="color: #003366; font-weight: bold;">new</span> GStreetviewClient;</li>
				<li style="color:#26536A;">&nbsp; &nbsp;streetPanorama = <span style="color: #003366; font-weight: bold;">new</span> GStreetviewPanorama<span style="color: #66cc66;">&#40;</span>document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"pano"</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp;nowLatLng = <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #66cc66;">&#40;</span>lat, lng<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp;streetViewClient.<span style="color: #006600;">getNearestPanoramaLatLng</span><span style="color: #66cc66;">&#40;</span>nowLatLng, <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>latlng<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>latlng == <span style="color: #003366; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"pano"</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">style</span>.<span style="color: #006600;">display</span> = <span style="color: #3366CC;">"none"</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">return</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp;nowLatLng = latlng;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp;streetPanorama.<span style="color: #006600;">setLocationAndPOV</span><span style="color: #66cc66;">&#40;</span>nowLatLng, <span style="color: #66cc66;">&#123;</span>yaw: <span style="color: #CC0000;color:#800000;">180</span>, pitch: <span style="color: #CC0000;color:#800000;">0</span>, zoom: -<span style="color: #CC0000;color:#800000;">1</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp;GEvent.<span style="color: #006600;">addListener</span><span style="color: #66cc66;">&#40;</span>streetPanorama,</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">"yawchanged"</span>,</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>yaw<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; changeYaw<span style="color: #66cc66;">&#40;</span>yaw<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// 3秒後に移動</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; moveInterval = setInterval<span style="color: #66cc66;">&#40;</span>toNextPanorama, <span style="color: #CC0000;color:#800000;">3000</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #003366; font-weight: bold;">function</span> changeYaw<span style="color: #66cc66;">&#40;</span>yaw<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> gifFile;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> yaw&gt;= <span style="color: #CC0000;color:#800000;">315</span> || yaw &lt;<span style="color: #CC0000;color:#800000;">45</span>&nbsp; <span style="color: #66cc66;">&#41;</span> gifFile = <span style="color: #3366CC;">"/common/image/ue.gif"</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> yaw&gt;= <span style="color: #CC0000;color:#800000;">45</span> &amp;&amp; yaw &lt;<span style="color: #CC0000;color:#800000;">135</span> <span style="color: #66cc66;">&#41;</span> gifFile = <span style="color: #3366CC;">"/common/image/migi.gif"</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> yaw&gt;= <span style="color: #CC0000;color:#800000;">135</span> &amp;&amp; yaw &lt;<span style="color: #CC0000;color:#800000;">225</span> <span style="color: #66cc66;">&#41;</span> gifFile = <span style="color: #3366CC;">"/common/image/shita.gif"</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> yaw&gt;= <span style="color: #CC0000;color:#800000;">225</span> || yaw &lt;<span style="color: #CC0000;color:#800000;">315</span> <span style="color: #66cc66;">&#41;</span> gifFile = <span style="color: #3366CC;">"/common/image/hidari.gif"</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"girl"</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">innerHTML</span> = <span style="color: #3366CC;">'&lt;img src=&quot;'</span>+ gifFile +<span style="color: #3366CC;">'&quot; alt=&quot;gial&quot;/&gt;'</span>;</li>
				<li style="color:#26536A;"><span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;"><span style="color: #009900; font-style: italic;">// 現在の表示位置から一番近いStreetViewDataを取得し、そこから隣接するパノラマに移動する</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #003366; font-weight: bold;">function</span> toNextPanorama<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; clearInterval<span style="color: #66cc66;">&#40;</span>moveInterval<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// 現在の表示位置の緯度経度を取得</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; streetViewClient.<span style="color: #006600;">getNearestPanorama</span><span style="color: #66cc66;">&#40;</span>nowLatLng, <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>streetData<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> neighbourCount = streetData.<span style="color: #006600;">links</span>.<span style="color: #006600;">length</span>; <span style="color: #009900; font-style: italic;">// 隣接するパノラマの数</span></li>
				<li style="color:#26536A;">&nbsp;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> nextYaw; <span style="color: #009900; font-style: italic;">// 次に向かう方向</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> nextPanoId; <span style="color: #009900; font-style: italic;">// 次に向かうパノラマのID</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>neighbourCount == <span style="color: #CC0000;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// 隣接するパノラマが１つだった場合はそこへ移動</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nextYaw = streetData.<span style="color: #006600;">links</span><span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">yaw</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nextPanoId = streetData.<span style="color: #006600;">links</span><span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">panoId</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">while</span><span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;i = Math.<span style="color: #006600;">floor</span><span style="color: #66cc66;">&#40;</span> Math.<span style="color: #006600;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> * neighbourCount <span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>lastPanoId != streetData.<span style="color: #006600;">links</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">panoId</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nextPanoId = streetData.<span style="color: #006600;">links</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">panoId</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nextYaw = streetData.<span style="color: #006600;">links</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">yaw</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">break</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; lastPanoId = streetData.<span style="color: #006600;">location</span>.<span style="color: #006600;">panoId</span>;&nbsp; &nbsp; &nbsp;<span style="color: #009900; font-style: italic;">// 今いた場所を覚えておく</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; streetViewClient.<span style="color: #006600;">getPanoramaById</span><span style="color: #66cc66;">&#40;</span> nextPanoId,</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>nextStreetData<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nowLatLng = nextStreetData.<span style="color: #006600;">location</span>.<span style="color: #006600;">latlng</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// 目的地へGO！</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//streetPanorama.setLocationAndPOV( nowLatLng, {yaw:nextYaw, pitch:0, zoom:-1});</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; streetPanorama.<span style="color: #006600;">followLink</span><span style="color: #66cc66;">&#40;</span>nextYaw<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; map.<span style="color: #006600;">panTo</span><span style="color: #66cc66;">&#40;</span>nowLatLng<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//streetPanorama.setPOV({yaw:nextYaw, pitch:0, zoom:-1});</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; moveInterval = setInterval<span style="color: #66cc66;">&#40;</span>toNextPanorama, <span style="color: #CC0000;color:#800000;">3000</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp;<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #66cc66;">&#125;</span> </li>
				</ol>
				</div>
				</div>
				</div>
				<p>ちなみにコレを応用したものを <a href="http://millon.jp/map/shimokita" target="_blank">millon</a> でも利用してみました。</p>
]]></content:encoded>
			<wfw:commentRss>http://parpue.net/web/196/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>GoogleMaps にカスタムウィンドウを表示する。</title>
		<link>http://parpue.net/web/71</link>
		<comments>http://parpue.net/web/71#comments</comments>
		<pubDate>Wed, 23 Jul 2008 07:26:47 +0000</pubDate>
		<dc:creator>okm</dc:creator>
				<category><![CDATA[WEB]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[millon]]></category>
		<category><![CDATA[googlemaps]]></category>

		<guid isPermaLink="false">http://parpue.net/?p=71</guid>
		<description><![CDATA[				ここで書いた記事の転載と、補足
				Google Maps API には、InfoWindowという、
				地図上にウィンドウを表示するための機能が備わっています。
				このウィンドウは地図上に情報を [...]]]></description>
			<content:encoded><![CDATA[				<p><a href="http://www.opensource.co.jp/techdept.php/item/322">ここ</a>で書いた記事の転載と、補足</p>
				<p>Google Maps API には、InfoWindowという、<br />
				地図上にウィンドウを表示するための機能が備わっています。</p>
				<p>このウィンドウは地図上に情報を表示する分には、<br />
				十分な機能を持っています。</p>
				<p>しかし<a href="http://millon.jp/map/">millon.jp</a>で使用するにあたって、サイトのイメージと<br />
				表示されるウィンドウのイメージが若干合わなかったため、<br />
				自分でデザインしたウィンドウを表示しました。<br />
				<img src="http://parpue.net/wp-content/uploads/g1.png" alt="g1" title="g1" width="287" height="284" class="size-full wp-image-86" /><br />
				google maps のinfowindow<br />
				<img src="http://parpue.net/wp-content/uploads/g2.png" alt="自分でつくったウィンドウ" title="g2" width="261" height="185" class="size-full wp-image-87" /><br />
				自分で作ったウィンドウを表示</p>
				<p>GoogleMaps は画像やHTML要素を、オーバーレイ要素として<br />
				地図上に貼り付けることができます。</p>
				<p>その機能を用いて、DIV要素を独自のウィンドウとしてGoogleMaps上に貼り付けます。</p>
				<p><span id="more-71"></span></p>
				<p>実行テスト</p>
				<div style="position:relative">
				<div id="map" style="width:400px;height:400px;border:solid 1px">
				</div>
				<div id="ci_div" style="position:absolute;width:100px;height:100px;border:solid 1px;background-color:#FFF;display:none">カスタムウィンドウです！</div>
				</div>
				<div id="first_click"><a href="javascript:;" onClick="showMap();">■最初にここをクリックして地図を表示■</a></div>
				<div id="second_click" style="display:none">
				<a href="javascript:;" onClick="openWindowLatLng('渋谷です',35.67431,139.69082)">■渋谷駅の緯度経度に表示■</a><br />
				<a href="javascript:;" onClick="closeWindow()">■ウィンドウ非表示■</a>
				</div>
				<p>カスタムウィンドウの表示のための手順ですが、<br />
				まずは<strong>地図や、カスタムウィンドウとして表示するDIV</strong>を準備しておきます。</p>
				<div class="igBar"><span id="lhtml-26"><a href="#" onclick="javascript:showPlainTxt('html-26'); return false;">&gt;&gt;text</a></span></div>
				<div class="syntax_hilite"><span class="langName">HTML:</span>
				<div id="html-26">
				<div class="html">
				<ol style="margin:0px; padding:0px" >
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">"position:relative"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></li>
				<li style="color:#26536A;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"map"</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">"width:400px;height:400px;"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></li>
				<li style="color:#26536A;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"ci_div"</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">"position:absolute;width:100px;height:100px;border:solid 1px;background-color:#FFF;"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>カスタムウィンドウです！<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span> </li>
				</ol>
				</div>
				</div>
				</div>
				<p>
				* ピクセル位置でカスタムウィンドウの位置を指定する必要があるため、<br />
				一番外側を position="relative"を指定したDIVで囲む必要があります。</p>
				<p>GoogleMaps APIで定義されている<strong>GOverLayインターフェースを実装したクラス</strong>を作成します。<br />
				このクラスのインスタンスをaddOverlayすることで、<br />
				GoogleMap上にオーバーレイとして貼り付けることができます。</p>
				<div class="igBar"><span id="ljavascript-27"><a href="#" onclick="javascript:showPlainTxt('javascript-27'); return false;">&gt;&gt;text</a></span></div>
				<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
				<div id="javascript-27">
				<div class="javascript">
				<ol style="margin:0px; padding:0px" >
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #009900; font-style: italic;">// 地図の表示</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; map = <span style="color: #003366; font-weight: bold;">new</span> GMap2<span style="color: #66cc66;">&#40;</span>document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"map"</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; map.<span style="color: #006600;">setCenter</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;color:#800000;">35</span>.<span style="color: #CC0000;color:#800000;">67431</span>, <span style="color: #CC0000;color:#800000;">139</span>.<span style="color: #CC0000;color:#800000;">69082</span><span style="color: #66cc66;">&#41;</span>,<span style="color: #CC0000;color:#800000;">13</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// オーバーレイ用のDIV</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> customInfoDIV = document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"ci_div"</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// GOverlayインターフェースを実装するcustomBoxクラスを作成</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">function</span> customBox<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; customBox.<span style="color: #006600;">prototype</span> = <span style="color: #003366; font-weight: bold;">new</span> GOverlay<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; customBox.<span style="color: #006600;">prototype</span>.<span style="color: #006600;">initialize</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>map<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// GoogleMap上に定義されているPaneのうち、マーカーと同じ高さに</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// カスタムウィンドウ用のDIVを追加。</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; map.<span style="color: #006600;">getPane</span><span style="color: #66cc66;">&#40;</span>G_MAP_MARKER_PANE<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">appendChild</span><span style="color: #66cc66;">&#40;</span>customInfoDIV<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; customInfoDIV.<span style="color: #006600;">style</span>.<span style="color: #006600;">zIndex</span> = <span style="color: #CC0000;color:#800000;">300000</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; customBox.<span style="color: #006600;">prototype</span>.<span style="color: #006600;">remove</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; map.<span style="color: #006600;">getPane</span><span style="color: #66cc66;">&#40;</span>G_MAP_MARKER_PANE<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">removeChild</span><span style="color: #66cc66;">&#40;</span>customInfoDIV<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; customBox.<span style="color: #006600;">prototype</span>.<span style="color: #006600;">copy</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">new</span> customBox<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; customBox.<span style="color: #006600;">prototype</span>.<span style="color: #006600;">redraw</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>force<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// customBoxをオーバーレイとして貼り付ける</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; customInfoWindow = <span style="color: #003366; font-weight: bold;">new</span> customBox<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; map.<span style="color: #006600;">addOverlay</span><span style="color: #66cc66;">&#40;</span>customInfoWindow<span style="color: #66cc66;">&#41;</span>; </li>
				</ol>
				</div>
				</div>
				</div>
				<p>GMap2.getPaneでGoogleMaps上で定義されているレイアにアクセスすることができますので、<br />
				今回は、マーカーが表示されるレイアと同じ高さにウィンドウが表示されるようにしています。<br />
				では、この貼り付けたオーバーレイを操作できる関数を用意して、<br />
				InfoWindowのような動きをさせれば完成です。</p>
				<div class="igBar"><span id="ljavascript-28"><a href="#" onclick="javascript:showPlainTxt('javascript-28'); return false;">&gt;&gt;text</a></span></div>
				<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
				<div id="javascript-28">
				<div class="javascript">
				<ol style="margin:0px; padding:0px" >
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #009900; font-style: italic;">// 指定位置の緯度経度にウィンドウ表示</span></li>
				<li style="color:#26536A;"><span style="color: #003366; font-weight: bold;">function</span> openWindowLatLng<span style="color: #66cc66;">&#40;</span>msg, lat, lng<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> marker_pixls = map.<span style="color: #006600;">fromLatLngToDivPixel</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #66cc66;">&#40;</span>lat, lng<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> x = marker_pixls.<span style="color: #006600;">x</span> ;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> y = marker_pixls.<span style="color: #006600;">y</span> ;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; openWindowXY<span style="color: #66cc66;">&#40;</span>msg, marker_pixls.<span style="color: #006600;">x</span>, marker_pixls.<span style="color: #006600;">y</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #009900; font-style: italic;">// 指定のピクセル位置にウィンドウ表示</span></li>
				<li style="color:#26536A;"><span style="color: #003366; font-weight: bold;">function</span> openWindowXY<span style="color: #66cc66;">&#40;</span>msg, x, y<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp;map.<span style="color: #006600;">removeOverlay</span><span style="color: #66cc66;">&#40;</span>customInfoWindow<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp;customInfoDIV.<span style="color: #006600;">style</span>.<span style="color: #006600;">display</span> = <span style="color: #3366CC;">"block"</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp;customInfoDIV.<span style="color: #006600;">style</span>.<span style="color: #006600;">zIndex</span> = <span style="color: #CC0000;color:#800000;">4000000</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp;customInfoDIV.<span style="color: #006600;">style</span>.<span style="color: #006600;">postion</span> = <span style="color: #3366CC;">"absolute"</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp;customInfoDIV.<span style="color: #006600;">style</span>.<span style="color: #006600;">top</span> = y + <span style="color: #3366CC;">"px"</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp;customInfoDIV.<span style="color: #006600;">style</span>.<span style="color: #006600;">left</span> = x + <span style="color: #3366CC;">"px"</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp;customInfoDIV.<span style="color: #006600;">innerHTML</span> = msg;</li>
				<li style="color:#26536A;">&nbsp; &nbsp;map.<span style="color: #006600;">addOverlay</span><span style="color: #66cc66;">&#40;</span>customInfoWindow<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #009900; font-style: italic;">// ウィンドウ閉じる</span></li>
				<li style="color:#26536A;"><span style="color: #003366; font-weight: bold;">function</span> closeWindow<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp;map.<span style="color: #006600;">removeOverlay</span><span style="color: #66cc66;">&#40;</span>customInfoWindow<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;"><span style="color: #66cc66;">&#125;</span> </li>
				</ol>
				</div>
				</div>
				</div>
				<p>DIVを装飾してウィンドウとし、好きな位置に表示することができるようになります。</p>
				<p>＊ただし、このウィンドウは地図のスクロールには追従しますが、<br />
				拡大率が変わった場合には、ピクセル位置の指定が緯度経度とずれてしまいます。<br />
				そのため、ズームのイベント時に再表示する必要があります。</p>
]]></content:encoded>
			<wfw:commentRss>http://parpue.net/web/71/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordpress に addthis を追加</title>
		<link>http://parpue.net/wordpress/37</link>
		<comments>http://parpue.net/wordpress/37#comments</comments>
		<pubDate>Wed, 09 Jul 2008 03:35:39 +0000</pubDate>
		<dc:creator>okm</dc:creator>
				<category><![CDATA[WEB]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[addthis]]></category>

		<guid isPermaLink="false">http://parpue.net/?p=37</guid>
		<description><![CDATA[				してみた。
				有名なソーシャルブックマークへのリンクをつけるやつです。
				■addthis
				JavaScriptで、オーバーレイ表示。
				addthisで配布しているプラグインとコードだ [...]]]></description>
			<content:encoded><![CDATA[				<p>してみた。<br />
				有名なソーシャルブックマークへのリンクをつけるやつです。</p>
				<p>■<a href="http://www.addthis.com/">addthis</a></p>
				<p>JavaScriptで、オーバーレイ表示。</p>
				<p>addthisで配布しているプラグインとコードだとちょっと不十分だったので、<br />
				wordpressテンプレートに以下のように書いて表示確認。</p>
				<div class="igBar"><span id="ljavascript-30"><a href="#" onclick="javascript:showPlainTxt('javascript-30'); return false;">&gt;&gt;text</a></span></div>
				<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
				<div id="javascript-30">
				<div class="javascript">
				<ol style="margin:0px; padding:0px" >
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&lt;script type=<span style="color: #3366CC;">"text/javascript"</span>&gt;</li>
				<li style="color:#26536A;">addthis_pub = <span style="color: #3366CC;">'masahyro'</span>; <span style="color: #009900; font-style: italic;">// 登録したユーザ名</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&lt;/script&gt;</li>
				<li style="color:#26536A;">&lt;a href=<span style="color: #3366CC;">"http://www.addthis.com/bookmark.php"</span> onMouseOver=<span style="color: #3366CC;">"return addthis_open(this, '', '&lt;?php the_permalink();?&gt;', '&lt;?php the_title();?&gt;')"</span> onMouseOut=<span style="color: #3366CC;">"addthis_close()"</span> onClick=<span style="color: #3366CC;">"return addthis_sendto()"</span>&gt;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&lt;!-- ↓それぞれのaddthisのURLは登録時にもらえる --&gt;</li>
				<li style="color:#26536A;">&lt;img src=<span style="color: #3366CC;">"http://xx.addthis.com/button1-bm.gif"</span> width=<span style="color: #3366CC;">"125"</span> height=<span style="color: #3366CC;">"16"</span> border=<span style="color: #3366CC;">"0"</span> alt=<span style="color: #3366CC;">""</span> /&gt;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&lt;/a&gt;&lt;script type=<span style="color: #3366CC;">"text/javascript"</span> src=<span style="color: #3366CC;">"http://xx.addthis.com/js/xxx/addthis_widget.js"</span>&gt;</li>
				<li style="color:#26536A;">&lt;/script&gt; </li>
				</ol>
				</div>
				</div>
				</div>
]]></content:encoded>
			<wfw:commentRss>http://parpue.net/wordpress/37/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ModalBox.js にタイムアウト処理などを加える</title>
		<link>http://parpue.net/web/29</link>
		<comments>http://parpue.net/web/29#comments</comments>
		<pubDate>Tue, 01 Jul 2008 03:37:43 +0000</pubDate>
		<dc:creator>okm</dc:creator>
				<category><![CDATA[WEB]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[millon]]></category>
		<category><![CDATA[modalbox]]></category>

		<guid isPermaLink="false">http://parpue.net/?p=29</guid>
		<description><![CDATA[				■ModalBoxでつくるMacOS X風ダイアログ
				■modalbox.js
				
				このライブラリ、millon.jpで随所に利用しています。
				アップデートも頻繁で、今も進化を続けて [...]]]></description>
			<content:encoded><![CDATA[				<p>■<a href="http://journal.mycom.co.jp/articles/2007/07/26/modalbox/index.html">ModalBoxでつくるMacOS X風ダイアログ</a><br />
				■<a href="http://www.wildbit.com/labs/modalbox/">modalbox.js</a></p>
				<p><a href='http://parpue.net/wp-content/modalbox.png' rel='shadowbox[post-29];player=img;'><img src="http://parpue.net/wp-content/modalbox-300x272.png" alt="modalbox" title="modalbox" width="300" height="272" class="alignnone size-medium wp-image-30" /></a></p>
				<p>このライブラリ、<a href="http://millon.jp/">millon.jp</a>で随所に利用しています。<br />
				アップデートも頻繁で、今も進化を続けているようです。</p>
				<p>サイトで利用する際、新しいリクエストをダイアログに表示する場合、<br />
				データの取得をタイムアウトする処理がなかったので、どうにか追加してみた。<br />
				（進化してるからそのうち追加されそうだけど）</p>
				<p>ModalBoxには↓のようなCallBackが用意されています。(ver.1.6.0)</p>
				<ul>
				<li>beforeLoad - コンテンツロード前に呼ばれる</li>
				<li>afterLoad - コンテンツロード後に呼ばれる</li>
				<li>beforeHide - ダイアログが隠れる前に呼ばれる</li>
				<li>afterHide - ダイアログが隠れた後に呼ばれる</li>
				<li>afterResize - ダイアログのサイズ変更後に呼ばれる</li>
				<li>onShow - ダイアログが表示されたときに呼ばれる</li>
				<li>onUpdate - ダイアログのコンテンツが更新されたときに呼ばれる</li>
				</ul>
				<p>これに タイムアウトなどの処理を加えたいと思います。<br />
				<span id="more-29"></span></p>
				<p>こういう外部のライブラリを使う場合、<br />
				僕はなるべく元ファイルには手を入れず、まるごとラップしたクラスに処理を追加するようにしています。</p>
				<p>Dialoger というModalBoxをラップするような、新しいクラスを作ることにしました。</p>
				<p>クラス定義</p>
				<div class="igBar"><span id="ljavascript-38"><a href="#" onclick="javascript:showPlainTxt('javascript-38'); return false;">&gt;&gt;text</a></span></div>
				<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
				<div id="javascript-38">
				<div class="javascript">
				<ol style="margin:0px; padding:0px" >
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #009900; font-style: italic;">// Dialogerクラス for ModalBox 1.6.0</span></li>
				<li style="color:#26536A;">&nbsp; <span style="color: #003366; font-weight: bold;">function</span> Dialoger<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> ref = <span style="color: #000066; font-weight: bold;">this</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">timeout</span> = <span style="color: #CC0000;color:#800000;">0</span> <span style="color: #009900; font-style: italic;">// msec, if 0, do nothing.</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">timeoutId</span> = <span style="color: #003366; font-weight: bold;">null</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">disableCache</span> = <span style="color: #003366; font-weight: bold;">true</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">beforeLoad</span> = <span style="color: #003366; font-weight: bold;">null</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">afterLoad</span> = <span style="color: #003366; font-weight: bold;">null</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">afterHide</span> = <span style="color: #003366; font-weight: bold;">null</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">afterResize</span> = <span style="color: #003366; font-weight: bold;">null</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">onShow</span> = <span style="color: #003366; font-weight: bold;">null</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">onUpdate</span> = <span style="color: #003366; font-weight: bold;">null</span>;</li>
				<li style="color:#26536A;">&nbsp;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// okm append event for timeout</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">onFail</span> = <span style="color: #003366; font-weight: bold;">null</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">onTimeout</span> = <span style="color: #003366; font-weight: bold;">null</span>; </li>
				</ol>
				</div>
				</div>
				</div>
				<p>
				もともとあるイベントも追加したいイベントも<br />
				メンバー変数として定義します。</p>
				<p>↓ModalBox.show()を動かすためのメンバー関数 show()を作成し、<br />
				その中でタイムアウトのための処理を追加します。<br />
				optionオブジェクトのtimeoutに 0以上の値が入っていた場合、<br />
				タイムアウト処理が有効になるようにします。</p>
				<div class="igBar"><span id="ljavascript-39"><a href="#" onclick="javascript:showPlainTxt('javascript-39'); return false;">&gt;&gt;text</a></span></div>
				<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
				<div id="javascript-39">
				<div class="javascript">
				<ol start="26" style="margin:0px; padding:0px" >
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">show</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>url, option<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">/** add events **/</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; option.<span style="color: #006600;">beforeLoad</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>ref.<span style="color: #006600;">timeout</span>&gt; <span style="color: #CC0000;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ref.<span style="color: #006600;">timeoutId</span> = window.<span style="color: #006600;">setTimeout</span><span style="color: #66cc66;">&#40;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ref.<span style="color: #006600;">onTimeoutHandler</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>,</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ref.<span style="color: #006600;">timeout</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">// setTimeout</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ref.<span style="color: #006600;">beforeLoadHandler</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>; </li>
				</ol>
				</div>
				</div>
				</div>
				<p>
				ついでにshow()の途中に、キャッシュを完全に無効にする場合の処理を追加しています。<br />
				現在のタイムスタンプを、取得するURLの後にパラメータとして追加しています。</p>
				<div class="igBar"><span id="ljavascript-40"><a href="#" onclick="javascript:showPlainTxt('javascript-40'); return false;">&gt;&gt;text</a></span></div>
				<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
				<div id="javascript-40">
				<div class="javascript">
				<ol start="82" style="margin:0px; padding:0px" >
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">disableCache</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; date = <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>option.<span style="color: #006600;">params</span> != <span style="color: #003366; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;option.<span style="color: #006600;">params</span> += <span style="color: #3366CC;">"&amp;"</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;option.<span style="color: #006600;">params</span> = <span style="color: #3366CC;">""</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; option.<span style="color: #006600;">params</span> += <span style="color: #3366CC;">"cahce_="</span> + date.<span style="color: #006600;">getTime</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; option.<span style="color: #006600;">autoFocusing</span> = <span style="color: #003366; font-weight: bold;">false</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Modalbox.<span style="color: #006600;">show</span><span style="color: #66cc66;">&#40;</span>url, option<span style="color: #66cc66;">&#41;</span>; </li>
				</ol>
				</div>
				</div>
				</div>
				<p>↓ タイムアウトした場合は onTimeout を動作させます。</p>
				<div class="igBar"><span id="ljavascript-41"><a href="#" onclick="javascript:showPlainTxt('javascript-41'); return false;">&gt;&gt;text</a></span></div>
				<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
				<div id="javascript-41">
				<div class="javascript">
				<ol start="122" style="margin:0px; padding:0px" >
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">onTimeoutHandler</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; window.<span style="color: #006600;">clearTimeout</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">timeoutId</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">onTimeout</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">onTimeout</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> </li>
				</ol>
				</div>
				</div>
				</div>
				<p>ModalBoxを表示するHTML内に<br />
				実際に Dialogerクラスのインタスタンスを生成して、<br />
				ModalBoxの表示のタイムアウトをハンドルする例です。↓</p>
				<div class="igBar"><span id="ljavascript-42"><a href="#" onclick="javascript:showPlainTxt('javascript-42'); return false;">&gt;&gt;text</a></span></div>
				<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
				<div id="javascript-42">
				<div class="javascript">
				<ol style="margin:0px; padding:0px" >
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&lt;script type=<span style="color: #3366CC;">"text/javascript"</span> src=<span style="color: #3366CC;">"modalbox/lib/prototype.js"</span>&gt;&lt;/script&gt;</li>
				<li style="color:#26536A;">&lt;script type=<span style="color: #3366CC;">"text/javascript"</span> src=<span style="color: #3366CC;">"modalbox/lib/scriptaculous.js?load=effects"</span>&gt;&lt;/script&gt;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&lt;script type=<span style="color: #3366CC;">"text/javascript"</span> src=<span style="color: #3366CC;">"modalbox/modalbox.js"</span>&gt;&lt;/script&gt;</li>
				<li style="color:#26536A;">&lt;link rel=<span style="color: #3366CC;">"stylesheet"</span> href=<span style="color: #3366CC;">"modalbox/modalbox.css"</span> type=<span style="color: #3366CC;">"text/css"</span> media=<span style="color: #3366CC;">"screen"</span> /&gt;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&lt;script type=<span style="color: #3366CC;">"text/javascript"</span> src=<span style="color: #3366CC;">"dialoger.js"</span>&gt;&lt;/script&gt;</li>
				<li style="color:#26536A;">&lt;script type=<span style="color: #3366CC;">"text/javascript"</span>&gt;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&lt;!--</li>
				<li style="color:#26536A;"><span style="color: #003366; font-weight: bold;">var</span> dialoger = <span style="color: #003366; font-weight: bold;">new</span> Dialoger<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">dialoger.<span style="color: #006600;">timeout</span> = <span style="color: #CC0000;color:#800000;">5000</span>; <span style="color: #009900; font-style: italic;">// 5秒でタイムアウト</span></li>
				<li style="color:#26536A;"><span style="color: #009900; font-style: italic;">// タイムアウト処理</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">dialoger.<span style="color: #006600;">onTimeout</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #000066;">alert</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"タイムアウトしました"</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;"><span style="color: #009900; font-style: italic;">// 表示時の処理</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">dialoger.<span style="color: #006600;">onShow</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #000066;">alert</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"とりあえずダイアログを表示！"</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;"><span style="color: #003366; font-weight: bold;">function</span> Test<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> url = <span style="color: #3366CC;">"dialog_timeout.php"</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> option = <span style="color: #003366; font-weight: bold;">new</span> Object;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; option.<span style="color: #006600;">title</span> = <span style="color: #3366CC;">"ダイアログタイムアウトテスト"</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; option.<span style="color: #006600;">width</span> = <span style="color: #CC0000;color:#800000;">400</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; option.<span style="color: #006600;">height</span> = <span style="color: #CC0000;color:#800000;">200</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; dialoger.<span style="color: #006600;">show</span><span style="color: #66cc66;">&#40;</span>url, option<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">--&gt;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&lt;/script&gt; </li>
				</ol>
				</div>
				</div>
				</div>
				<p>■　実行テスト</p>
				<script type="text/javascript">
<!--
var dialoger = new Dialoger();
dialoger.timeout = 5000; // 5秒でタイムアウト
// タイムアウト処理
dialoger.onTimeout = function(){
    alert("タイムアウトしました");
}
// 表示時の処理
dialoger.onShow = function(){
    alert("とりあえずダイアログを表示！");
}
function Test(){
    var url = "/wp-content/mb_timeout/dialog_timeout.php";
    var option = new Object;
    option.title = "ダイアログタイムアウトテスト";
    option.width = 400;
    option.height = 200;
    dialoger.show(url, option);
}
-->
</script>
<a href="#" onClick="Test();">■■ここをクリックでダイアログのタイムアウトテスト■■</a>
				<p>↑ 途中でタイムアウトします。</p>
				<p>いかがでございましょう・・・あんまいろんなブラウザでテストしてないですがｗ</p>
				<p>↓　Dialoger.js の全ソース</p>
				<div class="igBar"><span id="ljavascript-43"><a href="#" onclick="javascript:showPlainTxt('javascript-43'); return false;">&gt;&gt;text</a></span></div>
				<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
				<div id="javascript-43">
				<div class="javascript">
				<ol style="margin:0px; padding:0px" >
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #009900; font-style: italic;">// Dialogerクラス for ModalBox 1.6.0</span></li>
				<li style="color:#26536A;">&nbsp; <span style="color: #003366; font-weight: bold;">function</span> Dialoger<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> ref = <span style="color: #000066; font-weight: bold;">this</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">timeout</span> = <span style="color: #CC0000;color:#800000;">0</span> <span style="color: #009900; font-style: italic;">// msec, if 0, do nothing.</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">timeoutId</span> = <span style="color: #003366; font-weight: bold;">null</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">disableCache</span> = <span style="color: #003366; font-weight: bold;">true</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">beforeLoad</span> = <span style="color: #003366; font-weight: bold;">null</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">afterLoad</span> = <span style="color: #003366; font-weight: bold;">null</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">afterHide</span> = <span style="color: #003366; font-weight: bold;">null</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">afterResize</span> = <span style="color: #003366; font-weight: bold;">null</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">onShow</span> = <span style="color: #003366; font-weight: bold;">null</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">onUpdate</span> = <span style="color: #003366; font-weight: bold;">null</span>;</li>
				<li style="color:#26536A;">&nbsp;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// okm append event for timeout</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">onFail</span> = <span style="color: #003366; font-weight: bold;">null</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">onTimeout</span> = <span style="color: #003366; font-weight: bold;">null</span>;</li>
				<li style="color:#26536A;">&nbsp;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">width</span> = <span style="color: #003366; font-weight: bold;">null</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">height</span> = <span style="color: #003366; font-weight: bold;">null</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">overlayClose</span> = <span style="color: #003366; font-weight: bold;">false</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">overlayOpacity</span> = <span style="color: #CC0000;color:#800000;">0</span>.<span style="color: #CC0000;color:#800000;">5</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">slideDownDuration</span> = <span style="color: #CC0000;color:#800000;">0</span>.<span style="color: #CC0000;color:#800000;">3</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">show</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>url, option<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">/** add events **/</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; option.<span style="color: #006600;">beforeLoad</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>ref.<span style="color: #006600;">timeout</span>&gt; <span style="color: #CC0000;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ref.<span style="color: #006600;">timeoutId</span> = window.<span style="color: #006600;">setTimeout</span><span style="color: #66cc66;">&#40;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ref.<span style="color: #006600;">onTimeoutHandler</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>,</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ref.<span style="color: #006600;">timeout</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">// setTimeout</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ref.<span style="color: #006600;">beforeLoadHandler</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// dialoger default</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; option.<span style="color: #006600;">overlayOpacity</span> = <span style="color: #CC0000;color:#800000;">0</span>.<span style="color: #CC0000;color:#800000;">5</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; option.<span style="color: #006600;">slideDownDuration</span> = <span style="color: #CC0000;color:#800000;">0</span>.<span style="color: #CC0000;color:#800000;">3</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; option.<span style="color: #006600;">afterLoad</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; window.<span style="color: #006600;">clearTimeout</span><span style="color: #66cc66;">&#40;</span>ref.<span style="color: #006600;">timeoutId</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ref.<span style="color: #006600;">afterLoadHandler</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; option.<span style="color: #006600;">afterHide</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ref.<span style="color: #006600;">afterHideHandler</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; option.<span style="color: #006600;">onShow</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ref.<span style="color: #006600;">onShowHandler</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; option.<span style="color: #006600;">onUpdate</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ref.<span style="color: #006600;">onUpdateHandler</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; option.<span style="color: #006600;">onFail</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ref.<span style="color: #006600;">onFailHandler</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>option.<span style="color: #006600;">height</span> != undefined<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ref.<span style="color: #006600;">height</span> = option.<span style="color: #006600;">height</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>option.<span style="color: #006600;">width</span> != undefined<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ref.<span style="color: #006600;">width</span> = option.<span style="color: #006600;">width</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>option.<span style="color: #006600;">overlayClose</span> == undefined<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; option.<span style="color: #006600;">overlayClose</span> = ref.<span style="color: #006600;">overlayClose</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>option.<span style="color: #006600;">oveelayOpacity</span> == undefined<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; option.<span style="color: #006600;">overlayOpacity</span> = ref.<span style="color: #006600;">overlayOpacity</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>option.<span style="color: #006600;">slideDownDuration</span> == undefined<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; option.<span style="color: #006600;">slideDownDuration</span> = ref.<span style="color: #006600;">slideDownDuration</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>option.<span style="color: #006600;">method</span> == undefined<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; option.<span style="color: #006600;">method</span> = <span style="color: #3366CC;">"get"</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">disableCache</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; date = <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>option.<span style="color: #006600;">params</span> != <span style="color: #003366; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;option.<span style="color: #006600;">params</span> += <span style="color: #3366CC;">"&amp;"</span>; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #66cc66;">&#123;</span> </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;option.<span style="color: #006600;">params</span> = <span style="color: #3366CC;">""</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; option.<span style="color: #006600;">params</span> += <span style="color: #3366CC;">"cahce_="</span> + date.<span style="color: #006600;">getTime</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; option.<span style="color: #006600;">autoFocusing</span> = <span style="color: #003366; font-weight: bold;">false</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Modalbox.<span style="color: #006600;">show</span><span style="color: #66cc66;">&#40;</span>url, option<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">/* Events */</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">beforeLoadHandler</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">beforeLoad</span><span style="color: #66cc66;">&#41;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">beforeLoad</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">afterLoadHandler</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">afterLoad</span><span style="color: #66cc66;">&#41;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">afterLoad</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">afterHideHandler</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">afterHide</span><span style="color: #66cc66;">&#41;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">afterHide</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">afterResizeHandler</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">afterResize</span><span style="color: #66cc66;">&#41;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">afterResize</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">onShowHandler</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">onShow</span><span style="color: #66cc66;">&#41;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">onShow</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">onUpdateHandler</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">onUpdate</span><span style="color: #66cc66;">&#41;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">onUpdate</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">onFailHandler</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">onFail</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">onFail</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Modalbox.<span style="color: #006600;">hide</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">onTimeoutHandler</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; window.<span style="color: #006600;">clearTimeout</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">timeoutId</span><span style="color: #66cc66;">&#41;</span>;&nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">onTimeout</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">onTimeout</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">activate</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Modalbox.<span style="color: #006600;">activate</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">deactivate</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Modalbox.<span style="color: #006600;">deactivate</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; <span style="color: #66cc66;">&#125;</span> </li>
				</ol>
				</div>
				</div>
				</div>
				<p>一応タイムアウトさせてるPHP</p>
				<div class="igBar"><span id="lphp-44"><a href="#" onclick="javascript:showPlainTxt('php-44'); return false;">&gt;&gt;text</a></span></div>
				<div class="syntax_hilite"><span class="langName">PHP:</span>
				<div id="php-44">
				<div class="php">
				<ol style="margin:0px; padding:0px" >
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color:#000000; font-weight:bold;">&lt;?</span></li>
				<li style="color:#26536A;"><a href="http://www.php.net/sleep"><span style="color:#000066;">sleep</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">7</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'タイムアウト時に閉じる処理入れないと、&lt;br/&gt;遅れて取得できたとき普通に表示されます。&lt;br/&gt;'</span>;</li>
				<li style="color:#26536A;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;a href=&quot;#&quot; onClick=&quot;Modalbox.hide();&quot;&gt;閉じる&lt;/a&gt;'</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </li>
				</ol>
				</div>
				</div>
				</div>
]]></content:encoded>
			<wfw:commentRss>http://parpue.net/web/29/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPressのカスタムフィールドで&lt;HEAD&gt;内でJavsScript, CSSをロードして動かす</title>
		<link>http://parpue.net/wordpress/25</link>
		<comments>http://parpue.net/wordpress/25#comments</comments>
		<pubDate>Fri, 27 Jun 2008 08:16:07 +0000</pubDate>
		<dc:creator>okm</dc:creator>
				<category><![CDATA[WEB]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[modalbox]]></category>

		<guid isPermaLink="false">http://parpue.net/?p=25</guid>
		<description><![CDATA[				MacOSXのようなダイアログをページ内に表示する、
				ModalBoxの改造記事を書こうと思ったんだけど、
				WordPressで記事ごとにJavaScriptやCSSの読み込みを追加したくて悩む。 [...]]]></description>
			<content:encoded><![CDATA[				<p>MacOSXのようなダイアログをページ内に表示する、<br />
				ModalBoxの改造記事を書こうと思ったんだけど、<br />
				WordPressで記事ごとにJavaScriptやCSSの読み込みを追加したくて悩む。</p>
				<p>プラグインを利用＆改造して、<br />
				カスタムフィールドでこんな感じでできるようにしてみた。</p>
				<p><a href='http://parpue.net/wp-content/custom3.png' rel='shadowbox[post-25];player=img;'><img src="http://parpue.net/wp-content/custom3-300x270.png" alt="カスタムフィールド" title="custom3" width="300" height="270" class="alignnone size-medium wp-image-28" /></a><br />
				javascript, css フィールドにファイル名を指定して追加する。<br />
				（Add-Meta-Tagsを追加で、keywords,description フィールドの指定によって、<br />
				META情報もページごとに指定可能。）</p>
				<p>というわけで、WorｄPressの個別ページで、<br />
				ModalBoxのJSとCSSを読み込んで、表示させてみた。</p>
				<p>↓個別ページ表示でないと動きません。<br />
				<span id="more-25"></span></p>
				<script type="text/javascript">
<!--
function showModalBox(){
    Modalbox.show('<input type=\'button\' value=\'閉じる\' onclick=\'Modalbox.hide()\' />',{title: 'テスト！', width: 300});
}
-->
</script>
<p>
<a href="#" onClick="showModalBox();" >ModalBoxテスト</a>
</p>
				<p>クリックでModalBoxが表示されるでしょか。</p>
				<p>■　記事本文中にjavascriptをかく・・・<br />
				プラグインを作っている方がおられました。<br />
				<a href="http://www.h-fj.com/blog/archives/2007/05/21-100102.php">カスタムフィールドのHTMLを記事に挿入するプラグイン</a><br />
				ContentEXプラグインにより、カスタムフィールドに追加したHTMLを<br />
				そのまま記事本文中に記述できます。</p>
				<p>本文中のJavaScriptに関してはこれでOKでした。便利。</p>
				<p>■　head内でjavascript,css ファイルをロードする・・・</p>
				<p>&lt;script type="text/javascript" src="xxx.js" /&gt;<br />
				&lt;link rel="stylesheet" href="xxx.css" /&gt;</p>
				<p>こんなのをページごとに自由に差し込みたい。</p>
				<p>近いプラグインで、ページごとにMETAを自由に追加できる、<br />
				Add-Meta-Tagsというプラグインがあったので、これをちょっと改造させていただきました。<br />
				→<a href="http://coliss.com/articles/blog/wordpress/plugin/327.html" target="blank">メタタグをページごとに設定できるWordPressのプラグイン:Add-Meta-Tagsの日本語版</a></p>
				<p>このプラグインのMETAタグを追加している部分に<br />
				javascript, css カスタムフィールドがあった場合、HEADに追加する処理を、加えました。</p>
				<p>add-meta-tags.php</p>
				<div class="igBar"><span id="lphp-47"><a href="#" onclick="javascript:showPlainTxt('php-47'); return false;">&gt;&gt;text</a></span></div>
				<div class="syntax_hilite"><span class="langName">PHP:</span>
				<div id="php-47">
				<div class="php">
				<ol start="410" style="margin:0px; padding:0px" >
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color:#FF9933; font-style:italic;">// Custom Field names</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color:#0000FF;">$desc_fld</span> = <span style="color:#FF0000;">"description"</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color:#0000FF;">$keyw_fld</span> = <span style="color:#FF0000;">"keywords"</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// javascript and css</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color:#0000FF;">$js_fld</span> = <span style="color:#FF0000;">"javascript"</span>;&nbsp; &nbsp;<span style="color:#FF9933; font-style:italic;">// add</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color:#0000FF;">$css_fld</span> = <span style="color:#FF0000;">"css"</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// add </span></li>
				</ol>
				</div>
				</div>
				</div>
				<div class="igBar"><span id="lphp-48"><a href="#" onclick="javascript:showPlainTxt('php-48'); return false;">&gt;&gt;text</a></span></div>
				<div class="syntax_hilite"><span class="langName">PHP:</span>
				<div id="php-48">
				<div class="php">
				<ol start="452" style="margin:0px; padding:0px" >
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color:#FF9933; font-style:italic;">// add javascript</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$js_fld_contents</span> = get_post_meta<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$posts</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>-&gt;<span style="color:#006600;">ID</span>, <span style="color:#0000FF;">$js_fld</span>, <span style="color:#000000; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span>!<a href="http://www.php.net/is_null"><span style="color:#000066;">is_null</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$js_fld_contents</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$js_fld_contents</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$js_fld_content</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> !<a href="http://www.php.net/empty"><span style="color:#000066;">empty</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$js_fld_content</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$my_metatags</span> .= <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\n</span>&lt;script type=<span style="color:#000099; font-weight:bold;">\"</span>text/javascript<span style="color:#000099; font-weight:bold;">\"</span> src=<span style="color:#000099; font-weight:bold;">\"</span>"</span>. <span style="color:#0000FF;">$js_fld_content</span>&nbsp; .<span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\"</span>&gt;&lt;/script&gt;"</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// add css</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$css_fld_contents</span> = get_post_meta<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$posts</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>-&gt;<span style="color:#006600;">ID</span>, <span style="color:#0000FF;">$css_fld</span>, <span style="color:#000000; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span>!<a href="http://www.php.net/is_null"><span style="color:#000066;">is_null</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$css_fld_contents</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$css_fld_contents</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$css_fld_content</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> !<a href="http://www.php.net/empty"><span style="color:#000066;">empty</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$css_fld_content</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$my_metatags</span> .= <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\n</span>&lt;link rel=<span style="color:#000099; font-weight:bold;">\"</span>stylesheet<span style="color:#000099; font-weight:bold;">\"</span> href=<span style="color:#000099; font-weight:bold;">\"</span>"</span>. <span style="color:#0000FF;">$css_fld_content</span>&nbsp; .<span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\"</span> /&gt;"</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> </li>
				</ol>
				</div>
				</div>
				</div>
				<p>これで javascript, css という名前のカスタムフィールドが有効になります。</p>
]]></content:encoded>
			<wfw:commentRss>http://parpue.net/wordpress/25/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
