{"id":14531,"date":"2015-09-29T12:02:38","date_gmt":"2015-09-29T11:02:13","guid":{"rendered":"https:\/\/help.instantatlas.com\/dashboard-builder-desktop\/desktop-user-guide\/about-this-section\/important-files\/map-js\/"},"modified":"2019-09-12T11:42:41","modified_gmt":"2019-09-12T10:42:41","slug":"map-js","status":"publish","type":"page","link":"https:\/\/help.instantatlas.com\/instantatlas-desktop\/en\/welcome\/desktop-user-guide\/the-instantatlas-desktop-publisher\/important-files\/map-js\/","title":{"rendered":"map.js"},"content":{"rendered":"<p>The map.js file contains the layer properties for the map and legend component in a report. You can open and edit the file in a text editor. Although a number of map component properties can be changed in the Designer there are a number of settings that can only be changed by directly editing the map.js file.<\/p>\n<p>In order to edit the map.js file first open the file\u00a0in a text editor. The various map layers are segregated using {}. The first property of each map layer is the \u2018type\u2019 for example: &#8220;type&#8221;:&#8221;contextual-layer&#8221;. The second property is the &#8220;id&#8221; which identifies which map file the settings belong to. These can be used to correctly identify the layer you wish to edit.<\/p>\n<figure id=\"attachment_15471\" aria-describedby=\"caption-attachment-15471\" style=\"width: 684px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/help.instantatlas.com\/instantatlas-desktop\/wp-content\/uploads\/sites\/31\/2015\/09\/map.js_example.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/help.instantatlas.com\/instantatlas-desktop\/wp-content\/uploads\/sites\/31\/2015\/09\/map.js_example.png\" alt=\"map.js_example\" class=\"wp-image-15471 size-full\" width=\"684\" height=\"475\" srcset=\"https:\/\/help.instantatlas.com\/instantatlas-desktop\/wp-content\/uploads\/sites\/31\/2015\/09\/map.js_example.png 684w, https:\/\/help.instantatlas.com\/instantatlas-desktop\/wp-content\/uploads\/sites\/31\/2015\/09\/map.js_example-300x208.png 300w\" sizes=\"auto, (max-width: 684px) 100vw, 684px\" \/><\/a><figcaption id=\"caption-attachment-15471\" class=\"wp-caption-text\">The image above shows the map.js file open in a text editor. There are many text editors available so the document may look superficially different to the one above.<\/figcaption><\/figure>\n<p>If you wish to change a map property, first find the relevant layer by looking at the &#8220;id&#8221; and &#8220;name&#8221; fields to identify the correct map layer. To change the relevant setting find the field and change the value. For example if you wish to change the border thickness the following setting can be edited:<\/p>\n<pre>\"borderThickness\":2,<\/pre>\n<p>Here the thickness\u00a0of the border\u00a0has been\u00a0set to 2 pixels.<\/p>\n<p>The table below details some of the main map properties and the options for changing the settings.<\/p>\n<p><em>Red rows are default settings that you should not edit, green rows are settings that can be edited.<\/em><\/p>\n<table>\n<tbody>\n<tr style=\"background-color: #ffffff;\">\n<td style=\"text-align: center;\"><strong>Map Property<\/strong><\/td>\n<td style=\"text-align: center;\"><strong>Function<\/strong><\/td>\n<td style=\"text-align: center;\"><strong>Setting<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #f7e1e1;\">&#8220;type&#8221;<\/td>\n<td style=\"background-color: #f7e1e1;\">Denotes type of layer i.e. base-layer or contextual layer<\/td>\n<td style=\"background-color: #f7e1e1;\">Defined in the Publisher &#8211; <strong>Do Not Change<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #f7e1e1;\">&#8220;id&#8221;<\/td>\n<td style=\"background-color: #f7e1e1;\">The name of the shapefile or MapInfo layer<\/td>\n<td style=\"background-color: #f7e1e1;\">Specific to the file &#8211; <strong>Do Not Change<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #beedd6;\"><strong>&#8220;name&#8221;<\/strong><\/td>\n<td style=\"background-color: #beedd6;\">The name of the layer in shown in the legend<\/td>\n<td style=\"background-color: #beedd6;\">Can be edited as required<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #f7e1e1;\">&#8220;geometry&#8221;<\/td>\n<td style=\"background-color: #f7e1e1;\">Type of shapefile and MapInfo layer i.e. point or polygon<\/td>\n<td style=\"background-color: #f7e1e1;\">Specific to the file &#8211; <strong>Do Not Change<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #f7e1e1;\">&#8220;url&#8221;<\/td>\n<td style=\"background-color: #f7e1e1;\">The path of the file used in the report<\/td>\n<td style=\"background-color: #f7e1e1;\">Built in function set during the publishing process &#8211; <strong>Do Not Change<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #beedd6;\"><strong>&#8220;visible&#8221;<\/strong><\/td>\n<td style=\"background-color: #beedd6;\">Determines whether the layer is turned on in the legend when the report is first opened<\/td>\n<td style=\"background-color: #beedd6;\">Options: <strong>true <\/strong>or <strong>false<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #beedd6;\"><strong>&#8220;symbolSize&#8221;<\/strong><\/td>\n<td style=\"background-color: #beedd6;\">Determines the size of symbols &#8211;\u00a0point geographies only.<\/td>\n<td style=\"background-color: #beedd6;\">Any positive numerical value<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #beedd6;\"><strong>&#8220;fillColor&#8221;<\/strong><\/td>\n<td style=\"background-color: #beedd6;\">Determines colour of contextual layer polygons or oint symbols only.<\/td>\n<td style=\"background-color: #beedd6;\"><span>Any Hex\u00a0colour e.g. #ffffff<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #beedd6;\"><strong>&#8220;fillOpacity&#8221;<\/strong><\/td>\n<td style=\"background-color: #beedd6;\">Determines the opacity of the map<span> layer filling<\/span>.<\/td>\n<td style=\"background-color: #beedd6;\">Any value between 0 and 1<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #beedd6;\"><strong>&#8220;borderColor&#8221;<\/strong><\/td>\n<td style=\"background-color: #beedd6;\">Determines the colour of the border of the <span>map layer.<\/span><\/td>\n<td style=\"background-color: #beedd6;\">Any Hex\u00a0colour e.g. #ffffff<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #beedd6;\"><strong>&#8220;borderThickness&#8221;<\/strong><\/td>\n<td style=\"background-color: #beedd6;\">Determines the thickness of the borders of the map <span>layer.<\/span><\/td>\n<td style=\"background-color: #beedd6;\">Any positive numerical value (value corresponds to pixels, smaller numbers are most appropriate)<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #beedd6;\"><strong>&#8220;showLabels&#8221;<\/strong><\/td>\n<td style=\"background-color: #beedd6;\">Determines whether labels are shown for a map layer. For contextual layers, the labels are taken from the name field set during the publishing process.<\/td>\n<td style=\"background-color: #beedd6;\"><span>Options: <\/span><strong>true <\/strong>or <strong>false<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #beedd6;\"><strong>&#8220;minLabelExtent&#8221;<\/strong><\/td>\n<td style=\"background-color: #beedd6;\">Determines at what zoom level the labels of the map layer become invisible.<\/td>\n<td style=\"background-color: #beedd6;\"><span>Any positive numerical value. Default value =\u00a00<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #beedd6;\"><strong>&#8220;maxLabelExtent&#8221;<\/strong><\/td>\n<td style=\"background-color: #beedd6;\">Determines at what zoom level the labels of the map layer become visible. If there are many small areas the map may look cluttered at full extent, max zoom layer determines at which point\u00a0they become visible at smaller extents.<\/td>\n<td style=\"background-color: #beedd6;\">Any positive numerical value. Default value = 1000000, suitable value depends on scale of map used.<\/td>\n<\/tr>\n<tr style=\"background-color: #beedd6;\">\n<td><strong>&#8220;iconPath&#8221;<\/strong><\/td>\n<td>Determines the icon type of contextual point layers. For example a cross\u00a0symbol could be used to denote a hospital.<\/td>\n<td>The path of an image file. If the image is saved in the same folder as the report the value is simply the name of the file e.g. cross.png<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #beedd6;\"><strong>&#8220;showDataTips&#8221;<\/strong><\/td>\n<td style=\"background-color: #beedd6;\">Determines whether the name of the features in the map file show tooltips with the name of the feature.<\/td>\n<td style=\"background-color: #beedd6;\">Options: <strong>true<\/strong> or <strong>false<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #beedd6;\"><strong>&#8220;showInLayerList&#8221;<\/strong><\/td>\n<td style=\"background-color: #beedd6;\">Determines whether a map layer is shown in the legend. The map layer will still be shown in the map component of the report (if &#8220;visible&#8221; is set to <strong>true<\/strong>) however users will not be able to turn the map layer on\/off via the legend.<\/td>\n<td style=\"background-color: #beedd6;\">Options: <strong>true<\/strong> or <strong>false<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The map.js file contains the layer properties for the map and legend component in a report. You can open and edit the file in a text editor. Although a number of map component properties can be changed in the Designer there are a number of settings that can only be changed by directly editing the &hellip; <a href=\"https:\/\/help.instantatlas.com\/instantatlas-desktop\/en\/welcome\/desktop-user-guide\/the-instantatlas-desktop-publisher\/important-files\/map-js\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">map.js<\/span><\/a><\/p>\n","protected":false},"author":22,"featured_media":0,"parent":14451,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-14531","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/help.instantatlas.com\/instantatlas-desktop\/wp-json\/wp\/v2\/pages\/14531","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/help.instantatlas.com\/instantatlas-desktop\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/help.instantatlas.com\/instantatlas-desktop\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/help.instantatlas.com\/instantatlas-desktop\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/help.instantatlas.com\/instantatlas-desktop\/wp-json\/wp\/v2\/comments?post=14531"}],"version-history":[{"count":0,"href":"https:\/\/help.instantatlas.com\/instantatlas-desktop\/wp-json\/wp\/v2\/pages\/14531\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/help.instantatlas.com\/instantatlas-desktop\/wp-json\/wp\/v2\/pages\/14451"}],"wp:attachment":[{"href":"https:\/\/help.instantatlas.com\/instantatlas-desktop\/wp-json\/wp\/v2\/media?parent=14531"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}