Select to view content in your preferred language

How to add print widget to my map ?

762
5
Jump to solution
02-28-2018 06:19 AM
AmalHorchi
New Contributor II

How to add print widget to my map ? 

Can you please help me to add print widget to my code . 

 

 

<!DOCTYPE html>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" />
<title> Population Totale </title>
<link rel="stylesheet" href="http://js.arcgis.com/3.16/dijit/themes/tundra/tundra.css">

<link rel="stylesheet" href="http://js.arcgis.com/3.16/esri/css/esri.css">

<style>


#HomeButton { position: absolute; top: 90px; left: 20px; z-index: 2; }

html,
body {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
#map {
margin: 0;
padding: 0;
}
#feedback {
position: absolute;
height: 390px;
font-family: arial;
margin: 5px;
padding: 10px;
z-index: 40;
background: #fff;
color: #444;
width: 300px;
right: 10px;
top: 10px;
box-shadow: 0 0 5px #888;
}

#legendWrapper {
padding: 10px 0 0 0;
}
#note {
font-size: 80%;
font-weight: 700;
padding: 0 0 10px 0;
}
h3 {
margin: 0 0 5px 0;
border-bottom: 1px solid #444;
}

</style>

<script src="http://js.arcgis.com/3.16/"></script>

<script>
//global vars
var layer, legend;


require([

"esri/map",
"esri/dijit/BasemapGallery",
"esri/dijit/HomeButton" ,

"esri/dijit/PopupTemplate",
"esri/layers/FeatureLayer",
"esri/dijit/Legend",
"esri/renderers/smartMapping",

"dojo/_base/array",
"dojo/dom",
"dojo/dom-construct",
"dojo/data/ItemFileReadStore",
"dijit/form/FilteringSelect",
"dojo/parser",

"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",

"dojo/domReady!"

], function (
Map,BasemapGallery,
HomeButton ,

PopupTemplate,
FeatureLayer,
Legend,
smartMapping,

array,
dom,
domConstruct,
ItemFileReadStore,
FilteringSelect,
parser

) {

parser.parse();

var mapOptions = {
basemap: "topo",
center: [11,34],

zoom: 6,
slider: true ,


};


var map = new Map("map", mapOptions);

var basemapGallery = new BasemapGallery({
showArcGISBasemaps: true,
map: map
}, "basemapGallery");
basemapGallery.startup();

basemapGallery.on("error", function(msg) {
console.log("basemap gallery error: ", msg);
});

// map.enableKeyboardNavigation();

var home = new HomeButton(
{
map: map
}, "HomeButton");
home.startup();


var fieldName = "PopTot2004";

// the counties map service uses the actual field name as the field alias
// set up an object to use as a lookup table to work with user friendly field names

var fields = {
"PopTot2004": "Population Totale (2004)",
"PopTot2005": "Population Totale (2005)",
"PopTot2006": "Population Totale (2006)",
"PopTot2007": "Population Totale (2007)",
"PopTot2008": "Population Totale (2008)" ,
"PopTot2009": "Population Totale (2009)" ,
"PopTot2010": "Population Totale (2010)" ,
"PopTot2011": "Population Totale (2011)" ,
"PopTot2012": "Population Totale (2012)" ,
"PopTot2013": "Population Totale (2013)" ,
"PopTot2014": "Population Totale (2014)",
"NOM" : "NOM"


};
var outFields = ["PopTot2004", "PopTot2005", "PopTot2006", "PopTot2007","PopTot2008","PopTot2009","PopTot2010","PopTot2011","PopTot2012","PopTot2013","PopTot2014","NOM"];

//create popup
var popupTemplate = new PopupTemplate({
title: "{NOM}",
fieldInfos: [


{
"fieldName": fieldName,
"label": fields[fieldName],
"visible": true,
"format": {
places: 0,
digitSeparator: true
}
}],
showAttachments: true
});

layer = new FeatureLayer("http://41.231.36.249/sirgeo/rest/services/SIR-Gouv/demographie_gouv/MapServer/0", {
"id": "Chad",
"infoTemplate": popupTemplate,
"mode": FeatureLayer.MODE_SNAPSHOT,
"outFields": outFields,
"opacity": 0.8


});

//only working with Washington state
//layer.setDefinitionExpression("Region='NO'");
map.addLayer(layer);

layer.on("load", function () {
createRenderer(fieldName);
});

function createRenderer(field) {
//smart mapping functionality begins
smartMapping.createClassedColorRenderer({
layer: layer,
field: field,
basemap: map.getBasemap(),
classificationMethod: "quantile" ,
numClasses:3,
//ClassBreakInfo(null, minValue:100000, maxValue:250000),

showOthers:false

}).then(function (response) {
layer.setRenderer(response.renderer);
layer.redraw();
createLegend(map, layer, field);
});
}

//this function gets called when fields are selected to render
function updateAttribute(ch) {
map.infoWindow.hide();

var popupTemplateUpdated = new PopupTemplate({
title: "{NOM}",
fieldInfos: [{ 
"fieldName": ch, 
"label": fields[ch], 
"visible": true, 
"format": { places: 0, digitSeparator: true } 
}],
showAttachments: true
});
layer.setInfoTemplate(popupTemplateUpdated);
createRenderer(ch);
layer.redraw();
createLegend(map, layer, ch);
}

//Create a legend
function createLegend(map, layer, field) {
//If applicable, destroy previous legend
if (legend) {
legend.destroy();
domConstruct.destroy(dom.byId("legendDiv"));
}

// create a new div for the legend
var legendDiv = domConstruct.create("div", {
id: "legendDiv"
}, dom.byId("legendWrapper"));

legend = new Legend({
map: map,
layerInfos: [{
layer: layer,
title: "Indicateur: " ,

}]
}, legendDiv);
legend.startup();
}

// create a store and a filtering select for the county layer's fields
var fieldNames, fieldStore, fieldSelect;
fieldNames = {
"identifier": "value",
"label": "name",
"items": []
};
array.forEach(outFields, function (f) {
if (array.indexOf(f.split("_"), "NOM") == -1) { // exclude attrs that contain "NAME"
fieldNames.items.push({
"name": fields,
"value": f
});
}
});

fieldStore = new ItemFileReadStore({
data: fieldNames
});
fieldSelect = new FilteringSelect({
displayedValue: fieldNames.items[0].name,
value: fieldNames.items[0].value,
name: "fieldsFS",
required: false,
store: fieldStore,
searchAttr: "name",
style: {
"width": "290px",
"fontSize": "12pt",
"color": "#444"
}
}, domConstruct.create("div", null, dom.byId("fieldWrapper")));
fieldSelect.on("change", updateAttribute);

});

