{"id":79711,"date":"2017-10-04T08:00:30","date_gmt":"2017-10-04T08:00:30","guid":{"rendered":"http:\/\/www.esri.com\/arcgis-blog\/products\/product\/uncategorized\/speed-up-your-javascript-development-with-autocasting\/"},"modified":"2020-01-29T01:50:21","modified_gmt":"2020-01-29T09:50:21","slug":"speed-up-your-javascript-development-with-autocasting","status":"publish","type":"blog","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/developers\/mapping\/speed-up-your-javascript-development-with-autocasting","title":{"rendered":"Speed up your JavaScript development with autocasting"},"author":7011,"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":[549072,24921,27491,31291,31301],"industry":[],"product":[36831,36601],"class_list":["post-79711","blog","type-blog","status-publish","format-standard","hentry","category-mapping","tag-esrirdzurich","tag-javascript","tag-jsapi4","tag-renderers","tag-symbology","product-js-api-arcgis","product-developers"],"acf":{"short_description":"In the 4.5 release of the ArcGIS API for JavaScript, autocasting support was expanded to all renderers, symbols, and symbol layers. This ...","flexible_content":[{"acf_fc_layout":"content","content":"<p>In the <a href=\"https:\/\/blogs.esri.com\/esri\/arcgis\/2017\/09\/29\/arcgis-api-for-javascript-version-4-5-released\/\">4.5 release<\/a> of the ArcGIS API for JavaScript, <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/guide\/autocasting\/index.html\">autocasting<\/a> support was expanded to all <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-renderers-Renderer.html\">renderers<\/a>, <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-symbols-Symbol.html\">symbols<\/a>, and <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-symbols-Symbol3DLayer.html\">symbol layers<\/a>. This means that symbols and renderers can be created programmatically without importing their modules. All you need to do is create a simple object, specify the symbol type, and set the desired properties; then the API will autocast the object to its proper class. The <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/sample-code\/index.html\">samples in the API documentation<\/a> were updated to consistently follow this new pattern, which cleans up the lists of required modules quite nicely.<\/p>\n<p>Let&#8217;s look at an example where we set a renderer with a 3D symbol, labels, and callouts on a <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-layers-FeatureLayer.html\">FeatureLayer<\/a>:<\/p>\n<p><a href=\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2017\/10\/icon2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87895\" src=\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2017\/10\/icon2.png\" alt=\"\" width=\"155\" height=\"187\" \/><\/a><\/p>\n<p>To achieve this prior to 4.5 we needed to import six modules for the renderer, symbol, symbol layer, label symbol, text symbol layer, and the callout. The full list of required module imports looks like this:<\/p>\n<pre><span style=\"color: #0086b3;\">require<\/span>([\r\n  <span style=\"color: #d14;\">\"esri\/WebScene\"<\/span>,\r\n  <span style=\"color: #d14;\">\"esri\/views\/SceneView\"<\/span>,\r\n  <span style=\"color: #d14;\">\"esri\/layers\/FeatureLayer\"<\/span>,\r\n\r\n  <span style=\"color: #d14;\">\"esri\/renderers\/SimpleRenderer\"<\/span>,\r\n  <span style=\"color: #d14;\">\"esri\/symbols\/PointSymbol3D\"<\/span>,\r\n  <span style=\"color: #d14;\">\"esri\/symbols\/IconSymbol3DLayer\"<\/span>,\r\n  <span style=\"color: #d14;\">\"esri\/symbols\/LabelSymbol3D\"<\/span>,\r\n  <span style=\"color: #d14;\">\"esri\/symbols\/TextSymbol3DLayer\"<\/span>,\r\n  <span style=\"color: #d14;\">\"esri\/symbols\/callouts\/LineCallout3D\"<\/span>,\r\n\r\n  <span style=\"color: #d14;\">\"dojo\/domReady!\"<\/span>\r\n], <span style=\"color: #333; font-weight: bold;\">function<\/span>(\r\n  WebScene, SceneView, FeatureLayer,\r\n  SimpleRenderer, PointSymbol3D, IconSymbol3DLayer, \r\n  LabelSymbol3D, TextSymbol3DLayer, LineCallout3D\r\n){\r\n  <span style=\"color: #998; font-style: italic;\">\/\/ use modules here<\/span>\r\n});\r\n<\/pre>\n<p>With this new workflow, you don&#8217;t need to import modules for the renderers and the symbols. So in the example above, you only need to import the WebScene, SceneView and FeatureLayer:<\/p>\n<pre><span style=\"color: #0086b3;\">require<\/span>([\r\n  <span style=\"color: #d14;\">\"esri\/WebScene\"<\/span>,\r\n  <span style=\"color: #d14;\">\"esri\/views\/SceneView\"<\/span>,\r\n  <span style=\"color: #d14;\">\"esri\/layers\/FeatureLayer\"<\/span>,\r\n\r\n  <span style=\"color: #d14;\">\"dojo\/domReady!\"<\/span>\r\n], <span style=\"color: #333; font-weight: bold;\">function<\/span>(\r\n  WebScene, SceneView, FeatureLayer\r\n){\r\n  <span style=\"color: #998; font-style: italic;\">\/\/ use modules here<\/span>\r\n});\r\n<\/pre>\n<p>But how do we actually define the renderer and symbol objects without the required modules? We do this by specifying their type in a JavaScript object, just like in the example below:<\/p>\n<p><a href=\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2017\/10\/difference2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87909\" src=\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2017\/10\/difference2.png\" alt=\"\" width=\"566\" height=\"531\" \/><\/a><\/p>\n<p>If you want to play with the examples yourself, here&#8217;s the <a href=\"https:\/\/codepen.io\/ralucanicola\/pen\/booLyJ?editors=0010\">code snippet<\/a> for using classes and here&#8217;s the <a href=\"https:\/\/codepen.io\/ralucanicola\/pen\/jGGZNv?editors=0010\">code snippet<\/a> for using types. These snippets were derived from the <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/sample-code\/visualization-point-styles\/index.html\">Point styles for cities<\/a> sample in the documentation.<\/p>\n<p>Similarly, you can now autocast all <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-geometry-Geometry.html\">geometries<\/a> added to <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-Graphic.html#geometry\">graphics<\/a>. For example, instead of importing <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-geometry-Polyline.html\"><code>esri\/geometry\/Polyline<\/code><\/a> when manually creating a line, you can skip the import and do the following:<\/p>\n<pre><span style=\"color: #333; font-weight: bold;\">var<\/span> polylineGraphic = <span style=\"color: #333; font-weight: bold;\">new<\/span> Graphic({\r\n  geometry: {\r\n    type: <span style=\"color: #d14;\">\"polyline\"<\/span>, <span style=\"color: #998; font-style: italic;\">\/\/ autocasts as new Polyline()<\/span>\r\n    paths: [\r\n      [-<span style=\"color: #008080;\">0.178<\/span>, <span style=\"color: #008080;\">51.48791<\/span>, <span style=\"color: #008080;\">0<\/span>],\r\n      [-<span style=\"color: #008080;\">0.178<\/span>, <span style=\"color: #008080;\">51.48791<\/span>, <span style=\"color: #008080;\">1000<\/span>]\r\n    ]\r\n  },\r\n  symbol: {\r\n    type: <span style=\"color: #d14;\">\"simple-line\"<\/span>, <span style=\"color: #998; font-style: italic;\">\/\/ autocasts as SimpleLineSymbol()<\/span>\r\n    color: [<span style=\"color: #008080;\">226<\/span>, <span style=\"color: #008080;\">119<\/span>, <span style=\"color: #008080;\">40<\/span>],\r\n    width: <span style=\"color: #008080;\">4<\/span>\r\n  }\r\n});\r\n<\/pre>\n<p>The <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/sample-code\/graphics-basic-3d\/index.html\">Add Graphics to SceneView<\/a> and <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/sample-code\/intro-graphics\/index.html\">Intro to Graphics<\/a> samples were updated to follow the autocasting pattern.<\/p>\n<h2>When specifying object types is required<\/h2>\n<p>For many properties, you don&#8217;t need to specify the type of object to autocast since the API already knows the expected type. For example, you don&#8217;t need to set a type property in an object representing <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-symbols-SimpleMarkerSymbol.html#outline\">SimpleMarkerSymbol.outline<\/a> because the expected type for the outline of a simple marker (and all other symbols) is <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-symbols-SimpleLineSymbol.html\">SimpleLineSymbol<\/a>.<\/p>\n<p>However, renderer, symbol, symbol layer, and geometry objects are usually passed as values to polymorphic properties, meaning the API doesn&#8217;t know how to autocast the object unless the type is explicitly specified. The snippet below demonstrates both scenarios in context:<\/p>\n<pre>layer.renderer = {\r\n  <span style=\"color: #998; font-style: italic;\">\/\/ type must be specified since <\/span>\r\n  <span style=\"color: #998; font-style: italic;\">\/\/ 1 of 3 renderer types could be applied here<\/span>\r\n  type: <span style=\"color: #d14;\">\"simple\"<\/span>,  \r\n  symbol: {\r\n    <span style=\"color: #998; font-style: italic;\">\/\/ the type must also be specified for symbol properties of a renderer<\/span>\r\n    <span style=\"color: #998; font-style: italic;\">\/\/ since 1 of 10 symbol types could be used<\/span>\r\n    type: <span style=\"color: #d14;\">\"simple-marker\"<\/span>,  \r\n    outline: {\r\n      <span style=\"color: #998; font-style: italic;\">\/\/ Specifying type for outlines is not necessary <\/span>\r\n      <span style=\"color: #998; font-style: italic;\">\/\/ since `simple-line` is the only expected type<\/span>\r\n      style: <span style=\"color: #d14;\">\"dash-dot\"<\/span>,\r\n      color: [ <span style=\"color: #008080;\">255<\/span>, <span style=\"color: #008080;\">128<\/span>, <span style=\"color: #008080;\">45<\/span> ]\r\n    }\r\n  }\r\n};\r\n<\/pre>\n<p>So how do you know the value of the type property for any given scenario? There are number of ways to find the required type value. You can&#8230;<\/p>\n<ul>\n<li>Find the type in the <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/index.html?search=renderer.typ\">documentation<\/a>,<\/li>\n<li>Use the <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/sample-code\/playground\/live\/index.html\">Symbol Playground<\/a> to configure the code and copy the autocastable snippet for immediate use in your app, or<\/li>\n<li>Infer the value.<\/li>\n<\/ul>\n<p>Generally, you can infer the type by removing the generic text from the desired class name and kebabifying it. For example, <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-symbols-SimpleFillSymbol.html#type\">SimpleFillSymbol.type<\/a> is <strong><code>simple-fill<\/code><\/strong> (note that symbol is removed because it is used in all related 2D symbol class names). Another example: <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-renderers-UniqueValueRenderer.html#type\">UniqueValueRenderer.type<\/a> is <strong><code>unique-value<\/code><\/strong> (there&#8217;s no need to specify renderer in the type). <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-symbols-IconSymbol3DLayer.html#type\">IconSymbol3DLayer.type<\/a> is <strong><code>icon<\/code><\/strong> (the <em>Symbol3DLayer<\/em> bit is common among all symbol layers). See the comprehensive tables below to more fully understand this pattern. Once you&#8217;re familiar with it, you won&#8217;t have to look it up in the documentation!<\/p>\n<p>We&#8217;d love to hear what you think of this change or any other suggestions related to coding workflows.<\/p>\n<p>Happy coding!<br \/>\n<em>The ArcGIS API for JavaScript team<\/em><\/p>\n<h3>Class type tables<\/h3>\n<table style=\"width: 600px;\">\n<tbody>\n<tr style=\"background: #ffe6cc;\">\n<th>Renderer class name<\/th>\n<th>Type<\/th>\n<\/tr>\n<tr>\n<td>ClassBreaksRenderer<\/td>\n<td><code>class-breaks<\/code><\/td>\n<\/tr>\n<tr>\n<td>SimpleRenderer<\/td>\n<td><code>simple<\/code><\/td>\n<\/tr>\n<tr>\n<td>UniqueValueRenderer<\/td>\n<td><code>unique-value<\/code><\/td>\n<\/tr>\n<tr>\n<td>PointCloudRGBRenderer<\/td>\n<td><code>point-cloud-rgb<\/code><\/td>\n<\/tr>\n<tr>\n<td>PointCloudClassBreaksRenderer<\/td>\n<td><code>point-cloud-class-breaks<\/code><\/td>\n<\/tr>\n<tr>\n<td>PointCloudUniqueValueRenderer<\/td>\n<td><code>point-cloud-unique-value<\/code><\/td>\n<\/tr>\n<tr>\n<td>PointCloudStretchRenderer<\/td>\n<td><code>point-cloud-stretch<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table style=\"width: 600px;\">\n<tbody>\n<tr style=\"background: #ffe6cc;\">\n<th>2D Symbol class name<\/th>\n<th>Type<\/th>\n<\/tr>\n<tr>\n<td>PictureMarkerSymbol<\/td>\n<td><code>picture-marker<\/code><\/td>\n<\/tr>\n<tr>\n<td>PictureFillSymbol<\/td>\n<td><code>picture-fill<\/code><\/td>\n<\/tr>\n<tr>\n<td>SimpleFillSymbol<\/td>\n<td><code>simple-fill<\/code><\/td>\n<\/tr>\n<tr>\n<td>SimpleLineSymbol<\/td>\n<td><code>simple-line<\/code><\/td>\n<\/tr>\n<tr>\n<td>SimpleMarkerSymbol<\/td>\n<td><code>simple-marker<\/code><\/td>\n<\/tr>\n<tr>\n<td>TextSymbol<\/td>\n<td><code>text<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table style=\"width: 600px;\">\n<tbody>\n<tr style=\"background: #ffe6cc;\">\n<th>3D Symbol\/symbol layer class name<\/th>\n<th>Type<\/th>\n<\/tr>\n<tr>\n<td>LineCallout3D<\/td>\n<td><code>line<\/code><\/td>\n<\/tr>\n<tr>\n<td>ExtrudeSymbol3DLayer<\/td>\n<td><code>extrude<\/code><\/td>\n<\/tr>\n<tr>\n<td>FillSymbol3DLayer<\/td>\n<td><code>fill<\/code><\/td>\n<\/tr>\n<tr>\n<td>IconSymbol3DLayer<\/td>\n<td><code>icon<\/code><\/td>\n<\/tr>\n<tr>\n<td>LabelSymbol3D<\/td>\n<td><code>label-3d<\/code><\/td>\n<\/tr>\n<tr>\n<td>LineSymbol3D<\/td>\n<td><code>line-3d<\/code><\/td>\n<\/tr>\n<tr>\n<td>LineSymbol3DLayer<\/td>\n<td><code>line<\/code><\/td>\n<\/tr>\n<tr>\n<td>MeshSymbol3D<\/td>\n<td><code>mesh-3d<\/code><\/td>\n<\/tr>\n<tr>\n<td>ObjectSymbol3DLayer<\/td>\n<td><code>object<\/code><\/td>\n<\/tr>\n<tr>\n<td>PathSymbol3DLayer<\/td>\n<td><code>path<\/code><\/td>\n<\/tr>\n<tr>\n<td>PointSymbol3D<\/td>\n<td><code>point-3d<\/code><\/td>\n<\/tr>\n<tr>\n<td>PolygonSymbol3D<\/td>\n<td><code>polygon-3d<\/code><\/td>\n<\/tr>\n<tr>\n<td>TextSymbol3DLayer<\/td>\n<td><code>text<\/code><\/td>\n<\/tr>\n<tr>\n<td>WebStyleSymbol<\/td>\n<td><code>web-style<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table style=\"width: 600px;\">\n<tbody>\n<tr style=\"background: #ffe6cc;\">\n<th>Geometry class name<\/th>\n<th>Type<\/th>\n<\/tr>\n<tr>\n<td>Multipoint<\/td>\n<td><code>multipoint<\/code><\/td>\n<\/tr>\n<tr>\n<td>Point<\/td>\n<td><code>point<\/code><\/td>\n<\/tr>\n<tr>\n<td>Polygon<\/td>\n<td><code>fill<\/code><\/td>\n<\/tr>\n<tr>\n<td>Polyline<\/td>\n<td><code>polyline<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n"}],"authors":[{"ID":7011,"user_firstname":"Raluca","user_lastname":"Nicola","nickname":"Raluca Nicola","user_nicename":"raluca_zurich","display_name":"Raluca Nicola","user_email":"RNicola@esri.com","user_url":"https:\/\/raluca-nicola.net\/","user_registered":"2018-03-02 00:19:07","user_description":"Raluca works as a web cartographer with the Geo Experience Center team at Esri. She loves to play around with web technologies and visualization styles. If she's not in front of the computer, she's probably somewhere up in the mountains.","user_avatar":"<img data-del=\"avatar\" src='https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/7VkWXsZ3_400x400.jpg' class='avatar pp-user-avatar avatar-96 photo ' height='96' width='96'\/>"}],"related_articles":"","card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2017\/10\/live-by-the-code.png","wide_image":false},"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>Speed up your JavaScript development with autocasting<\/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\/developers\/mapping\/speed-up-your-javascript-development-with-autocasting\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Speed up your JavaScript development with autocasting\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.esri.com\/arcgis-blog\/products\/developers\/mapping\/speed-up-your-javascript-development-with-autocasting\" \/>\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=\"2020-01-29T09:50:21+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\/developers\/mapping\/speed-up-your-javascript-development-with-autocasting#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/developers\/mapping\/speed-up-your-javascript-development-with-autocasting\"},\"author\":{\"name\":\"Raluca Nicola\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/e8fe39abb687cde59f7f1296fbfb24a4\"},\"headline\":\"Speed up your JavaScript development with autocasting\",\"datePublished\":\"2017-10-04T08:00:30+00:00\",\"dateModified\":\"2020-01-29T09:50:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/developers\/mapping\/speed-up-your-javascript-development-with-autocasting\"},\"wordCount\":7,\"publisher\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\"},\"keywords\":[\"EsriRDZurich\",\"JavaScript\",\"jsapi4\",\"renderers\",\"symbols and symbology\"],\"articleSection\":[\"Mapping\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/developers\/mapping\/speed-up-your-javascript-development-with-autocasting\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/developers\/mapping\/speed-up-your-javascript-development-with-autocasting\",\"name\":\"Speed up your JavaScript development with autocasting\",\"isPartOf\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#website\"},\"datePublished\":\"2017-10-04T08:00:30+00:00\",\"dateModified\":\"2020-01-29T09:50:21+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/developers\/mapping\/speed-up-your-javascript-development-with-autocasting#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.esri.com\/arcgis-blog\/products\/developers\/mapping\/speed-up-your-javascript-development-with-autocasting\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/developers\/mapping\/speed-up-your-javascript-development-with-autocasting#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.esri.com\/arcgis-blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Speed up your JavaScript development with autocasting\"}]},{\"@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\/e8fe39abb687cde59f7f1296fbfb24a4\",\"name\":\"Raluca Nicola\",\"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\/04\/7VkWXsZ3_400x400.jpg\",\"contentUrl\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/7VkWXsZ3_400x400.jpg\",\"caption\":\"Raluca Nicola\"},\"description\":\"Raluca works as a web cartographer with the Geo Experience Center team at Esri. She loves to play around with web technologies and visualization styles. If she's not in front of the computer, she's probably somewhere up in the mountains.\",\"sameAs\":[\"https:\/\/raluca-nicola.net\/\",\"https:\/\/www.linkedin.com\/in\/raluca-nicola-cartography\/\",\"https:\/\/x.com\/nicolaraluk\"],\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/author\/raluca_zurich\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Speed up your JavaScript development with autocasting","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\/developers\/mapping\/speed-up-your-javascript-development-with-autocasting","og_locale":"en_US","og_type":"article","og_title":"Speed up your JavaScript development with autocasting","og_url":"https:\/\/www.esri.com\/arcgis-blog\/products\/developers\/mapping\/speed-up-your-javascript-development-with-autocasting","og_site_name":"ArcGIS Blog","article_publisher":"https:\/\/www.facebook.com\/esrigis\/","article_modified_time":"2020-01-29T09:50:21+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\/developers\/mapping\/speed-up-your-javascript-development-with-autocasting#article","isPartOf":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/developers\/mapping\/speed-up-your-javascript-development-with-autocasting"},"author":{"name":"Raluca Nicola","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/e8fe39abb687cde59f7f1296fbfb24a4"},"headline":"Speed up your JavaScript development with autocasting","datePublished":"2017-10-04T08:00:30+00:00","dateModified":"2020-01-29T09:50:21+00:00","mainEntityOfPage":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/developers\/mapping\/speed-up-your-javascript-development-with-autocasting"},"wordCount":7,"publisher":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization"},"keywords":["EsriRDZurich","JavaScript","jsapi4","renderers","symbols and symbology"],"articleSection":["Mapping"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/developers\/mapping\/speed-up-your-javascript-development-with-autocasting","url":"https:\/\/www.esri.com\/arcgis-blog\/products\/developers\/mapping\/speed-up-your-javascript-development-with-autocasting","name":"Speed up your JavaScript development with autocasting","isPartOf":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#website"},"datePublished":"2017-10-04T08:00:30+00:00","dateModified":"2020-01-29T09:50:21+00:00","breadcrumb":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/developers\/mapping\/speed-up-your-javascript-development-with-autocasting#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.esri.com\/arcgis-blog\/products\/developers\/mapping\/speed-up-your-javascript-development-with-autocasting"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/developers\/mapping\/speed-up-your-javascript-development-with-autocasting#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.esri.com\/arcgis-blog\/"},{"@type":"ListItem","position":2,"name":"Speed up your JavaScript development with autocasting"}]},{"@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\/e8fe39abb687cde59f7f1296fbfb24a4","name":"Raluca Nicola","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\/04\/7VkWXsZ3_400x400.jpg","contentUrl":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/7VkWXsZ3_400x400.jpg","caption":"Raluca Nicola"},"description":"Raluca works as a web cartographer with the Geo Experience Center team at Esri. She loves to play around with web technologies and visualization styles. If she's not in front of the computer, she's probably somewhere up in the mountains.","sameAs":["https:\/\/raluca-nicola.net\/","https:\/\/www.linkedin.com\/in\/raluca-nicola-cartography\/","https:\/\/x.com\/nicolaraluk"],"url":"https:\/\/www.esri.com\/arcgis-blog\/author\/raluca_zurich"}]}},"text_date":"October 4, 2017","author_name":"Raluca Nicola","author_page":"https:\/\/www.esri.com\/arcgis-blog\/author\/raluca_zurich","custom_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/08\/Newsroom-Keyart-Wide-1920-x-1080.jpg","primary_product":"Developers","tag_data":[{"term_id":549072,"name":"EsriRDZurich","slug":"esrirdzurich","term_group":0,"term_taxonomy_id":549072,"taxonomy":"post_tag","description":"","parent":0,"count":96,"filter":"raw"},{"term_id":24921,"name":"JavaScript","slug":"javascript","term_group":0,"term_taxonomy_id":24921,"taxonomy":"post_tag","description":"","parent":0,"count":151,"filter":"raw"},{"term_id":27491,"name":"jsapi4","slug":"jsapi4","term_group":0,"term_taxonomy_id":27491,"taxonomy":"post_tag","description":"","parent":0,"count":111,"filter":"raw"},{"term_id":31291,"name":"renderers","slug":"renderers","term_group":0,"term_taxonomy_id":31291,"taxonomy":"post_tag","description":"","parent":0,"count":9,"filter":"raw"},{"term_id":31301,"name":"symbols and symbology","slug":"symbology","term_group":0,"term_taxonomy_id":31301,"taxonomy":"post_tag","description":"","parent":0,"count":194,"filter":"raw"}],"category_data":[{"term_id":22941,"name":"Mapping","slug":"mapping","term_group":0,"term_taxonomy_id":22941,"taxonomy":"category","description":"","parent":0,"count":2698,"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":363,"filter":"raw"},{"term_id":36601,"name":"Developers","slug":"developers","term_group":0,"term_taxonomy_id":36601,"taxonomy":"product","description":"","parent":0,"count":765,"filter":"raw"}],"primary_product_link":"https:\/\/www.esri.com\/arcgis-blog\/?s=#&products=developers","_links":{"self":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog\/79711","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\/7011"}],"replies":[{"embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/comments?post=79711"}],"version-history":[{"count":0,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog\/79711\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/media?parent=79711"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/categories?post=79711"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/tags?post=79711"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/industry?post=79711"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/product?post=79711"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}