<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Setting the map scale in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-the-map-scale/m-p/1012338#M71191</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;@model ModelLayer.Models.ReportModel

@{
    ViewData["Title"] = "Извештај";
}

&amp;lt;script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"&amp;gt;&amp;lt;/script&amp;gt;

&amp;lt;link rel="stylesheet" href="http://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css" /&amp;gt;
&amp;lt;script src="http://code.jquery.com/ui/1.12.1/jquery-ui.min.js"&amp;gt;&amp;lt;/script&amp;gt;

&amp;lt;script src="~/js/bootstrap.min.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;link href="~/css/bootstrap.min.css" rel="stylesheet" /&amp;gt;

&amp;lt;link href="http://kendo.cdn.telerik.com/2020.2.513/styles/kendo.common.min.css" rel="stylesheet" /&amp;gt;
&amp;lt;link href="http://kendo.cdn.telerik.com/2020.2.513/styles/kendo.default.min.css" rel="stylesheet" /&amp;gt;
&amp;lt;script src="http://kendo.cdn.telerik.com/2020.2.513/js/kendo.all.min.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script src="~/js/kendo.aspnetmvc.min.js"&amp;gt;&amp;lt;/script&amp;gt;

&amp;lt;!--If Kendo is used it should be added before the report viewer.--&amp;gt;
&amp;lt;script src="~/Reports/telerikReportViewer-14.2.20.1021.min.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script src="~/Reports/telerikReportViewer.kendo-14.2.20.1021.min.js"&amp;gt;&amp;lt;/script&amp;gt;

&amp;lt;script&amp;gt;
    window.rootUrl = '@Url.Content("~/")';
&amp;lt;/script&amp;gt;

&amp;lt;style&amp;gt;
    #reportViewer1 {
        position: absolute;
        left: 5px;
        right: 5px;
        top: 5px;
        bottom: 5px;
        overflow: hidden;
        font-family: Verdana, Arial;
        padding-left: 19%;
        display: none
    }

    #reportForm {
        margin-left: 16%;
        box-shadow: 10px 10px 25px 0px rgba(0,0,0,0.75);
        border-radius: 5px;
    }

    #loader {
        position: fixed;
        top: 50%;
        right: 50%;
        max-width: 20%;
        max-height: 20%;
        background-color: #fff;
        background-image: url('~/img/loading.gif');
        background-repeat: no-repeat;
        background-position: center;
        z-index: 10000000;
        opacity: 0.4;
        filter: alpha(opacity=40); /* For IE8 and earlier */
    }

    .k-widget .k-datepicker {
        width: 100%;
    }
&amp;lt;/style&amp;gt;

&amp;lt;img src="~/img/loading.gif" id="loader" style="display:none" /&amp;gt;
&amp;lt;link rel="stylesheet" href="http://js.arcgis.com/3.32/esri/css/esri.css"&amp;gt;
&amp;lt;script src="http://js.arcgis.com/3.32/"&amp;gt;&amp;lt;/script&amp;gt;

