Autodesk 15606-011408-9300 Developer Guide - Page 66
Enabling the Print Events, methods. For Autodesk MapGuide Viewer Plug
UPC - 606121429548
View all Autodesk 15606-011408-9300 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 66 highlights
The following example shows an onEndLayout event handler, written in JavaScript, that forces the title to be printed after the North arrow: function onEndLayout(layout, info) { // retrieve arrow and map elements var el_arrow = layout.getPageElement("mg_northarrow"); var el_map = layout.getPageElement("mg_map"); // force arrow to have higher print priority than map el_arrow.setPrintPriority(el_map.getPrintPriority() + 1); } Enabling the Print Events By default, the onBeginLayout and onEndLayout events are not fired; you enable and disable them using the enablePrintingEvents and disablePrintingEvents methods. For Autodesk MapGuide Viewer PlugIn and Autodesk MapGuide Viewer, Java Edition, you will also need to use the setPrintingObserver method to specify the event observer. Here is one way to write a JavaScript function that enables print events: function enable_print_events() { var map = getMap(); map.enablePrintingEvents(); if (navigator.appName == "Netscape") map.setPrintingObserver(obs); } 66 | Chapter 4 Working with Map Layers, Map Features, and Printing