{"id":2634792,"date":"2024-12-20T13:12:52","date_gmt":"2024-12-20T21:12:52","guid":{"rendered":"https:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=2634792"},"modified":"2024-12-20T13:19:21","modified_gmt":"2024-12-20T21:19:21","slug":"web-maps-the-foundation-of-arcgis-web-applications","status":"publish","type":"blog","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/developers\/web-maps-the-foundation-of-arcgis-web-applications","title":{"rendered":"Web maps\u2014the foundation of ArcGIS web applications"},"author":6561,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_acf_changed":false,"_searchwp_excluded":""},"categories":[738191,22941],"tags":[33371,25971],"industry":[],"product":[36831,36551,36601],"class_list":["post-2634792","blog","type-blog","status-publish","format-standard","hentry","category-developers","category-mapping","tag-map-viewer","tag-portal","product-js-api-arcgis","product-arcgis-online","product-developers"],"acf":{"short_description":"In ArcGIS, the web map should be the foundation of any custom web application. This post shows how to leverage web maps in a custom app.","flexible_content":[{"acf_fc_layout":"content","content":"<p>In <a href=\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/developers\/good-better-best-simplify-your-web-app-development-with-map-viewer\/\">Good, better, best\u2014Simplify your web app development with Map Viewer<\/a> I demonstrate the benefits of using <a href=\"https:\/\/www.arcgis.com\/apps\/mapviewer\/index.html\">Map Viewer<\/a> as a starting point for creating web apps in ArcGIS. I recommend you first read that article as it sets a foundation for this one. In this article, I&#8217;ll demonstrate how to create a custom web app, based on a web map configured in Map Viewer, that adds functionality not available in Map Viewer or other configurable ArcGIS apps.<\/p>\n<p>In the previous article, I configured <a href=\"https:\/\/www.arcgis.com\/apps\/mapviewer\/index.html?webmap=8aa8e543e8e0446e8e2937e2b743b9f0\">this web map<\/a>, which shows the number of people who visited U.S. national parks in 2023.<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":2614092,"id":2614092,"title":"map viewer table","filename":"map-viewer-table.png","filesize":593062,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/map-viewer-table.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/developers\/good-better-best-simplify-your-web-app-development-with-map-viewer\/map-viewer-table","alt":"The national park data contains more than 100 columns containing data for the number of visitors to each park from 1905-2023.","author":"6561","description":"","caption":"The national park data in the following examples contains more than 100 columns storing data for the number of visitors to each park from 1905-2023.","name":"map-viewer-table","status":"inherit","uploaded_to":2613782,"date":"2024-12-05 00:31:43","modified":"2024-12-16 23:33:13","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":1979,"height":952,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/map-viewer-table-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/map-viewer-table.png","medium-width":464,"medium-height":223,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/map-viewer-table.png","medium_large-width":768,"medium_large-height":369,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/map-viewer-table.png","large-width":1920,"large-height":924,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/map-viewer-table-1536x739.png","1536x1536-width":1536,"1536x1536-height":739,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/map-viewer-table.png","2048x2048-width":1979,"2048x2048-height":952,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/map-viewer-table-826x397.png","card_image-width":826,"card_image-height":397,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/map-viewer-table-1920x924.png","wide_image-width":1920,"wide_image-height":924}},"image_position":"center","orientation":"horizontal","hyperlink":"https:\/\/www.arcgis.com\/apps\/mapviewer\/index.html?webmap=8aa8e543e8e0446e8e2937e2b743b9f0"},{"acf_fc_layout":"content","content":"<p>I loaded all the data and configurations stored in this web map to <a href=\"https:\/\/ekenes.github.io\/portal-vs-scratch\/viewer-only.html\">a custom application<\/a> built with the ArcGIS Maps SDK for JavaScript (JS Maps SDK). We&#8217;ll use the web map and this basic application as the foundation for building a more dynamic application in this article.<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":2614032,"id":2614032,"title":"simple viewer app","filename":"simple-viewer-app.png","filesize":1142853,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/simple-viewer-app.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/developers\/good-better-best-simplify-your-web-app-development-with-map-viewer\/simple-viewer-app","alt":"","author":"6561","description":"","caption":"","name":"simple-viewer-app","status":"inherit","uploaded_to":2613782,"date":"2024-12-05 00:26:06","modified":"2024-12-05 00:26:06","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":1716,"height":896,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/simple-viewer-app-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/simple-viewer-app.png","medium-width":464,"medium-height":242,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/simple-viewer-app.png","medium_large-width":768,"medium_large-height":401,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/simple-viewer-app.png","large-width":1716,"large-height":896,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/simple-viewer-app-1536x802.png","1536x1536-width":1536,"1536x1536-height":802,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/simple-viewer-app.png","2048x2048-width":1716,"2048x2048-height":896,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/simple-viewer-app-826x431.png","card_image-width":826,"card_image-height":431,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/simple-viewer-app.png","wide_image-width":1716,"wide_image-height":896}},"image_position":"center","orientation":"horizontal","hyperlink":"https:\/\/ekenes.github.io\/portal-vs-scratch\/viewer-only.html"},{"acf_fc_layout":"content","content":"<p>Remember, loading the web map in a custom app built with the JS Maps SDK saves me about 700 lines of code from the start. <\/p>\n<h2>Go beyond the web map with the JS Maps SDK<\/h2>\n<p>Let&#8217;s take this app a step further and add data exploration capabilities not currently available in Map Viewer. I would like the user to explore the data from 1905 to 2023 using a slider, not just 2023 data. Since Map Viewer, and none of Esri&#8217;s configurable apps, allow me to do this, I&#8217;ll use the JS Maps SDK to build a custom application to accomplish this goal. The JS Maps SDK gives developers full control over building innovative and interactive user experiences.<\/p>\n"},{"acf_fc_layout":"content","content":"<p>I\u2019ll add calcite components to help with the layout, including a slider at the bottom of the app. This will allow the user to explore data from multiple years. Note the <code>arcgis-map<\/code> component that references the item ID of the initial web map.<\/p>\n<pre><code><span>&lt;<span style=\"color: #22863a\">calcite-shell<\/span>&gt;<\/span>\r\n  <span>&lt;<span style=\"color: #22863a\">arcgis-map<\/span> <span style=\"color: #005cc5\">item-id<\/span>=<span style=\"color: #032f62\">&quot;8aa8e543e8e0446e8e2937e2b743b9f0&quot;<\/span>&gt;<\/span>\r\n    <span>&lt;<span style=\"color: #22863a\">arcgis-zoom<\/span> <span style=\"color: #005cc5\">position<\/span>=<span style=\"color: #032f62\">&quot;top-left&quot;<\/span>&gt;<\/span><span>&lt;\/<span style=\"color: #22863a\">arcgis-zoom<\/span>&gt;<\/span>\r\n    <span>&lt;<span style=\"color: #22863a\">arcgis-expand<\/span> <span style=\"color: #005cc5\">expanded<\/span> <span style=\"color: #005cc5\">position<\/span>=<span style=\"color: #032f62\">&quot;top-left&quot;<\/span>&gt;<\/span>\r\n      <span>&lt;<span style=\"color: #22863a\">arcgis-legend<\/span>&gt;<\/span><span>&lt;\/<span style=\"color: #22863a\">arcgis-legend<\/span>&gt;<\/span>\r\n    <span>&lt;\/<span style=\"color: #22863a\">arcgis-expand<\/span>&gt;<\/span>\r\n  <span>&lt;\/<span style=\"color: #22863a\">arcgis-map<\/span>&gt;<\/span>\r\n  <span>&lt;<span style=\"color: #22863a\">calcite-shell-panel<\/span> <span style=\"color: #005cc5\">id<\/span>=<span style=\"color: #032f62\">&quot;slider-panel&quot;<\/span> <span style=\"color: #005cc5\">slot<\/span>=<span style=\"color: #032f62\">&quot;panel-bottom&quot;<\/span> <span style=\"color: #005cc5\">layout<\/span>=<span style=\"color: #032f62\">&quot;horizontal&quot;<\/span>&gt;<\/span>\r\n    <span>&lt;<span style=\"color: #22863a\">div<\/span> <span style=\"color: #005cc5\">id<\/span>=<span style=\"color: #032f62\">&quot;slider-container&quot;<\/span>&gt;<\/span>\r\n      <span>&lt;<span style=\"color: #22863a\">label<\/span>&gt;<\/span>\r\n        <span>&lt;<span style=\"color: #22863a\">span<\/span> <span style=\"color: #005cc5\">id<\/span>=<span style=\"color: #032f62\">&quot;slider-label&quot;<\/span>&gt;<\/span>Year: 2023<span>&lt;\/<span style=\"color: #22863a\">span<\/span>&gt;<\/span>\r\n        <span>&lt;<span style=\"color: #22863a\">calcite-slider<\/span>\r\n          <span style=\"color: #005cc5\">has-histogram<\/span> <span style=\"color: #005cc5\">id<\/span>=<span style=\"color: #032f62\">&quot;yearSlider&quot;<\/span> <span style=\"color: #005cc5\">label-handles<\/span> <span style=\"color: #005cc5\">label-ticks<\/span>\r\n          <span style=\"color: #005cc5\">ticks<\/span>=<span style=\"color: #032f62\">&quot;5&quot;<\/span> <span style=\"color: #005cc5\">min<\/span>=<span style=\"color: #032f62\">&quot;1905&quot;<\/span> <span style=\"color: #005cc5\">max<\/span>=<span style=\"color: #032f62\">&quot;2023&quot;<\/span> <span style=\"color: #005cc5\">value<\/span>=<span style=\"color: #032f62\">&quot;2023&quot;<\/span> <span style=\"color: #005cc5\">step<\/span>=<span style=\"color: #032f62\">&quot;1&quot;<\/span>\r\n          <span style=\"color: #005cc5\">min-label<\/span>=<span style=\"color: #032f62\">&quot;1905&quot;<\/span> <span style=\"color: #005cc5\">max-label<\/span>=<span style=\"color: #032f62\">&quot;2023&quot;<\/span> <span style=\"color: #005cc5\">scale<\/span>=<span style=\"color: #032f62\">&quot;m&quot;<\/span>\r\n        &gt;<\/span><span>&lt;\/<span style=\"color: #22863a\">calcite-slider<\/span>&gt;<\/span>\r\n      <span>&lt;\/<span style=\"color: #22863a\">label<\/span>&gt;<\/span>\r\n    <span>&lt;\/<span style=\"color: #22863a\">div<\/span>&gt;<\/span>\r\n  <span>&lt;\/<span style=\"color: #22863a\">calcite-shell-panel<\/span>&gt;<\/span>\r\n<span>&lt;\/<span style=\"color: #22863a\">calcite-shell<\/span>&gt;<\/span>\r\n<\/code><\/pre>\n"},{"acf_fc_layout":"image","image":{"ID":2614042,"id":2614042,"title":"slider app - no histogram","filename":"slider-app-no-histogram.png","filesize":797370,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/slider-app-no-histogram.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/developers\/good-better-best-simplify-your-web-app-development-with-map-viewer\/slider-app-no-histogram","alt":"A custom application loading the previously configured web map, and adding a slider for exploring how the data changed over time.","author":"6561","description":"","caption":"A custom application loading the previously configured web map, and adding a slider for exploring how the data changed over time.","name":"slider-app-no-histogram","status":"inherit","uploaded_to":2613782,"date":"2024-12-05 00:29:09","modified":"2024-12-20 20:19:47","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":1196,"height":775,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/slider-app-no-histogram-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/slider-app-no-histogram.png","medium-width":403,"medium-height":261,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/slider-app-no-histogram.png","medium_large-width":768,"medium_large-height":498,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/slider-app-no-histogram.png","large-width":1196,"large-height":775,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/slider-app-no-histogram.png","1536x1536-width":1196,"1536x1536-height":775,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/slider-app-no-histogram.png","2048x2048-width":1196,"2048x2048-height":775,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/slider-app-no-histogram-718x465.png","card_image-width":718,"card_image-height":465,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/slider-app-no-histogram.png","wide_image-width":1196,"wide_image-height":775}},"image_position":"center","orientation":"horizontal","hyperlink":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/slider-app-no-histogram.png"},{"acf_fc_layout":"content","content":"<p>At this point, I haven&#8217;t been required to write any JavaScript. However, since I want to add custom behavior to the slider, I now need to define this using JavaScript.<\/p>\n<pre><code><span>&lt;<span style=\"color: #22863a\">body<\/span>&gt;<\/span>\r\n  <span>&lt;<span style=\"color: #22863a\">calcite-shell<\/span>&gt;<\/span>\r\n    <span style=\"color: #6a737d\">&lt;!-- HTML is &quot;collapsed&quot; here to conserve space in this snippet --&gt;<\/span>\r\n  <span>&lt;\/<span style=\"color: #22863a\">calcite-shell<\/span>&gt;<\/span>\r\n\r\n  <span>&lt;<span style=\"color: #22863a\">script<\/span>&gt;<\/span><span>\r\n    <span style=\"color: #6a737d\">...\/\/ JS code goes here to control behavior of slider...<\/span>\r\n  <\/span><span>&lt;\/<span style=\"color: #22863a\">script<\/span>&gt;<\/span>\r\n<span>&lt;\/<span style=\"color: #22863a\">body<\/span>&gt;<\/span>\r\n\r\n<span>&lt;\/<span style=\"color: #22863a\">html<\/span>&gt;<\/span>\r\n<\/code><\/pre>\n<p>There are two events I need to define behavior for: <strong>when the map loads<\/strong> and <strong>when the user slides the slider handles<\/strong>.<\/p>\n<h3>Event 1: When the map loads<\/h3>\n<p>The Calcite slider includes an option for adding a histogram. I want to set the histogram to represent the total number of visits to all parks for each year corresponding to the slider stops.<\/p>\n<p>When the map loads, the app queries statistics for all national park visits for each year. I then push these numbers to the <a href=\"https:\/\/developers.arcgis.com\/calcite-design-system\/components\/slider\/\">Calcite Slider<\/a>\u2019s histogram property, which renders nicely on top of the slider.<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":2630212,"id":2630212,"title":"Screenshot 2024-12-17 at 10.26.27\u202fAM","filename":"Screenshot-2024-12-17-at-10.26.27\u202fAM.png","filesize":2016569,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/Screenshot-2024-12-17-at-10.26.27\u202fAM.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/developers\/good-better-best-simplify-your-web-app-development-with-map-viewer\/screenshot-2024-12-17-at-10-26-27-am","alt":"Calcite slider allows you to add a histogram. In this example, the significant drop in visits to national parks in 2020 is clearly visible.","author":"6561","description":"","caption":"The Calcite slider allows you to add a histogram. In this example, the significant drop in visits to national parks in 2020 is clearly visible.","name":"screenshot-2024-12-17-at-10-26-27-am","status":"inherit","uploaded_to":2613782,"date":"2024-12-17 19:27:09","modified":"2024-12-20 21:04:10","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":2706,"height":1450,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/Screenshot-2024-12-17-at-10.26.27\u202fAM-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/Screenshot-2024-12-17-at-10.26.27\u202fAM.png","medium-width":464,"medium-height":249,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/Screenshot-2024-12-17-at-10.26.27\u202fAM.png","medium_large-width":768,"medium_large-height":412,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/Screenshot-2024-12-17-at-10.26.27\u202fAM.png","large-width":1920,"large-height":1029,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/Screenshot-2024-12-17-at-10.26.27\u202fAM-1536x823.png","1536x1536-width":1536,"1536x1536-height":823,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/Screenshot-2024-12-17-at-10.26.27\u202fAM-2048x1097.png","2048x2048-width":2048,"2048x2048-height":1097,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/Screenshot-2024-12-17-at-10.26.27\u202fAM-826x443.png","card_image-width":826,"card_image-height":443,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/Screenshot-2024-12-17-at-10.26.27\u202fAM-1920x1029.png","wide_image-width":1920,"wide_image-height":1029}},"image_position":"center","orientation":"horizontal","hyperlink":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/Screenshot-2024-12-17-at-10.26.27\u202fAM.png"},{"acf_fc_layout":"content","content":"<p>The code for querying this data is below.<\/p>\n<pre><code><span style=\"color: #e36209\">require<\/span>([\r\n  <span style=\"color: #032f62\">&quot;esri\/intl&quot;<\/span>\r\n], <span>(<span>esriIntl<\/span>) =&gt;<\/span> {\r\n  <span style=\"color: #d73a49\">const<\/span> yearSlider = <span style=\"color: #d73a49\">document<\/span>.<span style=\"color: #6f42c1\">querySelector<\/span>(<span style=\"color: #032f62\">&quot;calcite-slider&quot;<\/span>);\r\n  <span style=\"color: #d73a49\">const<\/span> arcgisMap = <span style=\"color: #d73a49\">document<\/span>.<span style=\"color: #6f42c1\">querySelector<\/span>(<span style=\"color: #032f62\">&quot;arcgis-map&quot;<\/span>);\r\n  <span style=\"color: #d73a49\">const<\/span> sliderLabel = <span style=\"color: #d73a49\">document<\/span>.<span style=\"color: #6f42c1\">getElementById<\/span>(<span style=\"color: #032f62\">&quot;slider-label&quot;<\/span>);\r\n\r\n  arcgisMap.<span style=\"color: #6f42c1\">addEventListener<\/span>(<span style=\"color: #032f62\">&quot;arcgisViewReadyChange&quot;<\/span>, <span style=\"color: #d73a49\">async<\/span> () =&gt; {\r\n\r\n    <span style=\"color: #d73a49\">const<\/span> layer = arcgisMap.<span>map<\/span>.<span>layers<\/span>.<span style=\"color: #6f42c1\">at<\/span>(<span style=\"color: #005cc5\">0<\/span>);\r\n\r\n    <span style=\"color: #d73a49\">const<\/span> stats = <span style=\"color: #d73a49\">await<\/span> <span style=\"color: #6f42c1\">queryTotalVisits<\/span>({ layer });\r\n    <span style=\"color: #d73a49\">const<\/span> histogram = <span style=\"color: #6f42c1\">createHistogram<\/span>(stats);\r\n    yearSlider.<span>histogram<\/span> = histogram;\r\n\r\n    <span style=\"color: #d73a49\">const<\/span> visits2023 = esriIntl.<span style=\"color: #6f42c1\">formatNumber<\/span>(stats[<span style=\"color: #032f62\">`F<span style=\"color: #24292e\">${<span style=\"color: #005cc5\">2023<\/span>}<\/span>`<\/span>]);\r\n    sliderLabel.<span>innerText<\/span> = <span style=\"color: #032f62\">`<span style=\"color: #24292e\">${visits2023}<\/span> visits in <span style=\"color: #24292e\">${<span style=\"color: #005cc5\">2023<\/span>}<\/span>`<\/span>;\r\n\r\n  <span style=\"color: #6a737d\">\/\/ Returns an object containing total visits<\/span>\r\n  <span style=\"color: #6a737d\">\/\/ for each year 1905-2023<\/span>\r\n  <span style=\"color: #6a737d\">\/\/ {<\/span>\r\n  <span style=\"color: #6a737d\">\/\/   F2020: 67926884<\/span>\r\n  <span style=\"color: #6a737d\">\/\/   F2021: 92243362<\/span>\r\n  <span style=\"color: #6a737d\">\/\/   F2022: 88660294<\/span>\r\n  <span style=\"color: #6a737d\">\/\/ }<\/span>\r\n  <span style=\"color: #d73a49\">async<\/span> <span style=\"color: #d73a49\">function<\/span> <span style=\"color: #6f42c1\">queryTotalVisits<\/span>(<span>{ layer }<\/span>) {\r\n    <span style=\"color: #d73a49\">const<\/span> query = layer.<span style=\"color: #6f42c1\">createQuery<\/span>();\r\n    query.<span>outStatistics<\/span> = [];\r\n\r\n    <span style=\"color: #d73a49\">const<\/span> startYear = <span style=\"color: #005cc5\">1905<\/span>;\r\n    <span style=\"color: #d73a49\">const<\/span> endYear = <span style=\"color: #005cc5\">2023<\/span>;\r\n\r\n    <span style=\"color: #d73a49\">for<\/span> (<span style=\"color: #d73a49\">let<\/span> year = startYear; year &lt;= endYear; year++) {\r\n      query.<span>outStatistics<\/span>.<span style=\"color: #6f42c1\">push<\/span>({\r\n        <span style=\"color: #005cc5\">onStatisticField<\/span>: <span style=\"color: #032f62\">`F<span style=\"color: #24292e\">${year}<\/span>`<\/span>,\r\n        <span style=\"color: #005cc5\">outStatisticFieldName<\/span>: <span style=\"color: #032f62\">`F<span style=\"color: #24292e\">${year}<\/span>`<\/span>,\r\n        <span style=\"color: #005cc5\">statisticType<\/span>: <span style=\"color: #032f62\">&quot;sum&quot;<\/span>\r\n      });\r\n    }\r\n\r\n    <span style=\"color: #d73a49\">const<\/span> { features } = <span style=\"color: #d73a49\">await<\/span> layer.<span style=\"color: #6f42c1\">queryFeatures<\/span>(query);\r\n    <span style=\"color: #d73a49\">const<\/span> stats = features[<span style=\"color: #005cc5\">0<\/span>].<span>attributes<\/span>;\r\n    <span style=\"color: #d73a49\">return<\/span> stats;\r\n  }\r\n\r\n  <span style=\"color: #6a737d\">\/\/ transform histogram result into the format required<\/span>\r\n  <span style=\"color: #6a737d\">\/\/ by the CalciteSlider component, for example...<\/span>\r\n  <span style=\"color: #6a737d\">\/\/ [<\/span>\r\n  <span style=\"color: #6a737d\">\/\/   ...<\/span>\r\n  <span style=\"color: #6a737d\">\/\/   [2020, 67926884],<\/span>\r\n  <span style=\"color: #6a737d\">\/\/   [2021, 92243362],<\/span>\r\n  <span style=\"color: #6a737d\">\/\/   ...<\/span>\r\n  <span style=\"color: #6a737d\">\/\/ ]<\/span>\r\n  <span style=\"color: #d73a49\">function<\/span> <span style=\"color: #6f42c1\">createHistogram<\/span>(<span>stats<\/span>) {\r\n    <span style=\"color: #d73a49\">const<\/span> histogram = [];\r\n    <span style=\"color: #d73a49\">for<\/span> (<span style=\"color: #d73a49\">const<\/span> stat <span style=\"color: #d73a49\">in<\/span> stats) {\r\n      <span style=\"color: #d73a49\">const<\/span> year = <span style=\"color: #e36209\">parseInt<\/span>(stat.<span style=\"color: #6f42c1\">replace<\/span>(<span style=\"color: #032f62\">&quot;F&quot;<\/span>, <span style=\"color: #032f62\">&quot;&quot;<\/span>));\r\n      histogram.<span style=\"color: #6f42c1\">push<\/span>([year, stats[stat]]);\r\n    }\r\n    <span style=\"color: #d73a49\">return<\/span> histogram;\r\n  }\r\n});\r\n<\/code><\/pre>\n"},{"acf_fc_layout":"content","content":"<h3>Event 2: When the user interacts with the slider<\/h3>\n<p>Each time the user interacts with the slider, the app needs to update the layer&#8217;s renderer, labels, and popup template to represent data for the indicated year. Note this is not a <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-layers-support-FeatureFilter.html\">filter<\/a> capability. <strong>This is an update to various layer configurations originally saved in Map Viewer based on a single slider interaction.<\/strong><\/p>\n<pre><code><span style=\"color: #6a737d\">\/\/ Each time the slider handle is moved, update the data<\/span>\r\n<span style=\"color: #6a737d\">\/\/ displayed in the layer's renderer, labels, popup, and slider<\/span>\r\nyearSlider.<span style=\"color: #6f42c1\">addEventListener<\/span>(<span style=\"color: #032f62\">&quot;calciteSliderInput&quot;<\/span>, <span>() =&gt;<\/span> {\r\n  <span style=\"color: #d73a49\">const<\/span> year = yearSlider.<span>value<\/span>;\r\n\r\n  <span style=\"color: #d73a49\">const<\/span> renderer = <span style=\"color: #6f42c1\">updateRenderer<\/span>({ layer, year });\r\n  layer.<span>renderer<\/span> = renderer;\r\n\r\n  <span style=\"color: #d73a49\">const<\/span> labelingInfo = <span style=\"color: #6f42c1\">updateLabels<\/span>({ layer, year });\r\n  layer.<span>labelingInfo<\/span> = labelingInfo;\r\n\r\n  <span style=\"color: #d73a49\">const<\/span> popupTemplate = <span style=\"color: #6f42c1\">updatePopupTemplate<\/span>({ layer, year });\r\n  layer.<span>popupTemplate<\/span> = popupTemplate;\r\n\r\n  <span style=\"color: #d73a49\">const<\/span> visits = esriIntl.<span style=\"color: #6f42c1\">formatNumber<\/span>(stats[<span style=\"color: #032f62\">`F<span style=\"color: #24292e\">${year}<\/span>`<\/span>]);\r\n  sliderLabel.<span>innerText<\/span> = <span style=\"color: #032f62\">`<span style=\"color: #24292e\">${visits}<\/span> visits in <span style=\"color: #24292e\">${year}<\/span>`<\/span>;\r\n});\r\n<\/code><\/pre>\n<p>Let&#8217;s explore the functions that update each of the following configurations when the slider&#8217;s value changes.<\/p>\n<ul>\n<li>Renderer<\/li>\n<li>Labels<\/li>\n<li>Popup Template<\/li>\n<\/ul>\n<h4>Renderer<\/h4>\n<p><strong>The map author originally configured the renderer in Map Viewer using the smart mapping panel.<\/strong> The renderer has two data-driven visual variables: <\/p>\n<ul>\n<li><strong>Size<\/strong> &#8211; represents the total visits for a year. In this case, the size variable points to a specific field to return this data.<\/li>\n<li><strong>Color<\/strong> &#8211; represents the percent change in visits from the previous year. In this case, the color variable references an Arcade expression that calculates this value.<\/li>\n<\/ul>\n<p>The app needs to update the fields and expressions referenced by both visual variables based on the slider&#8217;s position. When we make apps that compare values between different years, it&#8217;s important to compare on the same scale and data ranges. For that reason we don&#8217;t need to be concerned with the stops or break points set by the map author in Map Viewer. All the developer should be concerned with is that the data matches the year represented by the slider position.<\/p>\n<pre><code><span style=\"color: #d73a49\">function<\/span> <span style=\"color: #6f42c1\">updateRenderer<\/span>(<span>{ layer, year }<\/span>) {\r\n  <span style=\"color: #d73a49\">const<\/span> renderer = layer.<span>renderer<\/span>.<span style=\"color: #6f42c1\">clone<\/span>();\r\n  renderer.<span>valueExpression<\/span> = <span style=\"color: #6f42c1\">createArcadeExpression<\/span>({ year });\r\n\r\n  <span style=\"color: #d73a49\">const<\/span> colorVariable = renderer.<span>visualVariables<\/span>.<span style=\"color: #6f42c1\">find<\/span>(<span>(<span>{ <span style=\"color: #d73a49\">type<\/span> }<\/span>) =&gt;<\/span> <span style=\"color: #d73a49\">type<\/span> === <span style=\"color: #032f62\">&quot;color&quot;<\/span>);\r\n  colorVariable.<span>valueExpression<\/span> = <span style=\"color: #6f42c1\">createArcadeExpression<\/span>({ year });\r\n\r\n  <span style=\"color: #d73a49\">const<\/span> sizeVariable = renderer.<span>visualVariables<\/span>.<span style=\"color: #6f42c1\">find<\/span>(<span>(<span>{ <span style=\"color: #d73a49\">type<\/span> }<\/span>) =&gt;<\/span> <span style=\"color: #d73a49\">type<\/span> === <span style=\"color: #032f62\">&quot;size&quot;<\/span>);\r\n  sizeVariable.<span>field<\/span> = <span style=\"color: #032f62\">`F<span style=\"color: #24292e\">${year}<\/span>`<\/span>;\r\n  sizeVariable.<span>legendOptions<\/span> = {\r\n    <span style=\"color: #005cc5\">title<\/span>: <span style=\"color: #032f62\">`Visits in <span style=\"color: #24292e\">${year}<\/span>`<\/span>\r\n  };\r\n\r\n  <span style=\"color: #d73a49\">return<\/span> renderer;\r\n}\r\n\r\n<span style=\"color: #d73a49\">function<\/span> <span style=\"color: #6f42c1\">createArcadeExpression<\/span>(<span>{ year }<\/span>) {\r\n  <span style=\"color: #d73a49\">const<\/span> current = year;\r\n  <span style=\"color: #d73a49\">const<\/span> previous = year - <span style=\"color: #005cc5\">1<\/span>;\r\n\r\n  <span style=\"color: #d73a49\">const<\/span> expression = <span style=\"color: #032f62\">`var s = $feature.F<span style=\"color: #24292e\">${previous}<\/span>;\r\n    var e = $feature.F<span style=\"color: #24292e\">${current}<\/span>;\r\n    return ((e - s) \/ s) * 100;`<\/span>;\r\n\r\n  <span style=\"color: #d73a49\">return<\/span> expression;\r\n}\r\n<\/code><\/pre>\n<p>Once the updated renderer is reset on the layer, the view updates with the appropriate symbols. Note how fast and performant these updates take place&#8230;up to 60 frames per second!<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":2629002,"id":2629002,"title":"renderer-labels","filename":"renderer-labels.gif","filesize":1047802,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/renderer-labels.gif","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/developers\/good-better-best-simplify-your-web-app-development-with-map-viewer\/renderer-labels","alt":"","author":"6561","description":"","caption":"","name":"renderer-labels","status":"inherit","uploaded_to":2613782,"date":"2024-12-16 22:51:12","modified":"2024-12-16 22:51:12","menu_order":0,"mime_type":"image\/gif","type":"image","subtype":"gif","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":618,"height":408,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/renderer-labels-213x200.gif","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/renderer-labels.gif","medium-width":395,"medium-height":261,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/renderer-labels.gif","medium_large-width":618,"medium_large-height":408,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/renderer-labels.gif","large-width":618,"large-height":408,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/renderer-labels.gif","1536x1536-width":618,"1536x1536-height":408,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/renderer-labels.gif","2048x2048-width":618,"2048x2048-height":408,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/renderer-labels.gif","card_image-width":618,"card_image-height":408,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/renderer-labels.gif","wide_image-width":618,"wide_image-height":408}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<h4>Labels<\/h4>\n<p>Labels are sized dynamically based on the visits to each park. To accomplish this, <strong>I configured four label classes with various font sizes in Map Viewer.<\/strong> The font size directly corresponds to number of visitors. This is controlled by the where clause of each label class. We simply need to update these where clauses to replace the invalid field name with the field corresponding to the new slider value.<\/p>\n<pre><code><span style=\"color: #d73a49\">function<\/span> <span style=\"color: #6f42c1\">updateLabels<\/span>(<span>{ layer, year }<\/span>) {\r\n  <span style=\"color: #d73a49\">const<\/span> labelingInfo = layer.<span>labelingInfo<\/span>;\r\n  labelingInfo.<span style=\"color: #6f42c1\">forEach<\/span>(<span>(<span>labelClass<\/span>) =&gt;<\/span> {\r\n    labelClass.<span>where<\/span> = labelClass.<span>where<\/span>.<span style=\"color: #6f42c1\">replace<\/span>(<span style=\"color: #032f62\">\/[F][0-9]{4}\/gm<\/span>, <span style=\"color: #032f62\">`F<span style=\"color: #24292e\">${year}<\/span>`<\/span>);\r\n  });\r\n  <span style=\"color: #d73a49\">return<\/span> labelingInfo;\r\n}\r\n<\/code><\/pre>\n<p>You can see the labels properly update in the previous graphic.<\/p>\n"},{"acf_fc_layout":"content","content":"<h4>Popup Template<\/h4>\n<p><strong>I configured the popup template in Map Viewer<\/strong> to display a line chart showing the total number of visits to the selected park from 1905-2023. This content element does not need to be updated as the data remains constant. However, the text element below the chart should update to correspond to the slider value.<\/p>\n<p>The function below gets the popup templates text element and updates the referenced field based on the slider position.<\/p>\n<pre><code><span style=\"color: #d73a49\">function<\/span> <span style=\"color: #6f42c1\">updatePopupTemplate<\/span>(<span>{ layer, year }<\/span>) {\r\n  <span style=\"color: #d73a49\">const<\/span> popupTemplate = layer.<span>popupTemplate<\/span>.<span style=\"color: #6f42c1\">clone<\/span>();\r\n  <span style=\"color: #d73a49\">const<\/span> textElement = popupTemplate.<span>content<\/span>.<span style=\"color: #6f42c1\">find<\/span>(<span>(<span>element<\/span>) =&gt;<\/span> {\r\n    <span style=\"color: #d73a49\">return<\/span> element.<span>type<\/span> === <span style=\"color: #032f62\">&quot;text&quot;<\/span>;\r\n  });\r\n  textElement.<span>text<\/span> = <span style=\"color: #032f62\">`&lt;p&gt;{Park} had &lt;strong&gt;{F<span style=\"color: #24292e\">${year}<\/span>}&lt;\/strong&gt; unique visits in <span style=\"color: #24292e\">${year}<\/span>.&lt;\/p&gt;`<\/span>;\r\n  <span style=\"color: #d73a49\">return<\/span> popupTemplate;\r\n}\r\n<\/code><\/pre>\n"},{"acf_fc_layout":"image","image":{"ID":2628992,"id":2628992,"title":"popup","filename":"popup.gif","filesize":816222,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/popup.gif","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/developers\/good-better-best-simplify-your-web-app-development-with-map-viewer\/popup-35","alt":"","author":"6561","description":"","caption":"","name":"popup-35","status":"inherit","uploaded_to":2613782,"date":"2024-12-16 22:51:10","modified":"2024-12-16 22:51:10","menu_order":0,"mime_type":"image\/gif","type":"image","subtype":"gif","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":618,"height":408,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/popup-213x200.gif","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/popup.gif","medium-width":395,"medium-height":261,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/popup.gif","medium_large-width":618,"medium_large-height":408,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/popup.gif","large-width":618,"large-height":408,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/popup.gif","1536x1536-width":618,"1536x1536-height":408,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/popup.gif","2048x2048-width":618,"2048x2048-height":408,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/popup.gif","card_image-width":618,"card_image-height":408,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/popup.gif","wide_image-width":618,"wide_image-height":408}},"image_position":"center","orientation":"horizontal","hyperlink":"https:\/\/ekenes.github.io\/portal-vs-scratch\/item-with-slider.html"},{"acf_fc_layout":"content","content":"<h2>Conclusion<\/h2>\n<p>Now the app is complete! Check out the <a href=\"https:\/\/ekenes.github.io\/portal-vs-scratch\/item-with-slider.html\">final app here<\/a>. Because I started with Map Viewer and saved the various layer configurations as a web map, I significantly reduced the amount of code I needed to write (<a href=\"https:\/\/github.com\/ekenes\/portal-vs-scratch\/blob\/main\/item-with-slider.html\">only 179 lines<\/a>).<\/p>\n<p>When building an app with the JS Maps SDK, I always suggest striving to write as few lines of code as possible. Creating web maps in Map Viewer saves you a lot of time and makes the map configuration process more enjoyable than punching random numbers in JSON or JavaScript. <\/p>\n<p>Always start with a web map. If you need a little more functionality, then the JS Maps SDK gives you all the APIs and components you need to be successful. In this way, Map Viewer and the JS Maps SDK make a strong foundation upon which you can build powerful and innovative mapping applications.<\/p>\n"}],"authors":[{"ID":6561,"user_firstname":"Kristian","user_lastname":"Ekenes","nickname":"Kristian Ekenes","user_nicename":"kekenes","display_name":"Kristian Ekenes","user_email":"KEkenes@esri.com","user_url":"https:\/\/github.com\/ekenes","user_registered":"2018-03-02 00:18:32","user_description":"Kristian Ekenes is a Principal Product Engineer at Esri specializing in data visualization on the web. He works on the ArcGIS Maps SDK for JavaScript, ArcGIS Arcade, and Map Viewer in ArcGIS Online. Kristian's work focuses on researching and developing new and innovative data visualization capabilities of geospatial data in web maps, Arcade integration in web maps, and applications of generative AI assistants in web maps. Prior to joining Esri, he worked as a GIS Specialist for an environmental consulting company. Kristian has degrees from Brigham Young University and Arizona State University.","user_avatar":"<img data-del=\"avatar\" src='https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/10\/ekenes-zurich-213x200.png' class='avatar pp-user-avatar avatar-96 photo ' height='96' width='96'\/>"}],"related_articles":[{"ID":2613782,"post_author":"6561","post_date":"2024-12-19 12:15:12","post_date_gmt":"2024-12-19 20:15:12","post_content":"","post_title":"Good, better, best\u2014Simplify your web app development with Map Viewer","post_excerpt":"","post_status":"publish","comment_status":"open","ping_status":"closed","post_password":"","post_name":"good-better-best-simplify-your-web-app-development-with-map-viewer","to_ping":"","pinged":"","post_modified":"2024-12-19 13:43:41","post_modified_gmt":"2024-12-19 21:43:41","post_content_filtered":"","post_parent":0,"guid":"https:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=2613782","menu_order":0,"post_type":"blog","post_mime_type":"","comment_count":"0","filter":"raw"}],"show_article_image":false,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/card-1.jpg","wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/banner.jpg"},"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>Web maps\u2014the foundation of ArcGIS web applications<\/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\/developers\/web-maps-the-foundation-of-arcgis-web-applications\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Web maps\u2014the foundation of ArcGIS web applications\" \/>\n<meta property=\"og:description\" content=\"In ArcGIS, the web map should be the foundation of any custom web application. This post shows how to leverage web maps in a custom app.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/developers\/web-maps-the-foundation-of-arcgis-web-applications\" \/>\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=\"2024-12-20T21:19:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.esri.com\/arcgis-blog\/wp-content\/uploads\/2024\/12\/card-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"826\" \/>\n\t<meta property=\"og:image:height\" content=\"465\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@ESRI\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"7 minutes\" \/>\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\/developers\/web-maps-the-foundation-of-arcgis-web-applications#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/developers\/web-maps-the-foundation-of-arcgis-web-applications\"},\"author\":{\"name\":\"Kristian Ekenes\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/5469f723fbfb78138efbb1da56e6aa9b\"},\"headline\":\"Web maps\u2014the foundation of ArcGIS web applications\",\"datePublished\":\"2024-12-20T21:12:52+00:00\",\"dateModified\":\"2024-12-20T21:19:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/developers\/web-maps-the-foundation-of-arcgis-web-applications\"},\"wordCount\":8,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\"},\"keywords\":[\"Map Viewer\",\"portal\"],\"articleSection\":[\"Developers\",\"Mapping\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/developers\/web-maps-the-foundation-of-arcgis-web-applications#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/developers\/web-maps-the-foundation-of-arcgis-web-applications\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/developers\/web-maps-the-foundation-of-arcgis-web-applications\",\"name\":\"Web maps\u2014the foundation of ArcGIS web applications\",\"isPartOf\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#website\"},\"datePublished\":\"2024-12-20T21:12:52+00:00\",\"dateModified\":\"2024-12-20T21:19:21+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/developers\/web-maps-the-foundation-of-arcgis-web-applications#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/developers\/web-maps-the-foundation-of-arcgis-web-applications\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/developers\/web-maps-the-foundation-of-arcgis-web-applications#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.esri.com\/arcgis-blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Web maps\u2014the foundation of ArcGIS web applications\"}]},{\"@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\/5469f723fbfb78138efbb1da56e6aa9b\",\"name\":\"Kristian Ekenes\",\"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\/2021\/10\/ekenes-zurich-213x200.png\",\"contentUrl\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/10\/ekenes-zurich-213x200.png\",\"caption\":\"Kristian Ekenes\"},\"description\":\"Kristian Ekenes is a Principal Product Engineer at Esri specializing in data visualization on the web. He works on the ArcGIS Maps SDK for JavaScript, ArcGIS Arcade, and Map Viewer in ArcGIS Online. Kristian's work focuses on researching and developing new and innovative data visualization capabilities of geospatial data in web maps, Arcade integration in web maps, and applications of generative AI assistants in web maps. Prior to joining Esri, he worked as a GIS Specialist for an environmental consulting company. Kristian has degrees from Brigham Young University and Arizona State University.\",\"sameAs\":[\"https:\/\/github.com\/ekenes\",\"https:\/\/www.linkedin.com\/in\/kristian-ekenes\/\",\"https:\/\/x.com\/kekenes\"],\"gender\":\"male\",\"jobTitle\":\"Principal Product Engineer\",\"worksFor\":\"Esri\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/author\/kekenes\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Web maps\u2014the foundation of ArcGIS web applications","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\/developers\/web-maps-the-foundation-of-arcgis-web-applications","og_locale":"en_US","og_type":"article","og_title":"Web maps\u2014the foundation of ArcGIS web applications","og_description":"In ArcGIS, the web map should be the foundation of any custom web application. This post shows how to leverage web maps in a custom app.","og_url":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/developers\/web-maps-the-foundation-of-arcgis-web-applications","og_site_name":"ArcGIS Blog","article_publisher":"https:\/\/www.facebook.com\/esrigis\/","article_modified_time":"2024-12-20T21:19:21+00:00","og_image":[{"width":826,"height":465,"url":"https:\/\/www.esri.com\/arcgis-blog\/wp-content\/uploads\/2024\/12\/card-1.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_site":"@ESRI","twitter_misc":{"Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/developers\/web-maps-the-foundation-of-arcgis-web-applications#article","isPartOf":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/developers\/web-maps-the-foundation-of-arcgis-web-applications"},"author":{"name":"Kristian Ekenes","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/5469f723fbfb78138efbb1da56e6aa9b"},"headline":"Web maps\u2014the foundation of ArcGIS web applications","datePublished":"2024-12-20T21:12:52+00:00","dateModified":"2024-12-20T21:19:21+00:00","mainEntityOfPage":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/developers\/web-maps-the-foundation-of-arcgis-web-applications"},"wordCount":8,"commentCount":0,"publisher":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization"},"keywords":["Map Viewer","portal"],"articleSection":["Developers","Mapping"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/developers\/web-maps-the-foundation-of-arcgis-web-applications#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/developers\/web-maps-the-foundation-of-arcgis-web-applications","url":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/developers\/web-maps-the-foundation-of-arcgis-web-applications","name":"Web maps\u2014the foundation of ArcGIS web applications","isPartOf":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#website"},"datePublished":"2024-12-20T21:12:52+00:00","dateModified":"2024-12-20T21:19:21+00:00","breadcrumb":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/developers\/web-maps-the-foundation-of-arcgis-web-applications#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/developers\/web-maps-the-foundation-of-arcgis-web-applications"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/developers\/web-maps-the-foundation-of-arcgis-web-applications#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.esri.com\/arcgis-blog\/"},{"@type":"ListItem","position":2,"name":"Web maps\u2014the foundation of ArcGIS web applications"}]},{"@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\/5469f723fbfb78138efbb1da56e6aa9b","name":"Kristian Ekenes","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\/2021\/10\/ekenes-zurich-213x200.png","contentUrl":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/10\/ekenes-zurich-213x200.png","caption":"Kristian Ekenes"},"description":"Kristian Ekenes is a Principal Product Engineer at Esri specializing in data visualization on the web. He works on the ArcGIS Maps SDK for JavaScript, ArcGIS Arcade, and Map Viewer in ArcGIS Online. Kristian's work focuses on researching and developing new and innovative data visualization capabilities of geospatial data in web maps, Arcade integration in web maps, and applications of generative AI assistants in web maps. Prior to joining Esri, he worked as a GIS Specialist for an environmental consulting company. Kristian has degrees from Brigham Young University and Arizona State University.","sameAs":["https:\/\/github.com\/ekenes","https:\/\/www.linkedin.com\/in\/kristian-ekenes\/","https:\/\/x.com\/kekenes"],"gender":"male","jobTitle":"Principal Product Engineer","worksFor":"Esri","url":"https:\/\/www.esri.com\/arcgis-blog\/author\/kekenes"}]}},"text_date":"December 20, 2024","author_name":"Kristian Ekenes","author_page":"https:\/\/www.esri.com\/arcgis-blog\/author\/kekenes","custom_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/12\/banner.jpg","primary_product":"ArcGIS Maps SDK for JavaScript","tag_data":[{"term_id":33371,"name":"Map Viewer","slug":"map-viewer","term_group":0,"term_taxonomy_id":33371,"taxonomy":"post_tag","description":"","parent":0,"count":154,"filter":"raw"},{"term_id":25971,"name":"portal","slug":"portal","term_group":0,"term_taxonomy_id":25971,"taxonomy":"post_tag","description":"","parent":0,"count":15,"filter":"raw"}],"category_data":[{"term_id":738191,"name":"Developers","slug":"developers","term_group":0,"term_taxonomy_id":738191,"taxonomy":"category","description":"","parent":0,"count":420,"filter":"raw"},{"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":36551,"name":"ArcGIS Online","slug":"arcgis-online","term_group":0,"term_taxonomy_id":36551,"taxonomy":"product","description":"","parent":0,"count":2419,"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\/2634792","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\/6561"}],"replies":[{"embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/comments?post=2634792"}],"version-history":[{"count":0,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog\/2634792\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/media?parent=2634792"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/categories?post=2634792"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/tags?post=2634792"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/industry?post=2634792"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/product?post=2634792"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}