&amp;lt;script&amp;gt;
    /*
       This script is used to create the map on page load.
       Layers are added to the map and the rest of the action is completed on Print button click
    */


    var map;
    var imageUrl, imageLegendUrl;
    var minParc, fullP, sentScale, reportType, globalParcel;
    var mainReportParameters = {};
    var mainReport;
    var documentType;
    var returnScaleValue;


    require(["esri/map",
        "esri/config",
        "esri/dijit/Basemap",
        "esri/dijit/BasemapLayer",
        "esri/layers/ArcGISTiledMapServiceLayer",
        "esri/layers/ArcGISDynamicMapServiceLayer",
        "esri/tasks/QueryTask", "esri/tasks/query",
        "esri/symbols/SimpleFillSymbol",
        "esri/symbols/SimpleLineSymbol", "esri/Color", "esri/graphic",
        'esri/symbols/SimpleMarkerSymbol',
        'dojo/_base/array',
        'esri/geometry/Extent',
        "esri/dijit/Print",
        "esri/tasks/PrintTemplate",
        "dojo/dom", "esri/tasks/PrintTask", "esri/tasks/PrintParameters",
        "dojo/on",
        "dojo/domReady!"],
        function (Map, esriConfig, Basemap, BasemapLayer, ArcGISTiledMapServiceLayer, ArcGISDynamicMapServiceLayer, QueryTask, Query, SimpleFillSymbol, SimpleLineSymbol, Color, Graphic, SimpleMarkerSymbol, array, Extent, Print, PrintTemplate, dom, PrintTask, PrintParameters, on) {

            map = new Map("map", {
                basemap: new Basemap({
                    layers: [new BasemapLayer({
                        url: 'http://10.0.0.10/arcgis/rest/services/Podlogi_Izvodi_500/MapServer'
                    })]
                }),
                extent: new Extent({
                    'xmin': 7530850.8094923375,
                    'ymin': 4647910.133863028,
                    'xmax': 7536270.404088697,
                    'ymax': 4655172.52276435,
                    'spatialReference': {
                        'wkid': 6316
                    }
                }),
                sliderStyle: 'small',
                zoom: 5,

            });

            
            var secondLayer = new ArcGISDynamicMapServiceLayer("http://10.0.0.10:6080/arcgis/rest/services/Karpos_Vector_Izvodi/MapServer", {
                "opacity": 1
            });

            map.addLayer(secondLayer);
            map.on("load", selectRoute);

            function selectRoute() {
                console.log("Security patch #523532.12");
            }
        }
    );

    $(document).ready(function () {

        // - button for report printing
        clicks = function (e) {

            $("#loader").show();
            $("#reportForm").hide();
            reportType = $("input[name='reportButton']:checked").val();
            globalParcel = ($("#buildParcelID").val()).trim();
            printMap();
        }
        // - button for report printing


        selectScale = function () {
            returnScaleValue = document.getElementById("chooseScale").value;

            map.setScale(returnScaleValue);
            console.log("The returned scale value is:", returnScaleValue);
        }


        function printMap() {
            require(["dojo/on", "esri/config", "esri/tasks/QueryTask", "esri/tasks/query", 'esri/symbols/SimpleMarkerSymbol', "esri/symbols/SimpleLineSymbol", "esri/Color", 'esri/geometry/Extent', "esri/tasks/PrintTask", "esri/tasks/PrintParameters", "esri/tasks/PrintTemplate", "dojo/domReady!"],
                function (on, esriConfig, QueryTask, Query, SimpleMarkerSymbol, SimpleLineSymbol, Color, Extent, PrintTask, PrintParameters, PrintTemplate) {
                    console.log("globalParcel :: " + globalParcel + " reportType :: " + reportType + " globalScale :: " + sentScale);
                    var queryTask = new QueryTask("http://app.gdi.mk:6080/arcgis/rest/services/karpos/Karpos_Vector_Izvodi/MapServer/1");
                    var query = new Query();
                    query.where = "code ='" + globalParcel + "'";
                    query.outSpatialReference = map.spatialReference;
                    query.returnGeometry = true;
                    query.outFields = ["*"];
                    queryTask.execute(query).then(zoomToRoute);


                    // ZOOM TO ROUTE
                    function zoomToRoute(features) {

                        var map = this.map;
                        map.graphics.clear();

                        var pointSymbolNew = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 10, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([255, 255, 255]), 1), new Color([255, 0, 127, 1]));
                        var selectedFeature = features.features;
                        selectedFeature[0].setSymbol(pointSymbolNew);
                        map.graphics.add(selectedFeature[0]);

                        map.setScale(returnScaleValue)
                        console.log("map.setScale(returnScaleValue)", returnScaleValue)

                        //map.setScale(sentScale);
                        //console.log("map.setScale(sentScale)", sentScale)
                        map.centerAt(selectedFeature[0].geometry);
                        setTimeout(printImage, 5000);
                    }
                    // ZOOM TO ROUTE

                   

                    // SET COOKIE
                    function setCookie(cname, cvalue, exdays) {
                        var d = new Date();
                        d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
                        var expires = "expires=" + d.toGMTString();
                        document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
                    }
                    // SET COOKIE

                    // PRINT IMAGE
                    function printImage() {

                        var printTask;
                        var params = new PrintParameters();
                       
                            printTask = new PrintTask('http://10.0.0.10:6080/arcgis/rest/services/Print_legend_included/GPServer/Export%20Web%20Map');
                            params.map = map;


                        var template = new PrintTemplate();
                        template.format = 'JPG';
                        template.layout = 'MAP_ONLY';
                        template.preserveScale = false;
                        params.template = template;

                        printTask.execute(params, printResult);
                    }
                    // PRINT IMAGE



                    // PRINT RESULT
                    function printResult(evt) {
                        imageUrl = evt.url;
                        setCookie('imageUrl', imageUrl, 1);

                        if (reportType == 1) {

                            printReport();
                        }
                        if (reportType == 2) {
                            var printTaskLegend;
                            var printPars = new PrintParameters();
                            printPars.map = map;

                            printTaskLegend = new PrintTask('http://10.0.0.10:6080/arcgis/rest/services/Print_legend_included/GPServer/Export%20Web%20Map');
                            params.map = map;

                            var template = new PrintTemplate();
                            template.format = 'JPG';
                            template.layout = 'Print_legend_included';
                            template.preserveScale = true;
                            printPars.template = template;
                            printTaskLegend.execute(printPars, printImageLegend);

                        }
                    }
                    // PRINT RESULT


                    // PRINT IMAGE LEGEND
                    function printImageLegend(evt) {

                        imageLegendUrl = evt.url;
                        setCookie('imageLegendUrl', imageLegendUrl, 1);
                        printReport();
                    }
                    // PRINT IMAGE LEGEND

                });
        }


        // PRINT REPORT FUNCTION
        function printReport() {
            
            var trafficValString = 'Паркирање во рамките на сопствена парцела'
            if ($("#trafficConditionsID").val() == '') {
                trafficVal = trafficValString;
            } else {
                trafficVal = $("#trafficConditionsID").val();
            }

            var miscValString = 'Овој извод е основа за изработка на основен проект/архитектонско - урбанистички проект, кој пак е потребен во постапката за добивање одобрение за градење. Изработката на проектантската документација да е во согласност со законската и подзаконската регулатива од областа.'
            if ($("#miscelanousID").val() == '') {
                miscVal = miscValString;
            } else {
                miscVal = $("#miscelanousID").val();
            }

            if (reportType == 1) {

                documentType = "KarposSingleReportFINAL.trdp"
                mainReportParameters = {
                    "reportNumberID_par": $("#reportNumberID").val(),
                    "dateID_par": $("#dateID").val(),
                    "planNumberID_par": $("#planNumberID").val(),
                    "dupDescription_par": $("#DUPid").val(),
                    "dupDecision_par": $("#odlukaDup").val(),
                    "dupDate_par": $("#datumDup").val(),
                    "klasaNamena_par": $("#klasaNam").val(),
                    "buildParcel_par": minParc,
                    "street_par": $("#streetNameID").val(),
                    "houseNumber_par": $("#houseNumberID option:selected").val(),
                    "municipality_par": $("#KBRid").val(),
                    "detailsDocument_par": $("#detailsDocumentID").val(),
                    "municipalParcel_par": $("#municipalParcelID").val(),
                    "scale_par": $("#scale option:selected").text(),
                    "imageUrl_par": readCookie("imageUrl")
                }
            }
            if (reportType == 2) {

                documentType = "KarposDoubleReport.trdp"
                mainReportParameters = {
                    "reportNumberID_par": $("#reportNumberID").val(),
                    "dateID_par": $("#dateID").val(),
                    "planNumberID_par": $("#planNumberID").val(),
                    "dupDescription_par": $("#DUPid").val(),
                    "dupDecision_par": $("#odlukaDup").val(),
                    "dupDate_par": $("#datumDup").val(),
                    "klasaNamena_par": $("#klasaNam").val(),
                    "buildParcel_par": minParc,
                    "street_par": $("#streetNameID").val(),
                    "houseNumber_par": $("#houseNumberID option:selected").val(),
                    "municipality_par": $("#KBRid").val(),
                    "detailsDocument_par": $("#detailsDocumentID").val(),
                    "municipalParcel_par": $("#municipalParcelID").val(),
                    "scale_par": $("#scale option:selected").text(),
                    "urbanistickaParc_par": $("#urbanistickaParcela").val(),
                    "povrsinaUrbParc_par": $("#povrsinaUrbParc").val() + " м2",
                    "povrsinaGabarit_par": $("#povrsinaGabarit").val() + " м2",
                    "procentIzgradenost_par": $("#procentIzgradenost").val() + "%",
                    "maxIzgPovr_par": $("#maxIzgPovr").val() + " м2",
                    "koefIsko_par": $("#koefIsko").val(),
                    "maxDozH_par": $("#maxDozH").val() + " м",
                    //"maxHSleme_par": maxSleme,
                    "brojParkingMesta_par": $("#brParkingMesta").val(),
                    "drUslovi_par": miscVal,
                    "soobUslovi_par": trafficVal,
                    "imageUrl_par": readCookie("imageUrl"),
                    "imageLegendUrl_par": readCookie("imageLegendUrl")
                }
            }
            $("#reportViewer1").show();
            $("#loader").hide();


            $("#reportViewer1").telerik_ReportViewer({

                serviceUrl: "/karposreports/api/reports/",
                reportSource: {
                    report: documentType,
                    parameters: mainReportParameters
                },
                viewMode: telerikReportViewer.ViewModes.INTERACTIVE,
                scaleMode: telerikReportViewer.ScaleModes.SPECIFIC,
                scale: 1.0,
                enableAccessibility: true,
                sendEmail: { enabled: false },
                ready: function () {
                    //this.refreshReport();
                },
            });
        }
        // PRINT REPORT FUNCTION

    });
