﻿// JScript File
function ContentPageLoad()
{
    //=============
    // SAMPLE MAP 1
    //=============
    // Create a new map associated with the map view div.
    var CustomMap1 = new ISYSMap( document.getElementById("CustomMapSample1Div"), 0, 0, 600, 600, 10004 ); // Div, X, Y, Width, Height, Map
    
    // Get the map view element
    var CustomMap1Div = document.getElementById("CustomMapSample1Div")
    
    // Wire up the mouse listeners to do dragging, scrolling and zooming
    CustomMap1Div.onmousedown = function(event){CustomMap1.ISYSStartMoveMouse(event); };
    CustomMap1Div.onmousemove = function(event){CustomMap1.ISYSProcessMoveMouse(event); };
    CustomMap1Div.onmouseup = function(event){CustomMap1.ISYSStopMoveMouse(event); };
    CustomMap1Div.ondblclick = function(event){CustomMap1.ISYSZoomInMouse(event); };

    // necessary to enable dragging on IE
    CustomMap1Div.ondragstart = function() { return false; }
    
    // Set the mouse scroll method
    CustomMap1.ISYSScrollMethodCompass();  // Only works on IE, defaults to ISYSScrollMethodDrag for other browsers
    
    // Quick zoom
    CustomMap1.ISYSZoomLevel(10);

    // Centre map on XY.
    var myCoordinateXY1 = new ISYSCoordinate();
    myCoordinateXY1.X = 1000;
    myCoordinateXY1.Y = 500;
    CustomMap1.ISYSCentreMapOnXY( myCoordinateXY1 );
    
	// Draw the map
    CustomMap1.ISYSDrawMap();


    //=============
    // SAMPLE MAP 2
    //=============
    // Create a new map associated with the map view div.
    var CustomMap2 = new ISYSMap( document.getElementById("CustomMapSample2Div"), 0, 0, 600, 600, 10005 ); // Div, X, Y, Width, Height, Map
    
    // Get the map view element
    var CustomMap2Div = document.getElementById("CustomMapSample2Div")
    
    // Wire up the mouse listeners to do dragging, scrolling and zooming
    CustomMap2Div.onmousedown = function(event){CustomMap2.ISYSStartMoveMouse(event); };
    CustomMap2Div.onmousemove = function(event){CustomMap2.ISYSProcessMoveMouse(event); };
    CustomMap2Div.onmouseup = function(event){CustomMap2.ISYSStopMoveMouse(event); }; // Don't use with compass scroll
    CustomMap2Div.ondblclick = function(event){CustomMap2.ISYSZoomInMouse(event); };

    // necessary to enable dragging on IE
    CustomMap2Div.ondragstart = function() { return false; }
    
    // Set the mouse scroll method
    CustomMap2.ISYSScrollMethodCompass();  // Only works on IE, defaults to ISYSScrollMethodDrag for other browsers
    
    // Quick zoom
    CustomMap2.ISYSZoomLevel(10);

    // Centre map on XY.
    var myCoordinateXY2 = new ISYSCoordinate();
    myCoordinateXY2.X = 1000;
    myCoordinateXY2.Y = 500;
    CustomMap2.ISYSCentreMapOnXY( myCoordinateXY2 );
    
	// Draw the map
    CustomMap2.ISYSDrawMap();
    
    //=============
    // SAMPLE MAP 3
    //=============
    // Create a new map associated with the map view div.
    var CustomMap3 = new ISYSMap( document.getElementById("CustomMapSample3Div"), 0, 0, 600, 600, 0 ); // Div, X, Y, Width, Height, Map
    
    // Get the map view element
    var CustomMap3Div = document.getElementById("CustomMapSample3Div")
    
    // Wire up the mouse listeners to do dragging, scrolling and zooming
    CustomMap3Div.onmousedown = function(event){CustomMap3.ISYSStartMoveMouse(event); };
    CustomMap3Div.onmousemove = function(event){CustomMap3.ISYSProcessMoveMouse(event); };
    CustomMap3Div.onmouseup = function(event){CustomMap3.ISYSStopMoveMouse(event); };
    CustomMap3Div.ondblclick = function(event){CustomMap3.ISYSZoomInMouse(event); };

    // necessary to enable dragging on IE
    CustomMap3Div.ondragstart = function() { return false; }
    
    // Set the mouse scroll method
    CustomMap3.ISYSScrollMethodCompass();  // Only works on IE, defaults to ISYSScrollMethodDrag for other browsers
    
    // Quick zoom
    CustomMap3.ISYSZoomLevel(12);

    // Centre map on XY.
    var myCoordinateXY3 = new ISYSCoordinate();
    myCoordinateXY3.X =  372100;
    myCoordinateXY3.Y = 1012800;
    CustomMap3.ISYSCentreMapOnXY( myCoordinateXY3 );
    
	// Draw the map
    CustomMap3.ISYSDrawMap();
}

