Activate Imajnet



<!-- Library dependencies -->
<link rel="stylesheet" href="ImajnetLib/lib/jquery-ui-1.9.0.custom/css/ui-lightness/jquery-ui-1.9.0.custom.css" />
<link rel="stylesheet" href="ImajnetLib/lib/loadmask/jquery.loadmask.css" />
<link rel="stylesheet" href="ImajnetLib/lib/jquery-notify/css/ui.notify.css" />
<link rel="stylesheet" href="ImajnetLib/lib/colorbox/colorbox.css" />

<script type="text/javascript" src="ImajnetLib/lib/proj4js/proj4js.js"></script>
<script type="text/javascript" src="ImajnetLib/lib/proj4js/merc.js"></script>
<script type="text/javascript" src="ImajnetLib/lib/jquery/jquery-migrate-1.1.0.min.js"></script>
<script type="text/javascript" src="ImajnetLib/lib/jquery-ui-1.9.0.custom/js/jquery-ui-1.9.0.custom.js"></script>
<script type="text/javascript" src="ImajnetLib/lib/jquery/jquery.mobile.custom.min.js"></script>
<script type="text/javascript" src="ImajnetLib/lib/jquery-i18n/jquery.i18n.js"></script>
<script type="text/javascript" src="ImajnetLib/lib/jquery-corner/jquery.corner.js"></script>
<script type="text/javascript" src="ImajnetLib/lib/touch/jquery.mobile-events.min.js"></script>
<script type="text/javascript" src="ImajnetLib/lib/loadmask/jquery.loadmask.min.js"></script>
<script type="text/javascript" src="ImajnetLib/lib/Raphael/raphael.js"></script>
<script type="text/javascript" src="ImajnetLib/lib/jquery-url/jquery.url.js"></script>
<script type="text/javascript" src="ImajnetLib/lib/jquery-notify/jquery.notify.min.js"></script>
<script type="text/javascript" src="ImajnetLib/lib/colorbox/jquery.colorbox-min.js"></script>
<script type="text/javascript" src="ImajnetLib/lib/threejs/three.js"></script>
<script type="text/javascript" src="ImajnetLib/lib/threejs/CanvasRenderer.js"></script>
<script type="text/javascript" src="ImajnetLib/lib/threejs/Projector.js"></script>
<script type="text/javascript" src="ImajnetLib/lib/touchSwipe/jquery.touchSwipe.min.js"></script>
<script type="text/javascript" src="ImajnetLib/js/i18n/locale-en.js"></script>
 
<!-- Imajnet lib -->
<link rel="stylesheet" href="ImajnetLib/css/imajnetLibrary.css" />
<script type="text/javascript" src="ImajnetLib/js/imajnetLibrary.js"></script> 

<!-- Imajnet language file -->
<script type="text/javascript" src="ImajnetLib/js/i18n/locale-en.js"></script>


<script> 
function activateImajnet(element) {
    if(element.hasClass('opacity30')) {
	    return;
    }
    
    //Set options for the imajnet plugin
    var options = {
        serverUrl: 'https://service.imajnet.net/service',
        loginRememberMe: false,
        username: 'demo',
        password: 'demo',
        containerId: 'imajnetContainer', // Main image container id
        searchLRSContainerId: 'searchLRSContainer', // Optional: LRS search window container id
        searchAddressContainerId: 'searchAddressContainer' // Optional: search address window container id
        clipboardContainerId: 'clipboardContainer', // Optional: clipboard window container id
        clipboardExportContainerId: 'clipboardExportContainer', // Optional: clipboard export window container id
        newsContainerId: 'newsContainer', // Optional: news window container id
        map: map, // Map object reference
        imajnetPath: 'ImajnetLib/', // Path where imajnet files are located
        activateImajnet: true,
        clipboardActive: true, // Want to see all added photogrammetry objects
        language: 'en',
        unit: 'm', // Optional - (m or feet) unit in which measurement is displayed
        metadata: 'Imajnet SDK', // An identifier for your application
	    goToClosestPointOfInterest: true, // Optional, if true image will load from the closest point of interest to the user
	    sessionType: 'FULL' // Mandatory - 'FULL'(images, projections and other data) or 'LRS'(only LRS requests)
    };
    
    //Activates imajnet
    Imajnet.init(options);
    
    jQuery('#deactivateImajnetButton').removeClass('opacity30');
    element.addClass('opacity30');
}

function deactivateImajnet(element) {
    if(element.hasClass('opacity30')) {
	    return;
    }
    
    //Deactivates imajnet
    Imajnet.deactivateImajnet(true);
    jQuery('#activateImajnetButton').removeClass('opacity30');
    element.addClass('opacity30');
}

//Handler after imajnet is activated
ImajnetPlugin.onImajnetActivated = function() {
	console.log('activated');
}

//Handler after imajnet is deactivated
ImajnetPlugin.onImajnetDeactivated = function() {
	console.log('deactivated');
}
</script>