</script>
</head>

<body class="tundra">

<div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="design:'headline',gutters:false" style="width: 100%; height: 100%; margin: 0;">
<div id="map" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'">

<div id="feedback">
<h3>Population Totale(milliers habitants) </h3>
<div id="info">
Sélectionnez une année pour une visualisation cartographiqe .
</div>
<div id="legendWrapper"></div>
<div id="fieldWrapper">
Veuillez choisir l'année
</div>
</div>
</div>
</div>

<div id="HomeButton"></div>

<div style="position:absolute; left:20px; top:150px; z-Index:999;">
<div data-dojo-type="dijit/TitlePane" 
data-dojo-props="title:'Fond de carte', closable:false, open:false">
<div data-dojo-type="dijit/layout/ContentPane" style="width:380px; height:280px; overflow:auto;">
<div id="basemapGallery"></div>
</div>
</div>
</div>

</body>

</html>

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Amal,

   Here is your code update to include the Print Dijit:

<!DOCTYPE html>
<html>

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" />
  <title> Population Totale </title>
  <link rel="stylesheet" href="http://js.arcgis.com/3.16/dijit/themes/tundra/tundra.css">

  <link rel="stylesheet" href="http://js.arcgis.com/3.16/esri/css/esri.css">

  <style>
    #HomeButton {
      position: absolute;
      top: 90px;
      left: 20px;
      z-index: 2;
    }

    html,
    body {
      height: 100%;
      width: 100%;
      margin: 0;
      padding: 0;
    }

    #map {
      margin: 0;
      padding: 0;
    }

    #feedback {
      position: absolute;
      height: 390px;
      font-family: arial;
      margin: 5px;
      padding: 10px;
      z-index: 40;
      background: #fff;
      color: #444;
      width: 300px;
      right: 10px;
      top: 10px;
      box-shadow: 0 0 5px #888;
    }

    #legendWrapper {
      padding: 10px 0 0 0;
    }

    #note {
      font-size: 80%;
      font-weight: 700;
      padding: 0 0 10px 0;
    }

    h3 {
      margin: 0 0 5px 0;
      border-bottom: 1px solid #444;
    }
  </style>
  <script src="http://js.arcgis.com/3.16/"></script>
  <script>
    //global vars
    var layer, legend;
    require([
      "esri/map",
      "esri/dijit/BasemapGallery",
      "esri/dijit/HomeButton",
      "esri/dijit/PopupTemplate",
      "esri/layers/FeatureLayer",
      "esri/dijit/Legend",
      "esri/renderers/smartMapping",
      "dojo/_base/array",
      "dojo/dom",
      "dojo/dom-construct",
      "dojo/data/ItemFileReadStore",
      "dijit/form/FilteringSelect",
      "esri/dijit/Print",
      "dojo/parser",
      "dijit/layout/BorderContainer",
      "dijit/layout/ContentPane",
      "dojo/domReady!"
    ], function(
      Map,
      BasemapGallery,
      HomeButton,
      PopupTemplate,
      FeatureLayer,
      Legend,
      smartMapping,
      array,
      dom,
      domConstruct,
      ItemFileReadStore,
      FilteringSelect,
      Print,
      parser
    ) {
      parser.parse();

      var mapOptions = {
        basemap: "topo",
        center: [11, 34],
        zoom: 6,
        slider: true
      };

      var map = new Map("map", mapOptions);

      var basemapGallery = new BasemapGallery({
        showArcGISBasemaps: true,
        map: map
      }, "basemapGallery");

      basemapGallery.startup();
      basemapGallery.on("error", function(msg) {
        console.log("basemap gallery error: ", msg);
      });

      // map.enableKeyboardNavigation();
      var home = new HomeButton({
        map: map
      }, "HomeButton");
      home.startup();

      var printer = new Print({
        map: map,
        url: "http://41.231.36.249/sirgeo/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task",
        templates: [{
          label: "Map",
          format: "PDF",
          layout: "MAP_ONLY",
          exportOptions: {
            width: 500,
            height: 400,
            dpi: 96
          }
        }, {
          label: "Layout",
          format: "PDF",
          layout: "A4 Portrait",
          layoutOptions: {
            titleText: "My Print",
            authorText: "esri",
            copyrightText: "My Company",
            scalebarUnit: "Miles",
          }
        }]
      }, dom.byId("printButton"));

      printer.startup();

      var fieldName = "PopTot2004";

      // the counties map service uses the actual field name as the field alias
      // set up an object to use as a lookup table to work with user friendly field names

      var fields = {
        "PopTot2004": "Population Totale (2004)",
        "PopTot2005": "Population Totale (2005)",
        "PopTot2006": "Population Totale (2006)",
        "PopTot2007": "Population Totale (2007)",
        "PopTot2008": "Population Totale (2008)",
        "PopTot2009": "Population Totale (2009)",
        "PopTot2010": "Population Totale (2010)",
        "PopTot2011": "Population Totale (2011)",
        "PopTot2012": "Population Totale (2012)",
        "PopTot2013": "Population Totale (2013)",
        "PopTot2014": "Population Totale (2014)",
        "NOM": "NOM"
      };
      var outFields = ["PopTot2004", "PopTot2005", "PopTot2006", "PopTot2007", "PopTot2008", "PopTot2009", "PopTot2010", "PopTot2011", "PopTot2012", "PopTot2013", "PopTot2014", "NOM"];

      //create popup
      var popupTemplate = new PopupTemplate({
        title: "{NOM}",
        fieldInfos: [{
          "fieldName": fieldName,
          "label": fields[fieldName],
          "visible": true,
          "format": {
            places: 0,
            digitSeparator: true
          }
        }],
        showAttachments: true
      });

      layer = new FeatureLayer("http://41.231.36.249/sirgeo/rest/services/SIR-Gouv/demographie_gouv/MapServer/0", {
        "id": "Chad",
        "infoTemplate": popupTemplate,
        "mode": FeatureLayer.MODE_SNAPSHOT,
        "outFields": outFields,
        "opacity": 0.8
      });

      //only working with Washington state
      //layer.setDefinitionExpression("Region='NO'");
      map.addLayer(layer);

      layer.on("load", function() {
        createRenderer(fieldName);
      });

      function createRenderer(field) {
        //smart mapping functionality begins
        smartMapping.createClassedColorRenderer({
          layer: layer,
          field: field,
          basemap: map.getBasemap(),
          classificationMethod: "quantile",
          numClasses: 3,
          //ClassBreakInfo(null, minValue:100000, maxValue:250000),
          showOthers: false
        }).then(function(response) {
          layer.setRenderer(response.renderer);
          layer.redraw();
          createLegend(map, layer, field);
        });
      }

      //this function gets called when fields are selected to render
      function updateAttribute(ch) {
        map.infoWindow.hide();

        var popupTemplateUpdated = new PopupTemplate({
          title: "{NOM}",
          fieldInfos: [{
            "fieldName": ch,
            "label": fields[ch],
            "visible": true,
            "format": {
              places: 0,
              digitSeparator: true
            }
          }],
          showAttachments: true
        });
        layer.setInfoTemplate(popupTemplateUpdated);
        createRenderer(ch);
        layer.redraw();
        createLegend(map, layer, ch);
      }

      //Create a legend
      function createLegend(map, layer, field) {
        //If applicable, destroy previous legend
        if (legend) {
          legend.destroy();
          domConstruct.destroy(dom.byId("legendDiv"));
        }

        // create a new div for the legend
        var legendDiv = domConstruct.create("div", {
          id: "legendDiv"
        }, dom.byId("legendWrapper"));

        legend = new Legend({
          map: map,
          layerInfos: [{
            layer: layer,
            title: "Indicateur: "
          }]
        }, legendDiv);
        legend.startup();
      }

      // create a store and a filtering select for the county layer's fields
      var fieldNames, fieldStore, fieldSelect;
      fieldNames = {
        "identifier": "value",
        "label": "name",
        "items": []
      };
      array.forEach(outFields, function(f) {
        if (array.indexOf(f.split("_"), "NOM") == -1) { // exclude attrs that contain "NAME"
          fieldNames.items.push({
            "name": fields[f],
            "value": f
          });
        }
      });

      fieldStore = new ItemFileReadStore({
        data: fieldNames
      });

      fieldSelect = new FilteringSelect({
        displayedValue: fieldNames.items[0].name,
        value: fieldNames.items[0].value,
        name: "fieldsFS",
        required: false,
        store: fieldStore,
        searchAttr: "name",
        style: {
          "width": "290px",
          "fontSize": "12pt",
          "color": "#444"
        }
      }, domConstruct.create("div", null, dom.byId("fieldWrapper")));
      fieldSelect.on("change", updateAttribute);
    });
  </script>
