Hexagon Geospatial
MENU

Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Regular Contributor
Posts: 213
Registered: ‎05-01-2016
Accepted Solution

Turn off Scalebar display in plot - Custom Snapshot page with GraphicsMagick engine to make PDF

[ Edited ]

I'm using the GraphicsMagick engine to generate PDF plots with Webmap SDK. For some reason my Portrait orientented xaml template produces a map with  a map scale bar in it but my landscape oriented template does not.  Neither template references a scale bar and the scale bar is turned off on the displayed map.  I tried using instructions in https://community.hexagongeospatial.com/t5/Developers-Knowledge-Base/Custom-Snapshot-Page-for-Printi...

to turn off the scale bar but making the code changes (all but the one to use PhantomJS) results in the SDK hanging up when it tries to generate the plot.  The custom code i am giving in predicate.js is 

 $GP.ready(function() {
        $(".wc_map_scale").toggle();
    
    });

Should i be able to use a snapshot page to customize my plot when using GraphicsMagick and is there a way to turn of the scale bar from displaying the output PDF map?

Thanks,

Jane

Technical Evangelist
Posts: 778
Registered: ‎09-11-2015

Re: Turn off Scalebar display in plot - Custom Snapshot page with GraphicsMagick engine to make PDF

Hi Jane,

 

You should be able to debug this:

  1. Through PhantomJS logging, which is also reflected in Portal log
  2. By setting a break point in the custom snapshot page aspx and see if the code fails

Next, are you therefore using custom printing templates? Can you reproduce the issue with the default templates delivered with product?

 

Lastly, this just came up to my mind, it might be safer to use hide() instead of toggle() + the $GP.ready function should now have a version specified:

$GP.ready("v1.0", function () {
   $(".wc_map_scale").hide();

}
Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Regular Contributor
Posts: 213
Registered: ‎05-01-2016

Re: Turn off Scalebar display in plot - Custom Snapshot page with GraphicsMagick engine to make PDF

phantom.png

Thanks - i tried debugging and what breaks everything is including PredicateStyle.js - The code there is never executed - the page hangs indefinately.  i also changed the code in PredicateStyle.js as suggested.

From the image above I am not sure that using the custom snapshot works with graphicsmagick engine.  Has it been verified to work?  I am using custom templates that i made and all displays just as desired except for the scalebar showing upon the Portrait orientation map.    The scale bar is turned off in the webpage map that is displayed when the Print button is pressed.  Should that be sufficient to turn it off in the plotted map?  I have to produce the maps in pdf format which is why i'm using the graphicsmagick engine.

Regular Contributor
Posts: 213
Registered: ‎05-01-2016

Re: Turn off Scalebar display in plot - Custom Snapshot page with GraphicsMagick engine to make PDF

[ Edited ]

Got it to work!  I didn't realize you could have both PhantomJS AND GraphicsMagick installed.

This video was very helpful:

https://community.hexagongeospatial.com/t5/WebGIS/Configure-Printing-in-Geospatial-Portal-with-Phant...

Thanks!!

 

Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.