Autodesk 15606-011408-9300 Developer Guide - Page 141
Municipal Application Example Code, application online
UPC - 606121429548
View all Autodesk 15606-011408-9300 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 141 highlights
Municipal Application Example Code Following is the source code for the controls. Additional comments have been added to the code to give you a better idea of how the scripting works. To view the source code for the other frames in this application, go to the application online at www.autodesk.com/mapguidedemo. Municipal Application Example Code MUNICIPAL
Municipal Application
|
141
Municipal Application Example Code
Following is the source code for the controls. Additional comments have
been added to the code to give you a better idea of how the scripting works.
To view the source code for the other frames in this application, go to the
application online at
www.autodesk.com/mapguidedemo
.
Municipal Application Example Code
<HTML>
<HEAD>
<TITLE>MUNICIPAL</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
// Get full browser name and assign it to tempName variable;
// then assign first 8 letters of tempName to browserName variable
var tempName = navigator.appName;
var browserName = tempName.substring(0,8);
// Map object variable, to be used later
var map;
// Set browserId variable: '1' for netscape, '2' for IE, else '0'
if (browserName == 'Netscape')
var browserId = 1;
else if (browserName == 'Microsof') // just first 8 letters...
browserId=2;
else
browserId = 0;
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= //
// Function: getMap()
// Description: Get appropriate map object for IE or Netscape
// Arguments:
none
// Returns:
map object
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= //
function getMap()
{
// Get appropriate MGMap object; type depends on browserId value
if (browserId == 1)
map = top.main.document.embeds[0]; // Netscape map object
else if (browserId == 2)
map = top.main.document.map;
// IE map object
else
map = null;
// none if other browser
return map;
//return map object
}