&amp;lt;/script&amp;gt;
&amp;lt;div&amp;gt;
    &amp;lt;div&amp;gt;
        &amp;lt;div class="sidebar" data-color="azure" data-background-color="white" /&amp;gt;
        &amp;lt;!--
            Tip 1: You can change the color of the sidebar using: data-color="purple | azure | green | orange | danger"

            Tip 2: you can also add an image using data-image tag
        --&amp;gt;
        &amp;lt;div class="logo"&amp;gt;
            &amp;lt;a href="https://karpos.gov.mk/" class="simple-text logo-normal"&amp;gt;
                Општина Карпош
            &amp;lt;/a&amp;gt;
        &amp;lt;/div&amp;gt;
        &amp;lt;div class="sidebar-wrapper"&amp;gt;
            &amp;lt;ul class="nav"&amp;gt;
                &amp;lt;li class="nav-item active"&amp;gt;
                    &amp;lt;a class="nav-link" asp-controller="DUP" asp-action="PrintReport"&amp;gt;

                        &amp;lt;i class="fa fa-plus-circle" aria-hidden="true"&amp;gt;&amp;lt;/i&amp;gt;
                        &amp;lt;span&amp;gt;Подготви извештај&amp;lt;/span&amp;gt;
                    &amp;lt;/a&amp;gt;
                &amp;lt;/li&amp;gt;
                &amp;lt;li class="nav-item "&amp;gt;
                    &amp;lt;a class="nav-link" href="http://62.162.113.130:6080/karposgis/"&amp;gt;
                        &amp;lt;i class="material-icons"&amp;gt;content_paste&amp;lt;/i&amp;gt;
                        &amp;lt;p&amp;gt;ГИС Прегледник&amp;lt;/p&amp;gt;
                    &amp;lt;/a&amp;gt;
                &amp;lt;/li&amp;gt;
            &amp;lt;/ul&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;

&amp;lt;div id="reportForm"&amp;gt;
        
            &amp;lt;div class="col-sm-6"&amp;gt;
                &amp;lt;label for=""&amp;gt;Размер&amp;lt;/label&amp;gt;
                &amp;lt;select class="form-control" id="chooseScale" name="scale" onmouseup="selectScale()"&amp;gt;
                    &amp;lt;option value="1000" selected&amp;gt;1:1000&amp;lt;/option&amp;gt;
                    &amp;lt;option value="2500"&amp;gt;1:2500&amp;lt;/option&amp;gt;
                &amp;lt;/select&amp;gt;
            &amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;        
&amp;lt;/div&amp;gt;

&amp;lt;div id="reportViewer1" class="k-widget"&amp;gt;
    loading...
&amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I took your code, placed it inside my view. I get the values, they are correct but the printTask is not working now for some reason. Also, it's kind of an issue that initially the dropdown value is 1:1000 but unless I actually click the dropdown, the value is empty.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 25 Dec 2020 19:44:27 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2020-12-25T19:44:27Z</dc:date>
    <item>
      <title>Setting the map scale</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-the-map-scale/m-p/1011598#M71159</link>
      <description>&lt;P&gt;I have a very basic scenario where my map scale is either 1:1000 or 1:2500, so I made two radio buttons. Something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;div class="col-sm-6"&amp;gt;
                &amp;lt;label for=""&amp;gt;Scale&amp;lt;/label&amp;gt;
                &amp;lt;select class="form-control" id="scale" name="scale"&amp;gt;
                    &amp;lt;option value="1" selected&amp;gt;1:1000&amp;lt;/option&amp;gt;
                    &amp;lt;option value="2"&amp;gt;1:2500&amp;lt;/option&amp;gt;
                &amp;lt;/select&amp;gt;
            &amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;Then, depending on the option selected, I either set a global variable to 1000 or 2500, like so&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;//global variable
 var sentScale;
 
 //check which button is clicked and set the variable with the selected value
 var scaleDiv = $("#scale option:selected").val();

            if (scaleDiv == 1) {
                sentScale = 1000;
            } else {
                sentScale = 2500;
            }&lt;/LI-CODE&gt;&lt;P&gt;And then, I set the map scale, like so&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// ZOOM TO ROUTE
                    function zoomToRoute(features) {

                        var map = this.map;
                        map.graphics.clear();

                        var pointSymbolNew = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 10, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([255, 255, 255]), 1), new Color([255, 0, 127, 1]));
                        var selectedFeature = features.features;
                        selectedFeature[0].setSymbol(pointSymbolNew);
                        map.graphics.add(selectedFeature[0]);

                        map.setScale(sentScale);
                        map.centerAt(selectedFeature[0].geometry);
                        setTimeout(printImage, 5000);
                    }&lt;/LI-CODE&gt;&lt;P&gt;And then I use printTask to print out the map&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// PRINT RESULT
                    function printResult(evt) {
                        imageUrl = evt.url;
                        setCookie('imageUrl', imageUrl, 1);

                        if (reportType == 1) {

                            printReport();
                        }
                        if (reportType == 2) {
                            var printTaskLegend;
                            var printPars = new PrintParameters();
                            printPars.map = map;

                            if (sentScale == 1000) {

                                printTaskLegend = new PrintTask('http://10.0.0.10:6080/arcgis/rest/services/Print_legend_included/GPServer/Export%20Web%20Map');
                                printPars.map = map;
                            }
                            else if (sentScale == 2500) {

                                printTaskLegend = new PrintTask('http://10.0.0.10:6080/arcgis/rest/services/Print_legend_included/GPServer/Export%20Web%20Map');
                                printPars.map = map;
                            }

                            var template = new PrintTemplate();
                            template.format = 'JPG';
                            template.layout = 'Print_legend_included';
                            template.preserveScale = true;
                            printPars.template = template;
                            printTaskLegend.execute(printPars, printImageLegend);
                        }&lt;/LI-CODE&gt;&lt;P&gt;So I am printing the report, everything is fine and then the clients get back in touch with me, saying the scale is incorrect. 1:1000 is incorrect, 1:2500 is incorrect. Is this not a good way to set the map scale?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2020 22:18:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-the-map-scale/m-p/1011598#M71159</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-12-21T22:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: Setting the map scale</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-the-map-scale/m-p/1011807#M71175</link>
      <description>&lt;P&gt;Hello, we have created a zoom to scale tool within our organization, but we allow for an input box where you can type in the scale, then zoom to it on the map.&amp;nbsp; perhaps you can use similar logic or get an idea from this code snippet I will provide?&lt;/P&gt;&lt;P&gt;A Preview of the Zoom the Scale Tool within an Application:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="IanPeebles_2-1608659409022.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/2754iA5B687E01B6FA3F3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="IanPeebles_2-1608659409022.png" alt="IanPeebles_2-1608659409022.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The CODE in JS and HTML:&lt;/P&gt;&lt;P&gt;// ***********************************************************************&lt;BR /&gt;// * Zoom to Scale - START *&lt;BR /&gt;// ***********************************************************************&lt;BR /&gt;// Execute Zoom to Scale when Button is Clicked&lt;BR /&gt;on(dom.byId("zoomToScaleBtn"), "click", zoomToScale);&lt;/P&gt;&lt;P&gt;// Zoom to Scale Function&lt;BR /&gt;function zoomToScale () {&lt;BR /&gt;if (dom.byId("zoomToScaleValue").value == "") {&lt;BR /&gt;alert("You must enter in a scale value");&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;// Return Scale Value - Calculation (/12) based on Feet not Meters&lt;BR /&gt;var scaleValue = (dom.byId("zoomToScaleValue").value)*12;&lt;BR /&gt;map.setScale(scaleValue);&lt;BR /&gt;var scaleValueFeet = (scaleValue/12);&lt;BR /&gt;console.log("The map scale is 1:" + scaleValue);&lt;BR /&gt;console.log("Map Scale in Feet 1 inch = " + scaleValueFeet + " feet");&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// Return Map Scale Results to Application - Calculation (/12) based on Feet NOT Meters&lt;BR /&gt;map.on("zoom-end", function() {&lt;BR /&gt;var returnZoomResult = document.getElementById("zoomToScaleResults");&lt;BR /&gt;var scale = map.getScale()/12;&lt;BR /&gt;var roundScale = Math.round(scale);&lt;BR /&gt;returnZoomResult.innerHTML = roundScale + " feet";&lt;BR /&gt;});&lt;BR /&gt;// ***********************************************************************&lt;BR /&gt;// * Zoom to Scale - END *&lt;BR /&gt;// ***********************************************************************&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;!-- ************************************ --&amp;gt;&lt;BR /&gt;&amp;lt;!-- * ZOOM TO SCALE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;* --&amp;gt;&lt;BR /&gt;&amp;lt;!-- ************************************ --&amp;gt;&lt;BR /&gt;&amp;lt;div id="zoomToScaleTextBoxFrame"&amp;gt;&lt;BR /&gt;&amp;lt;input type="search" id="zoomToScaleValue" placeholder="Zoom to Scale (Feet)" onkeypress="if (event.keyCode == 13) document.getElementById('zoomToScaleBtn').click()" /&amp;gt;&lt;BR /&gt;&amp;lt;button id="zoomToScaleBtn" title="Zoom to Scale"&amp;gt;&amp;lt;/button&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Print layout scale:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="IanPeebles_1-1608659273743.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/2753iA4DEE291101B56F1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="IanPeebles_1-1608659273743.png" alt="IanPeebles_1-1608659273743.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am wondering if you can choose the scale within the map first, then run the print task?&amp;nbsp; Or are you wanting to choose the scale when you are initiating the print task?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2020 17:54:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-the-map-scale/m-p/1011807#M71175</guid>
      <dc:creator>IanPeebles</dc:creator>
      <dc:date>2020-12-22T17:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: Setting the map scale</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-the-map-scale/m-p/1011876#M71177</link>
      <description>&lt;P&gt;Ian,&lt;/P&gt;&lt;P&gt;Yes, I first choose the scale then I set the map scale and they I run &lt;STRONG&gt;printTask&lt;/STRONG&gt;. This is what my form /view looks like, the highlighted in red is the scale for the map.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="NovicaJ_0-1608668450239.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/2763i934BCC161427A799/image-size/medium?v=v2&amp;amp;px=400" role="button" title="NovicaJ_0-1608668450239.png" alt="NovicaJ_0-1608668450239.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;First comes the scale dropdown&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;div class="col-sm-6"&amp;gt;
                &amp;lt;label for=""&amp;gt;Размер&amp;lt;/label&amp;gt;
                &amp;lt;select class="form-control" id="scale" name="scale"&amp;gt;
                    &amp;lt;option value="1" selected&amp;gt;1:1000&amp;lt;/option&amp;gt;
                    &amp;lt;option value="2"&amp;gt;1:2500&amp;lt;/option&amp;gt;
                &amp;lt;/select&amp;gt;
            &amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;then I check the dropdown option which was clicked&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var scaleDiv = $("#scale option:selected").val();

            if (scaleDiv == 1) {
                //sentScale = "1000";
                sentScale = 1000;
            } else {
                //sentScale = "2500";
                sentScale = 2500;
            }&lt;/LI-CODE&gt;&lt;P&gt;and I set the scale value according to which option from the dropdown was clicked. Then I execute the &lt;STRONG&gt;printMap()&lt;/STRONG&gt; function which contains &lt;STRONG&gt;zoomToRoute&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function printMap() {
            require(["dojo/on", "esri/config", "esri/tasks/QueryTask", "esri/tasks/query", 'esri/symbols/SimpleMarkerSymbol', "esri/symbols/SimpleLineSymbol", "esri/Color", 'esri/geometry/Extent', "esri/tasks/PrintTask", "esri/tasks/PrintParameters", "esri/tasks/PrintTemplate", "dojo/domReady!"],
                function (on, esriConfig, QueryTask, Query, SimpleMarkerSymbol, SimpleLineSymbol, Color, Extent, PrintTask, PrintParameters, PrintTemplate) {
                    console.log("globalParcel :: " + globalParcel + " reportType :: " + reportType + " globalScale :: " + sentScale);
                    //var queryTask = new QueryTask("http://app.gdi.mk:6080/arcgis/rest/services/karpos/Karpos_Vector_Izvodi/MapServer/1");
                    var queryTask = new QueryTask("http://10.0.0.10:6080/arcgis/rest/services/Karpos_Vector_Izvodi/MapServer/1");
                    var query = new Query();
                    query.where = "code ='" + globalParcel + "'";
                    query.outSpatialReference = map.spatialReference;
                    query.returnGeometry = true;
                    query.outFields = ["*"];
                    queryTask.execute(query).then(zoomToRoute);


                    // ZOOM TO ROUTE
                    function zoomToRoute(features) {

                        var map = this.map;
                        map.graphics.clear();

                        var pointSymbolNew = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 10, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([255, 255, 255]), 1), new Color([255, 0, 127, 1]));
                        var selectedFeature = features.features;
                        selectedFeature[0].setSymbol(pointSymbolNew);
                        map.graphics.add(selectedFeature[0]);

                        map.setScale(sentScale);
                        console.log("map.setScale(sentScale)", sentScale)
                        map.centerAt(selectedFeature[0].geometry);
                        setTimeout(printImage, 5000);
                    }
                    // ZOOM TO ROUTE
}&lt;/LI-CODE&gt;&lt;P&gt;and in the zoomToRoute, I set the map scale with&lt;STRONG&gt;&amp;nbsp;map.setScale(sentScale);&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2020 20:29:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-the-map-scale/m-p/1011876#M71177</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-12-22T20:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: Setting the map scale</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-the-map-scale/m-p/1012017#M71180</link>
      <description>&lt;P&gt;What coordinate system are you using?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Dec 2020 13:11:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-the-map-scale/m-p/1012017#M71180</guid>
      <dc:creator>IanPeebles</dc:creator>
      <dc:date>2020-12-23T13:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: Setting the map scale</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-the-map-scale/m-p/1012040#M71181</link>
      <description>&lt;P&gt;The coordinate system is 6316, that's what we use in my country.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Dec 2020 14:11:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-the-map-scale/m-p/1012040#M71181</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-12-23T14:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Setting the map scale</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-the-map-scale/m-p/1012063#M71182</link>
      <description>&lt;P&gt;Here is what I came up with to set the map scale when using the choice list:&lt;/P&gt;&lt;P&gt;Choice List from Application:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="IanPeebles_0-1608736384111.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/2811iC48528290EA9CDEF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="IanPeebles_0-1608736384111.png" alt="IanPeebles_0-1608736384111.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;JavaScript Code:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="IanPeebles_1-1608736400212.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/2812i0060DB7FA05CF347/image-size/medium?v=v2&amp;amp;px=400" role="button" title="IanPeebles_1-1608736400212.png" alt="IanPeebles_1-1608736400212.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="IanPeebles_5-1608736645366.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/2817iAD9A39AE7512A9BB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="IanPeebles_5-1608736645366.png" alt="IanPeebles_5-1608736645366.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HTML Code:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="IanPeebles_2-1608736414882.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/2813i0006DA3770ECACDA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="IanPeebles_2-1608736414882.png" alt="IanPeebles_2-1608736414882.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When choosing the option, then the mouse is up, the zoom to scale will execute. The map changes zoom.&lt;/P&gt;&lt;P&gt;I added console statements to track the changing map scale.&amp;nbsp; Here are examples of those that returned in the console.log:&lt;/P&gt;&lt;P&gt;For 1000 Scale:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="IanPeebles_3-1608736497779.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/2814i8C2B9EC08BB0B36B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="IanPeebles_3-1608736497779.png" alt="IanPeebles_3-1608736497779.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For 2500 Scale:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="IanPeebles_4-1608736510224.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/2815iE7545E0E71CFDACC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="IanPeebles_4-1608736510224.png" alt="IanPeebles_4-1608736510224.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Will something like that work?&amp;nbsp; I don't think the map scale will change on the print layout.&amp;nbsp; We use a zoom tool where you type in the scale and then a zoom occurs on the map.&amp;nbsp; When we go to print the layout, the map scale is preserved.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Dec 2020 15:19:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-the-map-scale/m-p/1012063#M71182</guid>
      <dc:creator>IanPeebles</dc:creator>
      <dc:date>2020-12-23T15:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: Setting the map scale</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-the-map-scale/m-p/1012338#M71191</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;@model ModelLayer.Models.ReportModel

@{
    ViewData["Title"] = "Извештај";
}

&amp;lt;script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"&amp;gt;&amp;lt;/script&amp;gt;

&amp;lt;link rel="stylesheet" href="http://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css" /&amp;gt;
&amp;lt;script src="http://code.jquery.com/ui/1.12.1/jquery-ui.min.js"&amp;gt;&amp;lt;/script&amp;gt;

&amp;lt;script src="~/js/bootstrap.min.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;link href="~/css/bootstrap.min.css" rel="stylesheet" /&amp;gt;

&amp;lt;link href="http://kendo.cdn.telerik.com/2020.2.513/styles/kendo.common.min.css" rel="stylesheet" /&amp;gt;
&amp;lt;link href="http://kendo.cdn.telerik.com/2020.2.513/styles/kendo.default.min.css" rel="stylesheet" /&amp;gt;
&amp;lt;script src="http://kendo.cdn.telerik.com/2020.2.513/js/kendo.all.min.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script src="~/js/kendo.aspnetmvc.min.js"&amp;gt;&amp;lt;/script&amp;gt;

&amp;lt;!--If Kendo is used it should be added before the report viewer.--&amp;gt;
&amp;lt;script src="~/Reports/telerikReportViewer-14.2.20.1021.min.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script src="~/Reports/telerikReportViewer.kendo-14.2.20.1021.min.js"&amp;gt;&amp;lt;/script&amp;gt;

&amp;lt;script&amp;gt;
    window.rootUrl = '@Url.Content("~/")';
&amp;lt;/script&amp;gt;

&amp;lt;style&amp;gt;
    #reportViewer1 {
        position: absolute;
        left: 5px;
        right: 5px;
        top: 5px;
        bottom: 5px;
        overflow: hidden;
        font-family: Verdana, Arial;
        padding-left: 19%;
        display: none
    }

    #reportForm {
        margin-left: 16%;
        box-shadow: 10px 10px 25px 0px rgba(0,0,0,0.75);
        border-radius: 5px;
    }

    #loader {
        position: fixed;
        top: 50%;
        right: 50%;
        max-width: 20%;
        max-height: 20%;
        background-color: #fff;
        background-image: url('~/img/loading.gif');
        background-repeat: no-repeat;
        background-position: center;
        z-index: 10000000;
        opacity: 0.4;
        filter: alpha(opacity=40); /* For IE8 and earlier */
    }

    .k-widget .k-datepicker {
        width: 100%;
    }