</head>

<body class="tundra">
  <div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design:'headline',gutters:false" style="width: 100%; height: 100%; margin: 0;">
    <div id="map" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'">
      <div id="feedback">
        <h3>Population Totale(milliers habitants)</h3>
        <div id="info">
          Sélectionnez une année pour une visualisation cartographiqe .
        </div>
        <div id="legendWrapper"></div>
        <div id="fieldWrapper">
          Veuillez choisir l'année
        </div>
        <div id="printButton"></div>
      </div>
    </div>
  </div>
  <div id="HomeButton"></div>
  <div style="position:absolute; left:20px; top:150px; z-Index:999;">
    <div data-dojo-type="dijit/TitlePane" data-dojo-props="title:'Fond de carte', closable:false, open:false">
      <div data-dojo-type="dijit/layout/ContentPane" style="width:380px; height:280px; overflow:auto;">
        <div id="basemapGallery"></div>
      </div>
    </div>
  </div>
</body>

</html>

View solution in original post

5 Replies
RobertScheitlin__GISP
MVP Emeritus

Amal,

   Here is your code update to include the Print Dijit:

<!DOCTYPE html>
<html>

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" />
  <title> Population Totale </title>
  <link rel="stylesheet" href="http://js.arcgis.com/3.16/dijit/themes/tundra/tundra.css">

  <link rel="stylesheet" href="http://js.arcgis.com/3.16/esri/css/esri.css">

  <style>
    #HomeButton {
      position: absolute;
      top: 90px;
      left: 20px;
      z-index: 2;
    }

    html,
    body {
      height: 100%;
      width: 100%;
      margin: 0;
      padding: 0;
    }

    #map {
      margin: 0;
      padding: 0;
    }

    #feedback {
      position: absolute;
      height: 390px;
      font-family: arial;
      margin: 5px;
      padding: 10px;
      z-index: 40;
      background: #fff;
      color: #444;
      width: 300px;
      right: 10px;
      top: 10px;
      box-shadow: 0 0 5px #888;
    }

    #legendWrapper {
      padding: 10px 0 0 0;
    }

    #note {
      font-size: 80%;
      font-weight: 700;
      padding: 0 0 10px 0;
    }

    h3 {
      margin: 0 0 5px 0;
      border-bottom: 1px solid #444;
    }
  </style>
  <script src="http://js.arcgis.com/3.16/"></script>
  <script>
    //global vars
    var layer, legend;
    require([
      "esri/map",
      "esri/dijit/BasemapGallery",
      "esri/dijit/HomeButton",
      "esri/dijit/PopupTemplate",
      "esri/layers/FeatureLayer",
      "esri/dijit/Legend",
      "esri/renderers/smartMapping",
      "dojo/_base/array",
      "dojo/dom",
      "dojo/dom-construct",
      "dojo/data/ItemFileReadStore",
      "dijit/form/FilteringSelect",
      "esri/dijit/Print",
      "dojo/parser",
      "dijit/layout/BorderContainer",
      "dijit/layout/ContentPane",
      "dojo/domReady!"
    ], function(
      Map,
      BasemapGallery,
      HomeButton,
      PopupTemplate,
      FeatureLayer,
      Legend,
      smartMapping,
      array,
      dom,
      domConstruct,
      ItemFileReadStore,
      FilteringSelect,
      Print,
      parser
    ) {
      parser.parse();

      var mapOptions = {
        basemap: "topo",
        center: [11, 34],
        zoom: 6,
        slider: true
      };

      var map = new Map("map", mapOptions);

      var basemapGallery = new BasemapGallery({
        showArcGISBasemaps: true,
        map: map
      }, "basemapGallery");

      basemapGallery.startup();
      basemapGallery.on("error", function(msg) {
        console.log("basemap gallery error: ", msg);
      });

      // map.enableKeyboardNavigation();
      var home = new HomeButton({
        map: map
      }, "HomeButton");
      home.startup();

      var printer = new Print({
        map: map,
        url: "http://41.231.36.249/sirgeo/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task",
        templates: [{
          label: "Map",
          format: "PDF",
          layout: "MAP_ONLY",
          exportOptions: {
            width: 500,
            height: 400,
            dpi: 96
          }
        }, {
          label: "Layout",
          format: "PDF",
          layout: "A4 Portrait",
          layoutOptions: {
            titleText: "My Print",
            authorText: "esri",
            copyrightText: "My Company",
            scalebarUnit: "Miles",
          }
        }]
      }, dom.byId("printButton"));

      printer.startup();

      var fieldName = "PopTot2004";

      // the counties map service uses the actual field name as the field alias
      // set up an object to use as a lookup table to work with user friendly field names

      var fields = {
        "PopTot2004": "Population Totale (2004)",
        "PopTot2005": "Population Totale (2005)",
        "PopTot2006": "Population Totale (2006)",
        "PopTot2007": "Population Totale (2007)",
        "PopTot2008": "Population Totale (2008)",
        "PopTot2009": "Population Totale (2009)",
        "PopTot2010": "Population Totale (2010)",
        "PopTot2011": "Population Totale (2011)",
        "PopTot2012": "Population Totale (2012)",
        "PopTot2013": "Population Totale (2013)",
        "PopTot2014": "Population Totale (2014)",
        "NOM": "NOM"
      };
      var outFields = ["PopTot2004", "PopTot2005", "PopTot2006", "PopTot2007", "PopTot2008", "PopTot2009", "PopTot2010", "PopTot2011", "PopTot2012", "PopTot2013", "PopTot2014", "NOM"];

      //create popup
      var popupTemplate = new PopupTemplate({
        title: "{NOM}",
        fieldInfos: [{
          "fieldName": fieldName,
          "label": fields[fieldName],
          "visible": true,
          "format": {
            places: 0,
            digitSeparator: true
          }
        }],
        showAttachments: true
      });

      layer = new FeatureLayer("http://41.231.36.249/sirgeo/rest/services/SIR-Gouv/demographie_gouv/MapServer/0", {
        "id": "Chad",
        "infoTemplate": popupTemplate,
        "mode": FeatureLayer.MODE_SNAPSHOT,
        "outFields": outFields,
        "opacity": 0.8
      });

      //only working with Washington state
      //layer.setDefinitionExpression("Region='NO'");
      map.addLayer(layer);

      layer.on("load", function() {
        createRenderer(fieldName);
      });

      function createRenderer(field) {
        //smart mapping functionality begins
        smartMapping.createClassedColorRenderer({
          layer: layer,
          field: field,
          basemap: map.getBasemap(),
          classificationMethod: "quantile",
          numClasses: 3,
          //ClassBreakInfo(null, minValue:100000, maxValue:250000),
          showOthers: false
        }).then(function(response) {
          layer.setRenderer(response.renderer);
          layer.redraw();
          createLegend(map, layer, field);
        });
      }

      //this function gets called when fields are selected to render
      function updateAttribute(ch) {
        map.infoWindow.hide();

        var popupTemplateUpdated = new PopupTemplate({
          title: "{NOM}",
          fieldInfos: [{
            "fieldName": ch,
            "label": fields[ch],
            "visible": true,
            "format": {
              places: 0,
              digitSeparator: true
            }
          }],
          showAttachments: true
        });
        layer.setInfoTemplate(popupTemplateUpdated);
        createRenderer(ch);
        layer.redraw();
        createLegend(map, layer, ch);
      }

      //Create a legend
      function createLegend(map, layer, field) {
        //If applicable, destroy previous legend
        if (legend) {
          legend.destroy();
          domConstruct.destroy(dom.byId("legendDiv"));
        }

        // create a new div for the legend
        var legendDiv = domConstruct.create("div", {
          id: "legendDiv"
        }, dom.byId("legendWrapper"));

        legend = new Legend({
          map: map,
          layerInfos: [{
            layer: layer,
            title: "Indicateur: "
          }]
        }, legendDiv);
        legend.startup();
      }

      // create a store and a filtering select for the county layer's fields
      var fieldNames, fieldStore, fieldSelect;
      fieldNames = {
        "identifier": "value",
        "label": "name",
        "items": []
      };
      array.forEach(outFields, function(f) {
        if (array.indexOf(f.split("_"), "NOM") == -1) { // exclude attrs that contain "NAME"
          fieldNames.items.push({
            "name": fields[f],
            "value": f
          });
        }
      });

      fieldStore = new ItemFileReadStore({
        data: fieldNames
      });

      fieldSelect = new FilteringSelect({
        displayedValue: fieldNames.items[0].name,
        value: fieldNames.items[0].value,
        name: "fieldsFS",
        required: false,
        store: fieldStore,
        searchAttr: "name",
        style: {
          "width": "290px",
          "fontSize": "12pt",
          "color": "#444"
        }
      }, domConstruct.create("div", null, dom.byId("fieldWrapper")));
      fieldSelect.on("change", updateAttribute);
    });
  </script>
