{"id":249352,"date":"2018-07-05T11:00:02","date_gmt":"2018-07-05T11:00:02","guid":{"rendered":"http:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=249352"},"modified":"2018-07-16T15:58:43","modified_gmt":"2018-07-16T22:58:43","slug":"labeling-in-2d","status":"publish","type":"blog","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d","title":{"rendered":"Introduction to labeling in 2D with ArcGIS JavaScript API 4.8"},"author":7921,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"_acf_changed":false,"_searchwp_excluded":""},"categories":[22941],"tags":[127992,96582,127982,128002,34641],"industry":[],"product":[36831,36601],"class_list":["post-249352","blog","type-blog","status-publish","format-standard","hentry","category-mapping","tag-4-8","tag-arcgis-api-for-javascript","tag-jsapi","tag-labeling","tag-webgl","product-js-api-arcgis","product-developers"],"acf":{"short_description":"New at version 4.8 of the ArcGIS API for JavaScript, you can now label 2D FeatureLayers and CSVLayers with WebGL!","flexible_content":[{"acf_fc_layout":"content","content":"<p data-line=\"2\">The recent release of <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/guide\/release-notes\/index.html\">version 4.8<\/a> of the ArcGIS API for JavaScript\u00a0added more ways to visualize your data and enhance your web apps with new capabilities. One of the most highly anticipated capabilities was labeling with <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-layers-FeatureLayer.html#webgl-rendering\">WebGL-enabled<\/a>\u00a0layers. We are proud to announce that <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/guide\/labeling\/index.html#webgl-enabled-featurelayer-and-csvlayer\">labeling<\/a> is now supported for\u00a0<a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-layers-FeatureLayer.html#labelingInfo\">FeatureLayers<\/a>\u00a0and\u00a0<a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-layers-CSVLayer.html#labelingInfo\">CSVLayers<\/a>\u00a0in 2D\u00a0<a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-views-MapView.html\">MapViews<\/a>!<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":268272,"id":268272,"title":"Screenshot","filename":"Screenshot.jpg","filesize":62552,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot.jpg","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d\/screenshot-4","alt":"","author":"7921","description":"","caption":"","name":"screenshot-4","status":"inherit","uploaded_to":249352,"date":"2018-07-05 17:11:19","modified":"2018-07-05 17:11:19","menu_order":0,"mime_type":"image\/jpeg","type":"image","subtype":"jpeg","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":1632,"height":815,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot.jpg","thumbnail-width":213,"thumbnail-height":106,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot.jpg","medium-width":464,"medium-height":232,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot.jpg","medium_large-width":768,"medium_large-height":384,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot.jpg","large-width":1632,"large-height":815,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot.jpg","1536x1536-width":1536,"1536x1536-height":767,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot.jpg","2048x2048-width":1632,"2048x2048-height":815,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot.jpg","card_image-width":826,"card_image-height":412,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot.jpg","wide_image-width":1632,"wide_image-height":815}},"image_position":"center","orientation":"horizontal","hyperlink":"https:\/\/developers.arcgis.com\/javascript\/latest\/sample-code\/labels-multiple-classes\/index.html"},{"acf_fc_layout":"content","content":"<h2>Adding Labels<\/h2>\n<p>Adding labels with this new capability is very similar to how we add labels to <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-layers-support-Sublayer.html#labelingInfo\">MapImageLayers<\/a> or to FeatureLayers in\u00a0<a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-views-SceneView.html\">SceneViews<\/a>.<\/p>\n<p>The\u00a0<a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-layers-FeatureLayer.html#labelingInfo\">labelingInfo<\/a>\u00a0property of\u00a0<a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-layers-FeatureLayer.html#labelingInfo\">FeatureLayers<\/a>\u00a0and\u00a0<a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-layers-CSVLayer.html#labelingInfo\">CSVLayers<\/a> is specified as an array of\u00a0<a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-layers-support-LabelClass.html\">LabelClass<\/a>\u00a0objects. The <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-layers-support-LabelClass.html\">LabelClass<\/a> defines the display logic for the labels, such as: label expressions, label placement options, scale ranges, and symbol type. When working with 2D MapViews, more than one LabelClass can be added to each layer, and the LabelClass symbol property will always be TextSymbol. The\u00a0<a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-symbols-TextSymbol.html\">TextSymbol<\/a>\u00a0class supports altering the graphics of the labels, such as:\u00a0<a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-symbols-TextSymbol.html#color\">color<\/a>,\u00a0<a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-symbols-TextSymbol.html#font\">font<\/a>,\u00a0<a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-symbols-TextSymbol.html#haloSize\">halo<\/a>, and other properties. The <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-symbols-Font.html\">Font<\/a> class (which is a property of the TextSymbol) supports styling the font used by the TextSymbol by setting\u00a0the font&#8217;s:\u00a0<a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-symbols-Font.html#family\">family<\/a>,\u00a0<a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-symbols-Font.html#decoration\">decoration<\/a>,\u00a0<a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-symbols-Font.html#size\">size<\/a>,\u00a0<a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-symbols-Font.html#style\">style<\/a>, and\u00a0<a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-symbols-Font.html#weight\">weight<\/a>\u00a0properties.<\/p>\n<p>Here is a code snippet and a sample of setting the above properties, with labels selectively applied to features with elevations greater than 2000 meters.<\/p>\n"},{"acf_fc_layout":"content","content":"<pre><code style=\"display: block; overflow-x: auto; padding: 0.5em; color: #333; background: #f8f8f8; -webkit-text-size-adjust: none;\">\r\n<span style=\"color: #333; font-weight: bold;\">var<\/span> labelClass = {\r\n  <span style=\"color: #998; font-style: italic;\">\/\/ Content<\/span>\r\n  labelExpressionInfo: {\r\n    expression: <span style=\"color: #d14;\">\"$feature.ELEVATION + ' m'\"<\/span>\r\n  },\r\n  \r\n  <span style=\"color: #998; font-style: italic;\">\/\/ Appearance<\/span>\r\n  symbol: {\r\n    type: <span style=\"color: #d14;\">\"text\"<\/span>,\r\n    color: <span style=\"color: #d14;\">\"white\"<\/span>,\r\n    haloColor: [<span style=\"color: #008080;\">30<\/span>, <span style=\"color: #008080;\">70<\/span>, <span style=\"color: #008080;\">190<\/span>],\r\n    haloSize: <span style=\"color: #008080;\">1<\/span>,\r\n    font: {\r\n      family: <span style=\"color: #d14;\">\"arial\"<\/span>,\r\n      style: <span style=\"color: #d14;\">\"normal\"<\/span>,\r\n      weight: <span style=\"color: #d14;\">\"bold\"<\/span>,\r\n      size: <span style=\"color: #008080;\">10<\/span>\r\n    }\r\n  },\r\n  \r\n  <span style=\"color: #998; font-style: italic;\">\/\/ Placement<\/span>\r\n  labelPlacement: <span style=\"color: #d14;\">\"above-right\"<\/span>,\r\n \r\n  <span style=\"color: #998; font-style: italic;\">\/\/ Visibility<\/span>\r\n  where: <span style=\"color: #d14;\">\"ELEVATION &gt; 2000\"<\/span>\r\n};\r\n<\/code><\/pre>\n"},{"acf_fc_layout":"image","image":{"ID":268532,"id":268532,"title":"Screenshot","filename":"Screenshot-6.png","filesize":52113,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-6.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d\/screenshot-11","alt":"","author":"7921","description":"","caption":"","name":"screenshot-11","status":"inherit","uploaded_to":249352,"date":"2018-07-05 17:41:40","modified":"2018-07-05 17:41:40","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":996,"height":664,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-6.png","thumbnail-width":213,"thumbnail-height":142,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-6.png","medium-width":392,"medium-height":261,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-6.png","medium_large-width":768,"medium_large-height":512,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-6.png","large-width":996,"large-height":664,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-6.png","1536x1536-width":996,"1536x1536-height":664,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-6.png","2048x2048-width":996,"2048x2048-height":664,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-6.png","card_image-width":698,"card_image-height":465,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-6.png","wide_image-width":996,"wide_image-height":664}},"image_position":"center","orientation":"horizontal","hyperlink":"https:\/\/codepen.io\/dawken\/pen\/gKyRyQ?editors=0010"},{"acf_fc_layout":"content","content":"<p>Now we will walk through the different properties that we described above in further detail.<\/p>\n<p>&nbsp;<\/p>\n"},{"acf_fc_layout":"content","content":"<h2 id=\"specifying-the-content\" class=\"code-line\" data-line=\"46\">Label Expressions<\/h2>\n<p>The most important part of any typographic work is the actual text content. With the ArcGIS API for JavaScript, you do not have to set the text feature-by-feature; instead, you can define a generic\u00a0rule that will be executed on each feature to derive the corresponding text.<\/p>\n"},{"acf_fc_layout":"content","content":"<pre><code style=\"display: block; overflow-x: auto; padding: 0.5em; color: #333; background: #f8f8f8; -webkit-text-size-adjust: none;\">\r\nlabelClass.labelExpressionInfo = {\r\n  expression: <span style=\"color: #d14;\">\"$feature.NAME + ' (' + $feature.STATE + ')'\"<\/span>\r\n};\r\n<\/code><\/pre>\n"},{"acf_fc_layout":"content","content":"<p>These rules are expressions written using <a href=\"https:\/\/developers.arcgis.com\/arcade\/\">Arcade<\/a>, a scripting language that is available across the entire ArcGIS platform.<\/p>\n<p class=\"code-line\" data-line=\"60\">When labeling a point layer you can use multiple label classes, so that every feature will be associated with more than one label. This is useful when there are several attributes that should be displayed.<\/p>\n<p class=\"code-line\" data-line=\"62\">We prepared an app that displays <a title=\"https:\/\/codepen.io\/dawken\/pen\/jKeNyP?editors=0010\" href=\"https:\/\/codepen.io\/dawken\/pen\/jKeNyP?editors=0010\">two labels for each feature<\/a>; notice how the name of a weather station appears to the right of the marker (<code>\"center-right\"<\/code> placement) while the 4-letters ICAO code is displayed just below (<code>\"below-right\"<\/code> placement).<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":268302,"id":268302,"title":"Screenshot","filename":"Screenshot-2.png","filesize":84163,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-2.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d\/screenshot-6","alt":"","author":"7921","description":"","caption":"","name":"screenshot-6","status":"inherit","uploaded_to":249352,"date":"2018-07-05 17:15:14","modified":"2018-07-05 17:15:14","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":795,"height":753,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-2.png","thumbnail-width":211,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-2.png","medium-width":276,"medium-height":261,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-2.png","medium_large-width":768,"medium_large-height":727,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-2.png","large-width":795,"large-height":753,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-2.png","1536x1536-width":795,"1536x1536-height":753,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-2.png","2048x2048-width":795,"2048x2048-height":753,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-2.png","card_image-width":491,"card_image-height":465,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-2.png","wide_image-width":795,"wide_image-height":753}},"image_position":"center","orientation":"horizontal","hyperlink":"https:\/\/codepen.io\/dawken\/pen\/jKeNyP?editors=0010"},{"acf_fc_layout":"content","content":"<h2 id=\"specifying-the-placement\" class=\"code-line\" data-line=\"54\">Label Placement<\/h2>\n<p>The purpose of\u00a0<code>LabelClass<\/code>\u00a0is to emit a label; the term placement refers to its relative position to the feature. The documentation for <code>LabelClass<\/code>\u00a0<a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-layers-support-LabelClass.html#labelPlacement\">lists all possible values<\/a>\u00a0for the <code>placement<\/code> attribute but, in short:<\/p>\n<ul>\n<li>When labeling polygons, for the time being, there is nothing to customize: the label will be placed on the centroid.<\/li>\n<li>When labeling points the placement is a string that specify the relative vertical and horizontal position of the label with respect to the feature.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":264042,"id":264042,"title":"placement","filename":"placement-1.png","filesize":20597,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/placement-1.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d\/placement-2","alt":"","author":"7921","description":"","caption":"","name":"placement-2","status":"inherit","uploaded_to":249352,"date":"2018-07-02 11:11:11","modified":"2018-07-02 11:11:11","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":694,"height":630,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/placement-1.png","thumbnail-width":213,"thumbnail-height":193,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/placement-1.png","medium-width":288,"medium-height":261,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/placement-1.png","medium_large-width":694,"medium_large-height":630,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/placement-1.png","large-width":694,"large-height":630,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/placement-1.png","1536x1536-width":694,"1536x1536-height":630,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/placement-1.png","2048x2048-width":694,"2048x2048-height":630,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/placement-1.png","card_image-width":512,"card_image-height":465,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/placement-1.png","wide_image-width":694,"wide_image-height":630}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<h2 id=\"specifying-the-appearance\" class=\"code-line\" data-line=\"50\">Label Visibility<\/h2>\n<p>When many features are present on the screen it is advisable to define several label classes, suitable for different scales. A good guideline is to display less information at smaller scales and to display more at larger scales, inviting the user to zoom in to get more details. To do this you set the <code>minScale<\/code>\u00a0and <code>maxScale<\/code>\u00a0properties appropriately on the different label classes. See this app <a href=\"https:\/\/codepen.io\/dawken\/pen\/WygVpa?editors=0010\">that displays more information as you zoom in<\/a>.<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":268342,"id":268342,"title":"Screenshot","filename":"Screenshot-3.png","filesize":240648,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-3.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d\/screenshot-7","alt":"","author":"7921","description":"","caption":"","name":"screenshot-7","status":"inherit","uploaded_to":249352,"date":"2018-07-05 17:23:01","modified":"2018-07-05 17:23:01","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":1828,"height":684,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-3.png","thumbnail-width":213,"thumbnail-height":80,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-3.png","medium-width":464,"medium-height":174,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-3.png","medium_large-width":768,"medium_large-height":287,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-3.png","large-width":1828,"large-height":684,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-3.png","1536x1536-width":1536,"1536x1536-height":575,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-3.png","2048x2048-width":1828,"2048x2048-height":684,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-3.png","card_image-width":826,"card_image-height":309,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-3.png","wide_image-width":1828,"wide_image-height":684}},"image_position":"center","orientation":"horizontal","hyperlink":"https:\/\/codepen.io\/dawken\/pen\/WygVpa?editors=0010"},{"acf_fc_layout":"content","content":"<p>Another reason to modify label visibility would be based on the individual feature attributes. To do this you define multiple label classes and use the\u00a0<code>where<\/code> property to apply each label class selectively to certain features. See this app <a href=\"https:\/\/codepen.io\/dawken\/pen\/pKGpNr?editors=0010\">that uses data from a CSV feed of earthquake events<\/a>. Notice how earthquakes with a magnitude less than 5 are associated with a blue label, while the others are associated with a red label.<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":268362,"id":268362,"title":"Screenshot","filename":"Screenshot-4.png","filesize":358334,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-4.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d\/screenshot-8","alt":"","author":"7921","description":"","caption":"","name":"screenshot-8","status":"inherit","uploaded_to":249352,"date":"2018-07-05 17:27:39","modified":"2018-07-05 17:27:39","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":980,"height":636,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-4.png","thumbnail-width":213,"thumbnail-height":138,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-4.png","medium-width":402,"medium-height":261,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-4.png","medium_large-width":768,"medium_large-height":498,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-4.png","large-width":980,"large-height":636,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-4.png","1536x1536-width":980,"1536x1536-height":636,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-4.png","2048x2048-width":980,"2048x2048-height":636,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-4.png","card_image-width":717,"card_image-height":465,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-4.png","wide_image-width":980,"wide_image-height":636}},"image_position":"center","orientation":"horizontal","hyperlink":"https:\/\/codepen.io\/dawken\/pen\/pKGpNr?editors=0010"},{"acf_fc_layout":"content","content":"<h2 id=\"specifying-the-appearance\" class=\"code-line\" data-line=\"50\">Text Symbols<\/h2>\n<p>The visual styling of labels is driven by the symbol property of the <code>LabelClass<\/code>. Symbols are used in the API to specify the visual appearance of cartographic items, and they are not specific to text and labeling. This is why, when a symbol is used to style labels, it must have its type property set to <code>\"text\"<\/code>.<\/p>\n"},{"acf_fc_layout":"content","content":"<p><a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-symbols-TextSymbol.html\">Text symbols<\/a> are characterized by a few properties, some of them specific to their type.<\/p>\n<ul>\n<li><code>color<\/code>\u00a0defines the inner color of the label.<\/li>\n<li><code>haloColor<\/code>\u00a0defines the color of the halo. The halo is a soft border around each glyph that can greatly enhance readability of the label, especially on top of certain visually-rich basemaps. Also, it looks cool.<\/li>\n<li><code>haloSize<\/code>\u00a0defines the width in pixels of the halo.<\/li>\n<\/ul>\n"},{"acf_fc_layout":"image","image":{"ID":267132,"id":267132,"title":"text-styling-annotated","filename":"text-styling-annotated.png","filesize":46476,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/text-styling-annotated.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d\/text-styling-annotated","alt":"","author":"7921","description":"","caption":"","name":"text-styling-annotated","status":"inherit","uploaded_to":249352,"date":"2018-07-03 23:00:22","modified":"2018-07-03 23:00:22","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":675,"height":451,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/text-styling-annotated.png","thumbnail-width":213,"thumbnail-height":142,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/text-styling-annotated.png","medium-width":391,"medium-height":261,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/text-styling-annotated.png","medium_large-width":675,"medium_large-height":451,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/text-styling-annotated.png","large-width":675,"large-height":451,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/text-styling-annotated.png","1536x1536-width":675,"1536x1536-height":451,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/text-styling-annotated.png","2048x2048-width":675,"2048x2048-height":451,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/text-styling-annotated.png","card_image-width":675,"card_image-height":451,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/text-styling-annotated.png","wide_image-width":675,"wide_image-height":451}},"image_position":"center","orientation":"horizontal","hyperlink":"https:\/\/codepen.io\/dawken\/pen\/XYOgOz?editors=0010"},{"acf_fc_layout":"content","content":"<h2>Fonts<\/h2>\n<p>A symbol is also characterized by a <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-symbols-Font.html\">font<\/a>. This is a composite property that describes the typeface used for labels.<\/p>\n<ul>\n<li><code>family<\/code> is the name of the typeface, e.g. &#8220;arial&#8221;.<\/li>\n<li><code>style<\/code> defines a variation of the original typeface; can be &#8220;normal&#8221; or &#8220;italic&#8221;.<\/li>\n<li><code>weight<\/code> is the typographic weight; can be &#8220;normal&#8221; or &#8220;bold&#8221;.<\/li>\n<li><code>size<\/code> is the size in points, e.g. 12.<\/li>\n<\/ul>\n<p>Support for\u00a0<a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-symbols-Font.html#family\">Font.family<\/a>,\u00a0<a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-symbols-Font.html#style\">Font.style<\/a>, and\u00a0<a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-symbols-Font.html#weight\">Font.weight<\/a>\u00a0is dependent on hosted fonts files in\u00a0<code>.pbf<\/code>\u00a0format. By default, fonts are accessible on\u00a0<code>https:\/\/static.arcgis.com\/fonts<\/code>. The URL can be configured by setting the\u00a0<a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-config.html#fontsUrl\">esriConfig.fontsUrl<\/a>\u00a0property. See\u00a0<a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/guide\/labeling\/index.html#fonts-for-webgl-enabled-featurelayer-and-csvlayer\">fonts<\/a>\u00a0for available font families.<\/p>\n<p>To get a feel for what these different font properties look like, check out our <a href=\"https:\/\/noashx.github.io\/blog\/FontExplorer.html\" target=\"_blank\" rel=\"noopener\">Font Explorer app<\/a>, which lets you try out different fonts in a fun and safe space.<\/p>\n"},{"acf_fc_layout":"content","content":"<p>Now that we have explained all the new capabilities of labeling, let&#8217;s revisit <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/sample-code\/labels-multiple-classes\/index.html\">the sample<\/a> from the beginning of this blog. We employ some <code>where<\/code> logic in order to display temperatures at and above 32 degrees in red, and temperatures below 32 degrees in blue. The sample shows how to specify the content, appearance, placement and visibility of a label class.<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":268432,"id":268432,"title":"Screenshot","filename":"Screenshot-1.jpg","filesize":62552,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-1.jpg","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d\/screenshot-9","alt":"","author":"7921","description":"","caption":"","name":"screenshot-9","status":"inherit","uploaded_to":249352,"date":"2018-07-05 17:34:51","modified":"2018-07-05 17:34:51","menu_order":0,"mime_type":"image\/jpeg","type":"image","subtype":"jpeg","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":1632,"height":815,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-1.jpg","thumbnail-width":213,"thumbnail-height":106,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-1.jpg","medium-width":464,"medium-height":232,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-1.jpg","medium_large-width":768,"medium_large-height":384,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-1.jpg","large-width":1632,"large-height":815,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-1.jpg","1536x1536-width":1536,"1536x1536-height":767,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-1.jpg","2048x2048-width":1632,"2048x2048-height":815,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-1.jpg","card_image-width":826,"card_image-height":412,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Screenshot-1.jpg","wide_image-width":1632,"wide_image-height":815}},"image_position":"center","orientation":"horizontal","hyperlink":"https:\/\/developers.arcgis.com\/javascript\/latest\/sample-code\/labels-multiple-classes\/index.html"},{"acf_fc_layout":"content","content":"<h2>Current Limitations<\/h2>\n<p>Please note that labeling is based on WebGL and is not supported in SVG-rendered\u00a0<a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-layers-FeatureLayer.html\">FeatureLayers<\/a>\u00a0and\u00a0<a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-layers-CSVLayer.html\">CSVLayers<\/a>, which is currently the default rendering mechanism in 2D\u00a0<a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-views-MapView.html\">MapViews<\/a>. Labeling\u00a0is available for 2D\u00a0<a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-layers-FeatureLayer.html\">FeatureLayers<\/a>\u00a0and\u00a0<a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-layers-CSVLayer.html\">CSVLayers<\/a>\u00a0that are created from either feature services hosted on <a href=\"https:\/\/doc.arcgis.com\/en\/arcgis-online\/reference\/what-is-agol.htm\" target=\"_blank\" rel=\"noopener\">ArcGIS Online<\/a>, or from non-hosted enterprise services from version 10.6.1 or later of <a href=\"https:\/\/enterprise.arcgis.com\/en\/get-started\/latest\/windows\/what-is-arcgis-enterprise-.htm\" target=\"_blank\" rel=\"noopener\">ArcGIS Enterprise<\/a>. For more information, please see the <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/guide\/labeling\/index.html\" target=\"_blank\" rel=\"noopener\">Labeling Guide page<\/a>.<\/p>\n"},{"acf_fc_layout":"content","content":"<h2 id=\"learn-more\" class=\"code-line\" data-line=\"64\">Learn More<\/h2>\n<p class=\"code-line\" data-line=\"66\">Would you like to know more? For more information about labeling, check out these excellent resources:<\/p>\n<ul>\n<li><a title=\"https:\/\/developers.arcgis.com\/javascript\/latest\/guide\/labeling\/index.html\" href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/guide\/labeling\/index.html\">Labeling Guide<\/a><\/li>\n<li class=\"code-line\" data-line=\"70\"><a title=\"https:\/\/developers.arcgis.com\/javascript\/latest\/sample-code\/index.html?search=labeling\" href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/sample-code\/index.html?search=labeling\">Labeling Code Samples<\/a><\/li>\n<li><a title=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-layers-support-LabelClass.html\" href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-layers-support-LabelClass.html\">LabelClass Documentation<\/a><\/li>\n<li><a href=\"https:\/\/noashx.github.io\/blog\/FontExplorer.html\">Font Explorer App<\/a><\/li>\n<\/ul>\n<p>Happy labeling!<\/p>\n"}],"authors":[{"ID":7921,"user_firstname":"Dario","user_lastname":"D'Amico","nickname":"DDamico","user_nicename":"ddamico","display_name":"Dario D'Amico","user_email":"DDamico@esri.com","user_url":"","user_registered":"2018-05-04 17:50:51","user_description":"Hello, my name is Dario! I majored in CS with a focus on formal verification methods at the University of Florence, Italy. I live in Redlands with my wife and two sons and work as a rendering engineer at Esri.","user_avatar":"<img data-del=\"avatar\" src='https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/06\/32dd1ed.jpg' class='avatar pp-user-avatar avatar-96 photo ' height='96' width='96'\/>"},{"ID":7451,"user_firstname":"Noah","user_lastname":"Sager","nickname":"Noah Sager","user_nicename":"noah-sager","display_name":"Noah Sager","user_email":"NSager@esri.com","user_url":"https:\/\/www.noahsager.net\/","user_registered":"2018-03-21 18:21:19","user_description":"Passionate about JavaScript, maps, and writing (not necessarily in that order). Big fan of squirrels. Journeyman mapper of Utility Lines and Public Restrooms. Product Engineer on the ArcGIS API for JavaScript team. In Noah\u2019s spare time, he also enjoys parenting.","user_avatar":"<img alt='' src='https:\/\/secure.gravatar.com\/avatar\/6807cdccf3ddd5b30b84cdf9368ce6736c3d0ff9bd0a09c1f5efc03253069b64?s=96&#038;d=blank&#038;r=g' srcset='https:\/\/secure.gravatar.com\/avatar\/6807cdccf3ddd5b30b84cdf9368ce6736c3d0ff9bd0a09c1f5efc03253069b64?s=192&#038;d=blank&#038;r=g 2x' class='avatar avatar-96 photo' height='96' width='96' loading='lazy' decoding='async'\/>"}],"related_articles":[{"ID":244632,"post_author":"4271","post_date":"2018-07-05 10:46:38","post_date_gmt":"2018-07-05 17:46:38","post_content":"","post_title":"What's New in the ArcGIS API for JavaScript (version 4.8 & 3.25)","post_excerpt":"","post_status":"publish","comment_status":"closed","ping_status":"closed","post_password":"","post_name":"jsapi-4-8","to_ping":"","pinged":"","post_modified":"2018-07-26 12:07:52","post_modified_gmt":"2018-07-26 19:07:52","post_content_filtered":"","post_parent":0,"guid":"http:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=244632","menu_order":0,"post_type":"blog","post_mime_type":"","comment_count":"0","filter":"raw"},{"ID":79681,"post_author":"6561","post_date":"2017-09-29 11:10:08","post_date_gmt":"2017-09-29 11:10:08","post_content":"","post_title":"FeatureLayer rendering: taking advantage of WebGL in 2D","post_excerpt":"","post_status":"publish","comment_status":"closed","ping_status":"closed","post_password":"","post_name":"featurelayer-rendering-taking-advantage-of-webgl-in-2d","to_ping":"","pinged":"","post_modified":"2019-11-04 14:01:58","post_modified_gmt":"2019-11-04 22:01:58","post_content_filtered":"","post_parent":0,"guid":"http:\/\/www.esri.com\/arcgis-blog\/products\/product\/uncategorized\/featurelayer-rendering-taking-advantage-of-webgl-in-2d\/","menu_order":0,"post_type":"blog","post_mime_type":"","comment_count":"0","filter":"raw"}],"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/card-1.png","wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/banner-1.png"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Introduction to labeling in 2D with ArcGIS JavaScript API 4.8<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Introduction to labeling in 2D with ArcGIS JavaScript API 4.8\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d\" \/>\n<meta property=\"og:site_name\" content=\"ArcGIS Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/esrigis\/\" \/>\n<meta property=\"article:modified_time\" content=\"2018-07-16T22:58:43+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@ESRI\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d\"},\"author\":{\"name\":\"Dario D'Amico\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/94907a22d3e4a02e7c0cb7a100917434\"},\"headline\":\"Introduction to labeling in 2D with ArcGIS JavaScript API 4.8\",\"datePublished\":\"2018-07-05T11:00:02+00:00\",\"dateModified\":\"2018-07-16T22:58:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d\"},\"wordCount\":9,\"publisher\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\"},\"keywords\":[\"4.8\",\"ArcGIS API for JavaScript\",\"jsapi\",\"labeling\",\"WebGL\"],\"articleSection\":[\"Mapping\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d\",\"name\":\"Introduction to labeling in 2D with ArcGIS JavaScript API 4.8\",\"isPartOf\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#website\"},\"datePublished\":\"2018-07-05T11:00:02+00:00\",\"dateModified\":\"2018-07-16T22:58:43+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.esri.com\/arcgis-blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Introduction to labeling in 2D with ArcGIS JavaScript API 4.8\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#website\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/\",\"name\":\"ArcGIS Blog\",\"description\":\"Get insider info from Esri product teams\",\"publisher\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.esri.com\/arcgis-blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\",\"name\":\"Esri\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png\",\"contentUrl\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png\",\"width\":400,\"height\":400,\"caption\":\"Esri\"},\"image\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/esrigis\/\",\"https:\/\/x.com\/ESRI\",\"https:\/\/www.linkedin.com\/company\/5311\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/94907a22d3e4a02e7c0cb7a100917434\",\"name\":\"Dario D'Amico\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/06\/32dd1ed.jpg\",\"contentUrl\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/06\/32dd1ed.jpg\",\"caption\":\"Dario D'Amico\"},\"description\":\"Hello, my name is Dario! I majored in CS with a focus on formal verification methods at the University of Florence, Italy. I live in Redlands with my wife and two sons and work as a rendering engineer at Esri.\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/author\/ddamico\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Introduction to labeling in 2D with ArcGIS JavaScript API 4.8","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d","og_locale":"en_US","og_type":"article","og_title":"Introduction to labeling in 2D with ArcGIS JavaScript API 4.8","og_url":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d","og_site_name":"ArcGIS Blog","article_publisher":"https:\/\/www.facebook.com\/esrigis\/","article_modified_time":"2018-07-16T22:58:43+00:00","twitter_card":"summary_large_image","twitter_site":"@ESRI","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d#article","isPartOf":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d"},"author":{"name":"Dario D'Amico","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/94907a22d3e4a02e7c0cb7a100917434"},"headline":"Introduction to labeling in 2D with ArcGIS JavaScript API 4.8","datePublished":"2018-07-05T11:00:02+00:00","dateModified":"2018-07-16T22:58:43+00:00","mainEntityOfPage":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d"},"wordCount":9,"publisher":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization"},"keywords":["4.8","ArcGIS API for JavaScript","jsapi","labeling","WebGL"],"articleSection":["Mapping"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d","url":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d","name":"Introduction to labeling in 2D with ArcGIS JavaScript API 4.8","isPartOf":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#website"},"datePublished":"2018-07-05T11:00:02+00:00","dateModified":"2018-07-16T22:58:43+00:00","breadcrumb":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.esri.com\/arcgis-blog\/"},{"@type":"ListItem","position":2,"name":"Introduction to labeling in 2D with ArcGIS JavaScript API 4.8"}]},{"@type":"WebSite","@id":"https:\/\/www.esri.com\/arcgis-blog\/#website","url":"https:\/\/www.esri.com\/arcgis-blog\/","name":"ArcGIS Blog","description":"Get insider info from Esri product teams","publisher":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.esri.com\/arcgis-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization","name":"Esri","url":"https:\/\/www.esri.com\/arcgis-blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png","contentUrl":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png","width":400,"height":400,"caption":"Esri"},"image":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/esrigis\/","https:\/\/x.com\/ESRI","https:\/\/www.linkedin.com\/company\/5311\/"]},{"@type":"Person","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/94907a22d3e4a02e7c0cb7a100917434","name":"Dario D'Amico","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/image\/","url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/06\/32dd1ed.jpg","contentUrl":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/06\/32dd1ed.jpg","caption":"Dario D'Amico"},"description":"Hello, my name is Dario! I majored in CS with a focus on formal verification methods at the University of Florence, Italy. I live in Redlands with my wife and two sons and work as a rendering engineer at Esri.","url":"https:\/\/www.esri.com\/arcgis-blog\/author\/ddamico"}]}},"text_date":"July 5, 2018","author_name":"Multiple Authors","author_page":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labeling-in-2d","custom_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/banner-1.png","primary_product":"ArcGIS Maps SDK for JavaScript","tag_data":[{"term_id":127992,"name":"4.8","slug":"4-8","term_group":0,"term_taxonomy_id":127992,"taxonomy":"post_tag","description":"","parent":0,"count":2,"filter":"raw"},{"term_id":96582,"name":"ArcGIS API for JavaScript","slug":"arcgis-api-for-javascript","term_group":0,"term_taxonomy_id":96582,"taxonomy":"post_tag","description":"","parent":0,"count":58,"filter":"raw"},{"term_id":127982,"name":"jsapi","slug":"jsapi","term_group":0,"term_taxonomy_id":127982,"taxonomy":"post_tag","description":"","parent":0,"count":7,"filter":"raw"},{"term_id":128002,"name":"labeling","slug":"labeling","term_group":0,"term_taxonomy_id":128002,"taxonomy":"post_tag","description":"","parent":0,"count":14,"filter":"raw"},{"term_id":34641,"name":"WebGL","slug":"webgl","term_group":0,"term_taxonomy_id":34641,"taxonomy":"post_tag","description":"","parent":0,"count":3,"filter":"raw"}],"category_data":[{"term_id":22941,"name":"Mapping","slug":"mapping","term_group":0,"term_taxonomy_id":22941,"taxonomy":"category","description":"","parent":0,"count":2683,"filter":"raw"}],"product_data":[{"term_id":36831,"name":"ArcGIS Maps SDK for JavaScript","slug":"js-api-arcgis","term_group":0,"term_taxonomy_id":36831,"taxonomy":"product","description":"","parent":36601,"count":361,"filter":"raw"},{"term_id":36601,"name":"Developers","slug":"developers","term_group":0,"term_taxonomy_id":36601,"taxonomy":"product","description":"","parent":0,"count":761,"filter":"raw"}],"primary_product_link":"https:\/\/www.esri.com\/arcgis-blog\/?s=#&products=js-api-arcgis","_links":{"self":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog\/249352","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/types\/blog"}],"author":[{"embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/users\/7921"}],"replies":[{"embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/comments?post=249352"}],"version-history":[{"count":0,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog\/249352\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/media?parent=249352"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/categories?post=249352"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/tags?post=249352"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/industry?post=249352"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/product?post=249352"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}