&amp;lt;/style&amp;gt;

&amp;lt;img src="~/img/loading.gif" id="loader" style="display:none" /&amp;gt;
&amp;lt;link rel="stylesheet" href="http://js.arcgis.com/3.32/esri/css/esri.css"&amp;gt;
&amp;lt;script src="http://js.arcgis.com/3.32/"&amp;gt;&amp;lt;/script&amp;gt;

&amp;lt;script&amp;gt;
    /*
       This script is used to create the map on page load.
       Layers are added to the map and the rest of the action is completed on Print button click
    */


    var map;
    var imageUrl, imageLegendUrl;
    var minParc, fullP, sentScale, reportType, globalParcel;
    var mainReportParameters = {};
    var mainReport;
    var documentType;
    var returnScaleValue;


    require(["esri/map",
        "esri/config",
        "esri/dijit/Basemap",
        "esri/dijit/BasemapLayer",
        "esri/layers/ArcGISTiledMapServiceLayer",
        "esri/layers/ArcGISDynamicMapServiceLayer",
        "esri/tasks/QueryTask", "esri/tasks/query",
        "esri/symbols/SimpleFillSymbol",
        "esri/symbols/SimpleLineSymbol", "esri/Color", "esri/graphic",
        'esri/symbols/SimpleMarkerSymbol',
        'dojo/_base/array',
        'esri/geometry/Extent',
        "esri/dijit/Print",
        "esri/tasks/PrintTemplate",
        "dojo/dom", "esri/tasks/PrintTask", "esri/tasks/PrintParameters",
        "dojo/on",
        "dojo/domReady!"],
        function (Map, esriConfig, Basemap, BasemapLayer, ArcGISTiledMapServiceLayer, ArcGISDynamicMapServiceLayer, QueryTask, Query, SimpleFillSymbol, SimpleLineSymbol, Color, Graphic, SimpleMarkerSymbol, array, Extent, Print, PrintTemplate, dom, PrintTask, PrintParameters, on) {

            map = new Map("map", {
                basemap: new Basemap({
                    layers: [new BasemapLayer({
                        url: 'http://10.0.0.10/arcgis/rest/services/Podlogi_Izvodi_500/MapServer'
                    })]
                }),
                extent: new Extent({
                    'xmin': 7530850.8094923375,
                    'ymin': 4647910.133863028,
                    'xmax': 7536270.404088697,
                    'ymax': 4655172.52276435,
                    'spatialReference': {
                        'wkid': 6316
                    }
                }),
                sliderStyle: 'small',
                zoom: 5,

            });

            
            var secondLayer = new ArcGISDynamicMapServiceLayer("http://10.0.0.10:6080/arcgis/rest/services/Karpos_Vector_Izvodi/MapServer", {
                "opacity": 1
            });

            map.addLayer(secondLayer);
            map.on("load", selectRoute);

            function selectRoute() {
                console.log("Security patch #523532.12");
            }
        }
    );

    $(document).ready(function () {

        // - button for report printing
        clicks = function (e) {

            $("#loader").show();
            $("#reportForm").hide();
            reportType = $("input[name='reportButton']:checked").val();
            globalParcel = ($("#buildParcelID").val()).trim();
            printMap();
        }
        // - button for report printing


        selectScale = function () {
            returnScaleValue = document.getElementById("chooseScale").value;

            map.setScale(returnScaleValue);
            console.log("The returned scale value is:", returnScaleValue);
        }


        function printMap() {
            require(["dojo/on", "esri/config", "esri/tasks/QueryTask", "esri/tasks/query", 'esri/symbols/SimpleMarkerSymbol', "esri/symbols/SimpleLineSymbol", "esri/Color", 'esri/geometry/Extent', "esri/tasks/PrintTask", "esri/tasks/PrintParameters", "esri/tasks/PrintTemplate", "dojo/domReady!"],
                function (on, esriConfig, QueryTask, Query, SimpleMarkerSymbol, SimpleLineSymbol, Color, Extent, PrintTask, PrintParameters, PrintTemplate) {
                    console.log("globalParcel :: " + globalParcel + " reportType :: " + reportType + " globalScale :: " + sentScale);
                    var queryTask = new QueryTask("http://app.gdi.mk:6080/arcgis/rest/services/karpos/Karpos_Vector_Izvodi/MapServer/1");
                    var query = new Query();
                    query.where = "code ='" + globalParcel + "'";
                    query.outSpatialReference = map.spatialReference;
                    query.returnGeometry = true;
                    query.outFields = ["*"];
                    queryTask.execute(query).then(zoomToRoute);


                    // ZOOM TO ROUTE
                    function zoomToRoute(features) {

                        var map = this.map;
                        map.graphics.clear();

                        var pointSymbolNew = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 10, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([255, 255, 255]), 1), new Color([255, 0, 127, 1]));
                        var selectedFeature = features.features;
                        selectedFeature[0].setSymbol(pointSymbolNew);
                        map.graphics.add(selectedFeature[0]);

                        map.setScale(returnScaleValue)
                        console.log("map.setScale(returnScaleValue)", returnScaleValue)

                        //map.setScale(sentScale);
                        //console.log("map.setScale(sentScale)", sentScale)
                        map.centerAt(selectedFeature[0].geometry);
                        setTimeout(printImage, 5000);
                    }
                    // ZOOM TO ROUTE

                   

                    // SET COOKIE
                    function setCookie(cname, cvalue, exdays) {
                        var d = new Date();
                        d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
                        var expires = "expires=" + d.toGMTString();
                        document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
                    }
                    // SET COOKIE

                    // PRINT IMAGE
                    function printImage() {

                        var printTask;
                        var params = new PrintParameters();
                       
                            printTask = new PrintTask('http://10.0.0.10:6080/arcgis/rest/services/Print_legend_included/GPServer/Export%20Web%20Map');
                            params.map = map;


                        var template = new PrintTemplate();
                        template.format = 'JPG';
                        template.layout = 'MAP_ONLY';
                        template.preserveScale = false;
                        params.template = template;

                        printTask.execute(params, printResult);
                    }
                    // PRINT IMAGE



                    // PRINT RESULT
                    function printResult(evt) {
                        imageUrl = evt.url;
                        setCookie('imageUrl', imageUrl, 1);

                        if (reportType == 1) {

                            printReport();
                        }
                        if (reportType == 2) {
                            var printTaskLegend;
                            var printPars = new PrintParameters();
                            printPars.map = map;

                            printTaskLegend = new PrintTask('http://10.0.0.10:6080/arcgis/rest/services/Print_legend_included/GPServer/Export%20Web%20Map');
                            params.map = map;

                            var template = new PrintTemplate();
                            template.format = 'JPG';
                            template.layout = 'Print_legend_included';
                            template.preserveScale = true;
                            printPars.template = template;
                            printTaskLegend.execute(printPars, printImageLegend);

                        }
                    }
                    // PRINT RESULT


                    // PRINT IMAGE LEGEND
                    function printImageLegend(evt) {

                        imageLegendUrl = evt.url;
                        setCookie('imageLegendUrl', imageLegendUrl, 1);
                        printReport();
                    }
                    // PRINT IMAGE LEGEND

                });
        }


        // PRINT REPORT FUNCTION
        function printReport() {
            
            var trafficValString = 'Паркирање во рамките на сопствена парцела'
            if ($("#trafficConditionsID").val() == '') {
                trafficVal = trafficValString;
            } else {
                trafficVal = $("#trafficConditionsID").val();
            }

            var miscValString = 'Овој извод е основа за изработка на основен проект/архитектонско - урбанистички проект, кој пак е потребен во постапката за добивање одобрение за градење. Изработката на проектантската документација да е во согласност со законската и подзаконската регулатива од областа.'
            if ($("#miscelanousID").val() == '') {
                miscVal = miscValString;
            } else {
                miscVal = $("#miscelanousID").val();
            }

            if (reportType == 1) {

                documentType = "KarposSingleReportFINAL.trdp"
                mainReportParameters = {
                    "reportNumberID_par": $("#reportNumberID").val(),
                    "dateID_par": $("#dateID").val(),
                    "planNumberID_par": $("#planNumberID").val(),
                    "dupDescription_par": $("#DUPid").val(),
                    "dupDecision_par": $("#odlukaDup").val(),
                    "dupDate_par": $("#datumDup").val(),
                    "klasaNamena_par": $("#klasaNam").val(),
                    "buildParcel_par": minParc,
                    "street_par": $("#streetNameID").val(),
                    "houseNumber_par": $("#houseNumberID option:selected").val(),
                    "municipality_par": $("#KBRid").val(),
                    "detailsDocument_par": $("#detailsDocumentID").val(),
                    "municipalParcel_par": $("#municipalParcelID").val(),
                    "scale_par": $("#scale option:selected").text(),
                    "imageUrl_par": readCookie("imageUrl")
                }
            }
            if (reportType == 2) {

                documentType = "KarposDoubleReport.trdp"
                mainReportParameters = {
                    "reportNumberID_par": $("#reportNumberID").val(),
                    "dateID_par": $("#dateID").val(),
                    "planNumberID_par": $("#planNumberID").val(),
                    "dupDescription_par": $("#DUPid").val(),
                    "dupDecision_par": $("#odlukaDup").val(),
                    "dupDate_par": $("#datumDup").val(),
                    "klasaNamena_par": $("#klasaNam").val(),
                    "buildParcel_par": minParc,
                    "street_par": $("#streetNameID").val(),
                    "houseNumber_par": $("#houseNumberID option:selected").val(),
                    "municipality_par": $("#KBRid").val(),
                    "detailsDocument_par": $("#detailsDocumentID").val(),
                    "municipalParcel_par": $("#municipalParcelID").val(),
                    "scale_par": $("#scale option:selected").text(),
                    "urbanistickaParc_par": $("#urbanistickaParcela").val(),
                    "povrsinaUrbParc_par": $("#povrsinaUrbParc").val() + " м2",
                    "povrsinaGabarit_par": $("#povrsinaGabarit").val() + " м2",
                    "procentIzgradenost_par": $("#procentIzgradenost").val() + "%",
                    "maxIzgPovr_par": $("#maxIzgPovr").val() + " м2",
                    "koefIsko_par": $("#koefIsko").val(),
                    "maxDozH_par": $("#maxDozH").val() + " м",
                    //"maxHSleme_par": maxSleme,
                    "brojParkingMesta_par": $("#brParkingMesta").val(),
                    "drUslovi_par": miscVal,
                    "soobUslovi_par": trafficVal,
                    "imageUrl_par": readCookie("imageUrl"),
                    "imageLegendUrl_par": readCookie("imageLegendUrl")
                }
            }
            $("#reportViewer1").show();
            $("#loader").hide();


            $("#reportViewer1").telerik_ReportViewer({

                serviceUrl: "/karposreports/api/reports/",
                reportSource: {
                    report: documentType,
                    parameters: mainReportParameters
                },
                viewMode: telerikReportViewer.ViewModes.INTERACTIVE,
                scaleMode: telerikReportViewer.ScaleModes.SPECIFIC,
                scale: 1.0,
                enableAccessibility: true,
                sendEmail: { enabled: false },
                ready: function () {
                    //this.refreshReport();
                },
            });
        }
        // PRINT REPORT FUNCTION

    });