</head>

<body class="tundra">
  <div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design:'headline',gutters:false" style="width: 100%; height: 100%; margin: 0;">
    <div id="map" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'">
      <div id="feedback">
        <h3>Population Totale(milliers habitants)</h3>
        <div id="info">
          Sélectionnez une année pour une visualisation cartographiqe .
        </div>
        <div id="legendWrapper"></div>
        <div id="fieldWrapper">
          Veuillez choisir l'année
        </div>
        <div id="printButton"></div>
      </div>
    </div>
  </div>
  <div id="HomeButton"></div>
  <div style="position:absolute; left:20px; top:150px; z-Index:999;">
    <div data-dojo-type="dijit/TitlePane" data-dojo-props="title:'Fond de carte', closable:false, open:false">
      <div data-dojo-type="dijit/layout/ContentPane" style="width:380px; height:280px; overflow:auto;">
        <div id="basemapGallery"></div>
      </div>
    </div>
  </div>
</body>

</html>
AmalHorchi
New Contributor II

Thank you so much Robert . Really thank you .

0 Kudos
AmalHorchi
New Contributor II

Hi Robert , 

I want to add labels for my features in the previous code . (labeling features by "NOM" )

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Amal,

  You should start a new question when your original question has been answered and you have a new different question.

0 Kudos
AmalHorchi
New Contributor II

