158
|
Chapter 7
Applications
else
map = null;
// none if other browser
return map;
//return map object
}
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= //
// Function:
Pan(direction)
// Description:
pans in the specified direction
// Arguments:
direction
// Return:
nothing
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= //
function Pan(direction)
{
// Get MGMap object
var map = getMap();
map.setAutoRefresh(false);
// Get Width or Height in meters
var delta;
var scrollfactor = 1;
scrollfactor = document.Selection.factor.value;
scrollfactor = parseInt(scrollfactor);
if (isNaN (scrollfactor) || (scrollfactor < 1)) {
alert("Enter a positive number as the scrolling factor.");
}
else
{
if (direction == 'Up' | direction == 'Down' | direction ==
'Left' | direction == 'Right' | direction == 'Ul' | direction
== 'Ur' | direction == 'Ld' | direction == 'Rd')
delta = map.getWidth("M");
delta = (scrollfactor/10) * delta;
// Compute center point of map in Mapping Coordinate System (MCS)
var xyPt = map.lonLatToMcs(map.getLon(), map.getLat());
// Convert delta from Meters to MCS units.
var MCStoMeters = map.getMCSScaleFactor();
delta = delta / MCStoMeters;
// Adjust by width / height of the map
if (direction == 'Left') {
xyPt.setX(xyPt.getX() - delta)
}
if (direction == 'Right') {
xyPt.setX(xyPt.getX() + delta)
}
if (direction == 'Up') {
xyPt.setY(xyPt.getY() + delta)
}
if (direction == 'Ul') {
xyPt.setX(xyPt.getX() - delta)
Facilities Management Application Example Code (
continued
)
Summary of Contents for 15606-011408-9300 - MAP R6.3 UPG
Page 1: ...15306 010000 5060 October 2001 Autodesk MapGuide Release 6 Developer s Guide ...
Page 6: ...vi ...
Page 16: ...16 ...
Page 30: ...30 ...
Page 84: ...84 ...
Page 134: ...134 ...
Page 202: ...202 ...