&amp;lt;/script&amp;gt;
&amp;lt;div&amp;gt;
    &amp;lt;div&amp;gt;
        &amp;lt;div class="sidebar" data-color="azure" data-background-color="white" /&amp;gt;
        &amp;lt;!--
            Tip 1: You can change the color of the sidebar using: data-color="purple | azure | green | orange | danger"

            Tip 2: you can also add an image using data-image tag
        --&amp;gt;
        &amp;lt;div class="logo"&amp;gt;
            &amp;lt;a href="https://karpos.gov.mk/" class="simple-text logo-normal"&amp;gt;
                Општина Карпош
            &amp;lt;/a&amp;gt;
        &amp;lt;/div&amp;gt;
        &amp;lt;div class="sidebar-wrapper"&amp;gt;
            &amp;lt;ul class="nav"&amp;gt;
                &amp;lt;li class="nav-item active"&amp;gt;
                    &amp;lt;a class="nav-link" asp-controller="DUP" asp-action="PrintReport"&amp;gt;

                        &amp;lt;i class="fa fa-plus-circle" aria-hidden="true"&amp;gt;&amp;lt;/i&amp;gt;
                        &amp;lt;span&amp;gt;Подготви извештај&amp;lt;/span&amp;gt;
                    &amp;lt;/a&amp;gt;
                &amp;lt;/li&amp;gt;
                &amp;lt;li class="nav-item "&amp;gt;
                    &amp;lt;a class="nav-link" href="http://62.162.113.130:6080/karposgis/"&amp;gt;
                        &amp;lt;i class="material-icons"&amp;gt;content_paste&amp;lt;/i&amp;gt;
                        &amp;lt;p&amp;gt;ГИС Прегледник&amp;lt;/p&amp;gt;
                    &amp;lt;/a&amp;gt;
                &amp;lt;/li&amp;gt;
            &amp;lt;/ul&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;