Hi Robert , 

Please can you help me . I get this error while installing ArcGIS Entreprise Builder 10.5.1 and also 10.6 . This is the log file 

<Msg time="2018-05-25T18:40:26,441" type="INFO" code="217039" source="Portal" process="10820" thread="1" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Service de journalisation démarré.</Msg>
<Msg time="2018-05-25T18:40:29,755" type="INFO" code="217036" source="Portal" process="10820" thread="1" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Création d’un certificat SAML en sortie [, Warning:, The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore C:\Program Files\ArcGIS\Portal\etc\ssl\portal.ks -destkeystore C:\Program Files\ArcGIS\Portal\etc\ssl\portal.ks -deststoretype pkcs12".].</Msg>
<Msg time="2018-05-25T18:40:29,770" type="INFO" code="217031" source="Portal" process="10820" thread="1" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Configuration et initialisation des répertoires de données, de contenu et dindex.</Msg>
<Msg time="2018-05-25T18:40:29,817" type="INFO" code="209092" source="Portal Admin" process="10820" thread="1" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Décompression du contenu du portail.</Msg>
<Msg time="2018-05-25T18:40:30,113" type="INFO" code="217032" source="Portal" process="10820" thread="1" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Remplacement des URL de base dans les fichiers de configuration.</Msg>
<Msg time="2018-05-25T18:40:30,129" type="INFO" code="217009" source="Portal" process="10820" thread="1" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">httpUrl : DATA.APAL.LOCAL:7080.</Msg>
<Msg time="2018-05-25T18:40:30,129" type="INFO" code="217010" source="Portal" process="10820" thread="1" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">httpsUrl : DATA.APAL.LOCAL:7443.</Msg>
<Msg time="2018-05-25T18:40:30,129" type="INFO" code="217011" source="Portal" process="10820" thread="1" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">baseUrl : DATA.APAL.LOCAL:7080/arcgis.</Msg>
<Msg time="2018-05-25T18:40:30,129" type="INFO" code="217012" source="Portal" process="10820" thread="1" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">sbaseUrl : DATA.APAL.LOCAL:7443/arcgis.</Msg>
<Msg time="2018-05-25T18:40:33,389" type="INFO" code="217033" source="Portal" process="10820" thread="1" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Configuration des ports du serveur Web.</Msg>
<Msg time="2018-05-25T18:40:33,436" type="INFO" code="217015" source="Portal" process="10820" thread="1" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Type de magasin d’identifiants trouvé.</Msg>
<Msg time="2018-05-25T18:40:33,452" type="INFO" code="217034" source="Portal" process="10820" thread="1" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Configuration des propriétés du proxy</Msg>
<Msg time="2018-05-25T18:40:33,452" type="INFO" code="217035" source="Portal" process="10820" thread="1" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Configuration des informations d'identification du service d'index.</Msg>
<Msg time="2018-05-25T18:40:33,452" type="INFO" code="217002" source="Portal" process="10820" thread="1" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Configuration du portail mise à jour.</Msg>
<Msg time="2018-05-25T18:40:33,452" type="INFO" code="217046" source="Portal" process="10820" thread="1" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Démarrage du moniteur de traitement.</Msg>
<Msg time="2018-05-25T18:40:33,452" type="VERBOSE" code="217063" source="Portal" process="10820" thread="1" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Le moniteur de traitement n’a pas trouvé la connexion avec le magasin de configuration. Le site n’est peut-être pas initialisé. Une fois le site initialisé, la vérification des traitements de la base de données sera tentée à nouveau.</Msg>
<Msg time="2018-05-25T18:40:33,452" type="INFO" code="217055" source="Portal" process="10820" thread="1" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Démarrage de l’exécution du thread du chien de garde.</Msg>
<Msg time="2018-05-25T18:40:33,452" type="VERBOSE" code="217063" source="Portal" process="10820" thread="1" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Le moniteur de traitement n’a pas trouvé la connexion avec le magasin de configuration. Le site n’est peut-être pas initialisé. Une fois le site initialisé, la vérification des traitements de la base de données sera tentée à nouveau.</Msg>
<Msg time="2018-05-25T18:40:33,467" type="INFO" code="217074" source="Portal" process="10820" thread="1" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Le portail a démarré correctement.</Msg>
<Msg time="2018-05-25T18:40:33,467" type="INFO" code="217044" source="Portal" process="10820" thread="1" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Outil de limitation des journaux : début de la suppression des journaux plus anciens que 90 jours dans le chemin C:\arcgis\arcgisportal\logs\DATA.APAL.LOCAL\portal.</Msg>
<Msg time="2018-05-25T18:40:33,483" type="INFO" code="217045" source="Portal" process="10820" thread="1" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Outil de limitation des journaux : fin de la suppression des journaux plus anciens que 90 jours dans le chemin C:\arcgis\arcgisportal\logs\DATA.APAL.LOCAL\portal.</Msg>
<Msg time="2018-05-25T18:40:35,542" type="WARNING" code="217064" source="Portal" process="10820" thread="1" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Le serveur Web a été arrêté. Redémarrage du serveur en cours.</Msg>
<Msg time="2018-05-25T18:40:35,542" type="INFO" code="217053" source="Portal" process="10820" thread="1" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Démarrage du serveur Web.</Msg>
<Msg time="2018-05-25T18:41:17,15" type="INFO" code="217054" source="Portal" process="10820" thread="1" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Serveur Web démarré.</Msg>
<Msg time="2018-05-25T19:26:22,958" type="INFO" code="207037" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Niveau de consignation mis à jour en 'VERBOSE'.</Msg>
<Msg time="2018-05-25T19:26:23,556" type="INFO" code="205013" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Paramètres des journaux mis à jour. [Logs directory = 'C:\arcgis\arcgisportal\logs\', Log level = VERBOSE, Max age in days = 90]</Msg>
<Msg time="2018-05-25T19:26:23,556" type="VERBOSE" code="209001" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Définition du niveau de consignation sur COMMENTAIRES avant la création du nouveau site.</Msg>
<Msg time="2018-05-25T19:26:23,556" type="INFO" code="209002" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Création dun nouveau site.</Msg>
<Msg time="2018-05-25T19:26:23,824" type="INFO" code="209003" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Il sagit dune nouvelle installation.</Msg>
<Msg time="2018-05-25T19:26:23,824" type="INFO" code="209089" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">La version de Portal for ArcGIS est 10.6.0.</Msg>
<Msg time="2018-05-25T19:26:23,825" type="INFO" code="209090" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Début de l’initialisation du module de contenu.</Msg>
<Msg time="2018-05-25T19:27:29,703" type="INFO" code="209091" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Initialisation du module de contenu terminée.</Msg>
<Msg time="2018-05-25T19:27:29,704" type="INFO" code="209004" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Début de linitialisation du module DB.</Msg>
<Msg time="2018-05-25T19:27:29,710" type="INFO" code="209067" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Initialisation de la base de données.</Msg>
<Msg time="2018-05-25T19:28:06,231" type="INFO" code="209068" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Démarrage du serveur de base de données.</Msg>
<Msg time="2018-05-25T19:28:12,946" type="INFO" code="209069" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Création de la base de données.</Msg>
<Msg time="2018-05-25T19:28:13,738" type="INFO" code="209070" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Création du compte administrateur de base de données.</Msg>
<Msg time="2018-05-25T19:28:14,490" type="SEVERE" code="209024" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Le processus de création dun nouveau site a échoué. Inversion de la création du site. {0}</Msg>
<Msg time="2018-05-25T19:28:31,82" type="INFO" code="207037" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Niveau de consignation mis à jour en 'VERBOSE'.</Msg>
<Msg time="2018-05-25T19:28:31,122" type="INFO" code="205013" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Paramètres des journaux mis à jour. [Logs directory = 'C:\arcgis\arcgisportal\logs\', Log level = VERBOSE, Max age in days = 90]</Msg>
<Msg time="2018-05-25T19:28:31,141" type="INFO" code="209075" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Création dune sauvegarde des dossiers de base de données, de contenu et dindex. Lopération ne prend que quelques minutes.</Msg>
<Msg time="2018-05-25T19:35:43,923" type="INFO" code="209076" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Sauvegarde terminée des dossiers de base de données, de contenu et dindex.</Msg>
<Msg time="2018-05-25T19:35:43,923" type="INFO" code="209038" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Début du processus de migration de 10.2 vers 10.6.0.</Msg>
<Msg time="2018-05-25T19:35:43,923" type="INFO" code="218032" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Nettoyage des fichiers de configuration du service d’index.</Msg>
<Msg time="2018-05-25T19:35:43,927" type="INFO" code="209063" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Mise à niveau de la base de données de 9.2.4 vers 9.6.3.</Msg>
<Msg time="2018-05-25T19:35:43,928" type="SEVERE" code="209044" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Echec de la migration. Cannot find the PostgreSQL binary directory for the database version 9.2.4 Cannot find the PostgreSQL binary directory for the database version 9.2.4</Msg>
<Msg time="2018-05-25T19:36:20,699" type="INFO" code="207037" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Niveau de consignation mis à jour en 'VERBOSE'.</Msg>
<Msg time="2018-05-25T19:36:20,729" type="INFO" code="205013" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Paramètres des journaux mis à jour. [Logs directory = 'C:\arcgis\arcgisportal\logs\', Log level = VERBOSE, Max age in days = 90]</Msg>
<Msg time="2018-05-25T19:36:20,730" type="INFO" code="209075" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Création dune sauvegarde des dossiers de base de données, de contenu et dindex. Lopération ne prend que quelques minutes.</Msg>
<Msg time="2018-05-25T19:36:20,740" type="INFO" code="209076" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Sauvegarde terminée des dossiers de base de données, de contenu et dindex.</Msg>
<Msg time="2018-05-25T19:36:20,740" type="INFO" code="209038" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Début du processus de migration de 10.2 vers 10.6.0.</Msg>
<Msg time="2018-05-25T19:36:20,740" type="INFO" code="218032" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Nettoyage des fichiers de configuration du service d’index.</Msg>
<Msg time="2018-05-25T19:36:20,743" type="INFO" code="209063" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Mise à niveau de la base de données de 9.2.4 vers 9.6.3.</Msg>
<Msg time="2018-05-25T19:36:20,743" type="INFO" code="209039" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Démarrage de la base de données 9.2.4.</Msg>
<Msg time="2018-05-25T19:41:21,693" type="SEVERE" code="209044" source="Portal Admin" process="12172" thread="25" methodName="" machine="DATA.APAL.LOCAL" user="" elapsed="">Echec de la migration. Failed to start the database server. The startup timed out. Please check the log file at C:\arcgis\arcgisportal\logs\\database\pgsql.log. Failed to start the database server. The startup timed out. Please check the log file at C:\arcgis\arcgisportal\logs\\database\pgsql.log.</Msg>

0 Kudos