<?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>SKY-MAP.ORG / WIKISKY &#187; javascript</title>
	<atom:link href="http://blog.wikisky.org/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.wikisky.org</link>
	<description>project news and updates</description>
	<lastBuildDate>Fri, 09 Sep 2011 06:49:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Version 2 Window API</title>
		<link>http://blog.wikisky.org/2009/10/02/version-2-window-api/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=version-2-window-api</link>
		<comments>http://blog.wikisky.org/2009/10/02/version-2-window-api/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 04:31:53 +0000</pubDate>
		<dc:creator>WikiSky</dc:creator>
				<category><![CDATA[WikiSky]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[SkyWindow]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://blog.wikisky.org/?p=105</guid>
		<description><![CDATA[I mentioned already about SkyWindow API. Here&#8217;s a newer version. SkyWindow2 API: var options= {ra:10.74187, de:-59.66, initZoom:12, zoom:12, survey:"", imgSource:"IMG_all", allowTopPanel:true, showTopPanel:true, showRightPanel:false, allowMove:true, allowZoom:true, showPanZoomControl:true, panZoomControlLeft:6, panZoomControlTop:10, showScale:true, showStatus:false, showPosition:true, showStickers:true, showLabels:true, jpegQuality:0.8, showGrid:true, showOverlayGrid:false, showConstLines:true, showOverlayConstLines:false, showConstBoundaries:true, showOverlayConstBoundaries:false, showConstNames:false, showOverlayConstNames:false, showGalaxies:true, showOverlayGalaxies:false, showStars:true, showOverlayStars:false, buffer:1, moveTime:2000, smoothMoveAccelerationTime:500, posColor:"yellow",posFontSize:"8pt",posFontWeight:"normal",posFontFamily:"verdana", scaleMaxLen:90, scaleHeight:6, scaleColor:"yellow", scaleLineWidth:1 }; [...]]]></description>
			<content:encoded><![CDATA[<p>I <a href="http://blog.wikisky.org/2008/12/22/bug-in-skywindow/">mentioned</a> already about SkyWindow API. Here&#8217;s a newer version.<br />
SkyWindow2 API:</p>
<p><script type='text/javascript'
   src='http://wikisky.org/js/skywindow2'></script></p>
<div style='position:relative;left:0px;top:0px;width:450px;height:450px'>
<DIV id='mySkyWnd' style='position:absolute;left:0;top:0;width:450px;height:450px;overflow:hidden;border:1px solid gray' onmouseout='hideddrivetip()'></DIV></div>
<p><script type="text/javascript">
var options= {ra:10.74187, de:-59.66, initZoom:12, zoom:12,
  survey:"", imgSource:"IMG_all", allowTopPanel:true, showTopPanel:true, showRightPanel:false,
  allowMove:true, allowZoom:true,
  showPanZoomControl:true, panZoomControlLeft:6, panZoomControlTop:10,
  showScale:true, showStatus:false, showPosition:true, showStickers:true, showLabels:true,
  jpegQuality:0.8,
  showGrid:true, showOverlayGrid:false,
  showConstLines:true, showOverlayConstLines:false,
  showConstBoundaries:true, showOverlayConstBoundaries:false,
  showConstNames:false, showOverlayConstNames:false,
  showGalaxies:true, showOverlayGalaxies:false,
  showStars:true, showOverlayStars:false,
  buffer:1, moveTime:2000, smoothMoveAccelerationTime:500,
  posColor:"yellow",posFontSize:"8pt",posFontWeight:"normal",posFontFamily:"verdana",
  scaleMaxLen:90, scaleHeight:6, scaleColor:"yellow", scaleLineWidth:1
};
new SkyWindow2(options).attach($('mySkyWnd'));
</script></p>
<hr/>
Below is the html code that does the trick:</p>
<div style='width:450px;overflow:scroll'>
<pre>
<code>
&lt;script type='text/javascript'
   src='http://wikisky.org/js/skywindow2'&gt;&lt;/script&gt;
&lt;div style='position:relative;left:0px;top:0px;width:450px;height:450px'&gt;
&lt;DIV id='mySkyWnd'
  style='position:absolute;left:0;top:0;width:450px;height:450px;overflow:hidden;border:1px solid gray'
  onmouseout='hideddrivetip();'&gt;&lt;/DIV&gt;&lt;/div&gt;
&lt;script type="text/javascript"&gt;
var options = {ra:12.4283, de:12.81, initZoom:6, zoom:6,
  survey:"", imgSource:"DSS2", allowTopPanel:true, showTopPanel:true, showRightPanel:false,
  allowMove:true, allowZoom:true,
  showPanZoomControl:true, panZoomControlLeft:6, panZoomControlTop:10,
  showScale:true, showStatus:false, showPosition:true, showStickers:true, showLabels:true,
  jpegQuality:0.8,
  showGrid:true, showOverlayGrid:false,
  showConstLines:true, showOverlayConstLines:false,
  showConstBoundaries:true, showOverlayConstBoundaries:false,
  showConstNames:false, showOverlayConstNames:false,
  showGalaxies:true, showOverlayGalaxies:false,
  showStars:true, showOverlayStars:false,
  buffer:1, moveTime:2000, smoothMoveAccelerationTime:500,
  posColor:"lightgray",posFontSize:"8pt",posFontWeight:"normal",posFontFamily:"verdana",
  scaleMaxLen:90, scaleHeight:6, scaleColor:"lightgray", scaleLineWidth:1
};
new SkyWindow2(options).attach($('mySkyWnd'));
&lt;/script&gt;
</code>
</pre>
</div>
<p>One important detail: If you want to show object info labels while moving mouse over the map. You need to add simple proxy script on your server to redirect AJAX calls to WikiSky servers. The reason is that browser&#8217;s JavaScript security policy does not allow to make AJAX call to any server except the one current page loaded from.<br/><br />
Here&#8217;s an example of simple php code:<br/></p>
<div style='width:450px;overflow:scroll'>
<pre>
<code>
&lt;?php
include("HttpClient.class.php");
$u=$_SERVER["REQUEST_URI"];
$client = new HttpClient("server1.sky-map.org");
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
   $client->post('/'.$u, file_get_contents("php://input"));
} else {
   $client->get('/'.$u);
}
$contentType = $client->getHeader("Content-Type");
$pageContents = $client->getContent();
header('Content-type: '.$contentType);
echo $pageContents;
?&gt;
</code>
</pre>
</div>
<div class="shr-publisher-105"></div><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>____________</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http%3A%2F%2Fblog.wikisky.org%2F2009%2F10%2F02%2Fversion-2-window-api%2F&amp;submitHeadline=Version+2+Window+API&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://blog.wikisky.org/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fblog.wikisky.org%2F2009%2F10%2F02%2Fversion-2-window-api%2F&amp;title=Version+2+Window+API" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://blog.wikisky.org/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.wikisky.org%2F2009%2F10%2F02%2Fversion-2-window-api%2F&amp;title=Version+2+Window+API" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://blog.wikisky.org/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fblog.wikisky.org%2F2009%2F10%2F02%2Fversion-2-window-api%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://blog.wikisky.org/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fblog.wikisky.org%2F2009%2F10%2F02%2Fversion-2-window-api%2F&amp;title=Version+2+Window+API" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://blog.wikisky.org/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http%3A%2F%2Fblog.wikisky.org%2F2009%2F10%2F02%2Fversion-2-window-api%2F&amp;bm_description=Version+2+Window+API" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://blog.wikisky.org/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fblog.wikisky.org%2F2009%2F10%2F02%2Fversion-2-window-api%2F&amp;T=Version+2+Window+API" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://blog.wikisky.org/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fblog.wikisky.org%2F2009%2F10%2F02%2Fversion-2-window-api%2F&amp;title=Version+2+Window+API" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://blog.wikisky.org/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.wikisky.org%2F2009%2F10%2F02%2Fversion-2-window-api%2F&amp;title=Version+2+Window+API" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://blog.wikisky.org/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fblog.wikisky.org%2F2009%2F10%2F02%2Fversion-2-window-api%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://blog.wikisky.org/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http%3A%2F%2Fblog.wikisky.org%2F2009%2F10%2F02%2Fversion-2-window-api%2F" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://blog.wikisky.org/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Version+2+Window+API+@+http%3A%2F%2Fblog.wikisky.org%2F2009%2F10%2F02%2Fversion-2-window-api%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://blog.wikisky.org/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fblog.wikisky.org%2F2009%2F10%2F02%2Fversion-2-window-api%2F&amp;t=Version+2+Window+API" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://blog.wikisky.org/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://blog.wikisky.org/2009/10/02/version-2-window-api/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

