Chicago 1

Click here for the commented JavaScript source code
/* flashNavigator demo Chicago 1 */
 
// fnViewer constructor
fn = new flashNavigator();     
 
// loads flashNavigator project (XML format)
fn.load("http://www.flashnavigator.net/examples/maps/chicago.xml");  
 
// sets list of plugins that are used to extend 
// flashNavigator functionality       
fn.loadPlugins("slider,scalebar");
 
// registers event listener for the event load
fn.addEventListener("load","fnOnLoad");  
 
// registers event listener for the event scalechange
fn.addEventListener("scalechange","fnUpdateScale"); 
 
function fnOnLoad()
{ 
  var w = fn.getWidth();
  var h = fn.getHeight();
  var b = fn.getViewBound();
 
  console("Configuration file has been loaded!\n\nflashNavigator info:\n\nwidth: "+w+"\nheight: "+h+"\nbound = ("+b.xMin+","+b.xMax+","+b.yMin+","+b.yMax+")");     
}
 
function fnUpdateScale(evt)
{
  // scalechange event returns information about current scale in internal format
  // this format can be converted to project scale by core API method convertScale()
  var scale = fn.convertScale(evt.zoom); 
  document.getElementById("scaleInfo").innerHTML = "1:"+Math.round(scale);  
}
 
function showBound()
{
  var b = fn.getViewBound();
  console("bound = ("+b.xMin+","+b.xMax+","+b.yMin+","+b.yMax+")");
}   
 
function fullExtent()
{
  // sets view bound. If called without parameters 
  // bound will be set to the bound of loaded project
  fn.setViewBound();
  console("When setViewBound is called without parameters it sets current view to project bound.");
}
 
function showWidth()
{
 
	var w = fn.getWidth()+" px";
	console("width = "+w);
}  
 
function showHeight()
{
   var h = fn.getHeight()+" px";
   console("height = "+h);
}    
 

Console