Select Page


I made available for download the code for an Openscales template. This was after a number of people asked for the code for base map switching (Yahoo or Bing etc). The template includes other code, which is worth mention. Here I wanted to talk about the print widget. I wrote here about this widget. Anybody who downloads the template source, will find this widget included. Just as a reminder, the widget is a modified version of one found in the ArcGIS Flex template library (version 1.2). It includes a preview option in portrait and landscape. Adds a header and footer and configurable title and footer. Data is also included plus optional icons (could be a logo etc). Finally export to pdf.

Openscales print widget

Now note the template relies on a model. So if you port this to your own application, you will need a way to reference the map object. The key files are found here:

com/webmapsolutions/view/tools/PrintTool.mxml
com/webmapsolutions/view/tools/PrintWidget.xml
com/webmapsolutions/components/printpreview/..

Please note on line 136 in PrintTool.mxml you will need to replace the path to createPDF.php with a reference to your own copy of this file. The file is as follows:


< ?php $method = $_GET['method']; $name = $_GET['name']; if ( isset ( $GLOBALS["HTTP_RAW_POST_DATA"] )) { // get bytearray $pdf = $GLOBALS["HTTP_RAW_POST_DATA"]; // add headers for download dialog-box header('Content-Type: application/pdf'); header('Content-Length: '.strlen($pdf)); header('Content-disposition:'.$method.'; filename="'.$name.'"'); echo $pdf; } else echo 'An error occurred.'; ?>

The print widget uses alivepdf, the swc you will find in the libs directory. The print widget uses the ToolsBase class. This I have used for all pop ups in the template. Saves code replication. So the code for moving, closing popups etc is all contained in this class.

Think that is it. The widget is not limited to OpenScales, it colud be used in other geospatial Flex apps. Let me know if you have any problems.

WebMapSolutions
Schedule Free ArcGIS Consultation
Our goal is to help you successfully apply ArcGIS to solve your business problems. Conducted by an ArcGIS expert, our free 30 min consultation will help move you forward.
Thank You. We will contact you as soon as possible.
SUBSCRIBE TO OUR BLOG
Our blog is filled with lively discussion, news, ideas. We take a fresh perspective on the rapidly changing world of GIS. Don't miss a post ... join over 1000 of your peers.
Do you want massive traffic?
Dignissim enim porta aliquam nisi pellentesque. Pulvinar rhoncus magnis turpis sit odio pid pulvinar mattis integer aliquam!
  • Goblinus globalus fantumo tubus dia montes
  • Scelerisque cursus dignissim lopatico vutario
  • Montes vutario lacus quis preambul den lacus
  • Leftomato denitro oculus softam lorum quis
  • Spiratio dodenus christmas gulleria tix digit
  • Dualo fitemus lacus quis preambul pat turtulis
* we never share your e-mail with third parties.
WebMapSolutions
CONTACT US
Are you looking for advice or help with ArcGIS? We are happy to share with you our thoughts and expertise to move you forward. Fill out the form below and we will be in contact soon.
Thank You. We will contact you as soon as possible.
WebMapSolutions
WORKSHOP SIGN UP
Our goal is to help get started and maximize GIS ROI. Conducted by on of our GIS experts, our free 1 hr Discovery Workshop will provide you a GIS road-map.
Thank You. We will contact you as soon as possible.
WebMapSolutions
Schedule a GeoAppSmart Demo
GeoAppSmart for ArcGIS we have designed with flexibility in mind. Let us show you how the app works. Fill out the form below, and we will contact you to set up a demo.
Thank You. We will contact you as soon as possible.
Request a Demo
Learn more about GeoAppSmart for ArcGIS. Schedule a demo. We can show you the features of this is a new breed on super flexible ArcGIS apps..
SUBSCRIBE TO OUR BLOG
Our blog is filled with lively discussion, news, ideas. We take a fresh perspective on the rapidly changing world of GIS. Don't miss a post ... join over 1000 of your peers.
Discounts!
Subscribe now to our free daily newsletter and get special offers and 20% discount.
More than just MOBILE .. All device ArcGIS apps are finally HERE!
GeoAppSmart for ArcGIS is one of a new breed of web based ArcGIS apps which:

  • Runs on any device - PC, laptop, smartphone, tablet
  • Can be used anywhere - Online or offline
  • Infinitely flexible - Built using plug-in tools
  • Easy to set up, configure and use

Download our new eBook, and learn more about these new super flexible web apps.
* we never share your e-mail with third parties.
New to ArcGIS Online and wondering how to GET STARTED?
Our free eBook 'Success with ArcGIS: Your Roadmap' will walk you through the critical success elements:

  • Defining the problem
  • Evolving the story
  • Building the runway
  • Solution implementation

If you are looking to JUMPSTART your deployment and use of ArcGIS Online this eBook is for you.
* we never share your e-mail with third parties.
S
Subscribe to Our Newsletter
Our newsletter is filled with news, tips, tutorials and lively discussion focused on the exciting, rapidly evolving world of GIS. Join over 2000 of your peers.
     
Wondering about Mobile GIS?
Our free eBook 'Your Guide to Mobile GIS' will help you get started and move forward with this exciting technology. We cover:

  • Your mobile GIS options
  • Provide case studies
  • Discuss best choices
  • Look ahead

If you are looking to improve how your mobile staff get their work done. This free eBook is for you.
* we never share your e-mail with third parties.
Want to get the most out of ArcGIS Online?
Our free eBook 'Success with ArcGIS Online' will walk you through the critical success elements including:

  • The Why
  • The Who
  • The How
  • The Where

If you are looking to get started or maximize your ArcGIS Online ROI, this eBook is for you.
* we never share your e-mail with third parties.
IoT on Map - Real-Time Reporting, Tracking and Monitoring Made Simple
Download our free Internet of Things eBook. Learn how to easily track moving assets, monitor fixed assets and report problems in real-time. Simple, flexible and affordable.
Want to get the most out of ArcGIS Online?
Download our free eBook 'Success with ArcGIS Online'. The eBook walks you through the key success elements: the why, who, how and where. Get started or maximize your ArcGIS Online ROI.
Sign up for our free GIS Discovery Workshop
Wondering how to get started or maximize your GIS ROI? Our free 1 hour workshop is designed to provide you a road-map to success with GIS. Sign up for it today.