AnsweredAssumed Answered

How to change the scale bar unit correctly while printing map?

Question asked by stephenlam1988 on Jan 28, 2015
Latest reply on Jun 18, 2015 by stephenlam1988

Please find the attached image as below, although I have changed the scalebarUnit to "Meter", it really just changes the unit from "km" to "m".

Here is the code

// create a print template for each choice
templates = arrayUtils.map(templateNames, function (ch) {
  var plate = new PrintTemplate();
  //plate.preserveScale = true;   // Default = false
  plate.layout = plate.label = ch;
  plate.format = "JPG";
  plate.layoutOptions = {
  "legendLayers": legendLayers,
  "scalebarUnit": "Meters"
  };
  plate.preserveScale = false;
  return plate;
});


// create the print dijit


var printer = new Print({
  "map": map,
  "templates": templates,
  url: xxx
}, dojo.byId("printButton"));
printer.startup();

 

Please advice, thanks.

Km:

km.jpg

Meter:

m.jpg

Outcomes