I am new to Javascript and working with the ArcGIS for Javascript API. I recently completed an abbreviated version of the Developing Web Apps with ArcGIS, API for Javascript course and I am going back through the lesson for review. I am trying to set the initial extent in a lesson and it is not working. I don't know what I am doing wrong. Any help would be greatly appreciated.
Thanks in advance.
Ed Dean
// Create the map mapMain = new Map("cpCenter", { basemap: "satellite", extent: "extentInitial" });
you are passing the variable as string. you need it as below
// Create the map mapMain = new Map("cpCenter", { basemap: "satellite", extent: extentInitial });
Thank you very much! This worked
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.