I mentioned already about SkyWindow API. Here’s a newer version.
SkyWindow2 API:
Below is the html code that does the trick:
<script type='text/javascript'
src='http://wikisky.org/js/skywindow2'></script>
<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>
<script type="text/javascript">
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'));
</script>
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’s JavaScript security policy does not allow to make AJAX call to any server except the one current page loaded from.
Here’s an example of simple php code:
<?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;
?>













Categories:
Tags:
I have to admit that this site is terrific!!!
I’m trying to incorporate your skywindow2 in my web site. I copied the code you provided. The web page works OK in FireFox but the image frame is blank when viewed in IE 8. Are there some options that need to be changed?
Also AM using ASP on the server. Would you have the comparable VBScript code to allow object labels to be viewed?
Thanks
Nor