&amp;lt;div id="reportForm"&amp;gt;
        
            &amp;lt;div class="col-sm-6"&amp;gt;
                &amp;lt;label for=""&amp;gt;Размер&amp;lt;/label&amp;gt;
                &amp;lt;select class="form-control" id="chooseScale" name="scale" onmouseup="selectScale()"&amp;gt;
                    &amp;lt;option value="1000" selected&amp;gt;1:1000&amp;lt;/option&amp;gt;
                    &amp;lt;option value="2500"&amp;gt;1:2500&amp;lt;/option&amp;gt;
                &amp;lt;/select&amp;gt;
            &amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;        
&amp;lt;/div&amp;gt;

&amp;lt;div id="reportViewer1" class="k-widget"&amp;gt;
    loading...
&amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I took your code, placed it inside my view. I get the values, they are correct but the printTask is not working now for some reason. Also, it's kind of an issue that initially the dropdown value is 1:1000 but unless I actually click the dropdown, the value is empty.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Dec 2020 19:44:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-the-map-scale/m-p/1012338#M71191</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-12-25T19:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Setting the map scale</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-the-map-scale/m-p/1588479#M86563</link>
      <description>&lt;P&gt;Another solution is:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;JS-Code:&lt;/P&gt;&lt;P&gt;function zoomToScale () {&lt;/P&gt;&lt;P&gt;scaleValue=document.getElementById("scaleAuswahl").value;&lt;BR /&gt;view.scale=scaleValue;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;document.getElementById("scaleAuswahl").onchange=zoomToScale;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;HTML-Code:&lt;BR /&gt;&amp;lt;select id='scaleAuswahl'&amp;gt;&lt;BR /&gt;&amp;lt;option value="" selected &amp;gt;Auswahl Maßstab&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option value="50"&amp;gt;1:50 (ca.)&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option value="100"&amp;gt;1:100 (ca.)&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option value="200"&amp;gt;1:200 (ca.)&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option value="250"&amp;gt;1:250 (ca.)&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option value="300"&amp;gt;1:300 (ca.)&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option value="500"&amp;gt;1:500 (ca.)&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option value="750"&amp;gt;1:750 (ca.)&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option value="1000"&amp;gt;1:1000 (ca.)&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option value="1500"&amp;gt;1:1500 (ca.)&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option value="2000"&amp;gt;1:2000 (ca.)&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option value="2500"&amp;gt;1:2500 (ca.)&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option value="5000"&amp;gt;1:5000 (ca.)&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option value="7500"&amp;gt;1:7500 (ca.)&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option value="10000"&amp;gt;1:10000 (ca.)&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option value="15000"&amp;gt;1:15000 (ca.)&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option value="20000"&amp;gt;1:20000 (ca.)&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option value="25000"&amp;gt;1:25000 (ca.)&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option value="50000"&amp;gt;1:50000 (ca.)&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;/select&amp;gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2025 12:41:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-the-map-scale/m-p/1588479#M86563</guid>
      <dc:creator>KaiBehncke</dc:creator>
      <dc:date>2025-02-24T12:41:24Z</dc:date>
    </item>
  </channel>
</rss>

