<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Why does map.on 'extent-change' fire when the the map first loads? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-does-map-on-extent-change-fire-when-the-the/m-p/52883#M4666</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to create a unique url string based on the map zoom level and center coordinate.&amp;nbsp; This is easy enough until, in some cases, I must remove part of the url before doing so.&amp;nbsp; I thought that using a combination of window.onload to remove part of the initial url and using map.on("extent-change", ...) to create the new url would work great, until I found out that extent-change will fire be window.onload finishes.&amp;nbsp; I am a little new at javascript (approx. 1 year in, mostly self-taught) and was wondering if anyone knew of a work around of sorts or another way to accomplish this.&amp;nbsp; Maybe some kind of deferred.&amp;nbsp; Here is a bit of code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14127931185019068" jivemacro_uid="_14127931185019068"&gt;
&lt;P&gt;//get the variables of areaID (hunt area, IOG area, or Access Yes! area), layerID (which layer to apply the ID query to), and label (what will appear in the legend).&amp;nbsp; Get the zoom and map center coordinate variables.&lt;/P&gt;
&lt;P&gt;var layerID, urlZoom, urlX, urlY, homeURL, zoomLevel, centerpoint, cX, cY, newURL, extentI, extentC;&lt;/P&gt;
&lt;P&gt;window.onload = function(){&lt;/P&gt;
&lt;P&gt;&amp;nbsp; layerID = getVariableByName('lyr');&lt;/P&gt;
&lt;P&gt;&amp;nbsp; urlZoom = getVariableByName('zoom');&lt;/P&gt;
&lt;P&gt;&amp;nbsp; urlX = getVariableByName('X');&lt;/P&gt;
&lt;P&gt;&amp;nbsp; urlY = getVariableByName('Y');&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if (typeof areaID != 'undefined'){&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; doQuery(layerID);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if (typeof urlZoom != 'undefined'){&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var point = new Point(urlX, urlY, new SpatialReference({ wkid: 4326}));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.setLevel(urlZoom);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.centerAt(point);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; //Get the url.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; homeURL = window.location.href;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; zoomLevel = map.getZoom();&lt;/P&gt;
&lt;P&gt;&amp;nbsp; centerpoint = webMercatorUtils.webMercatorToGeographic(map.extent.getCenter());&lt;/P&gt;
&lt;P&gt;&amp;nbsp; cX = parseFloat(centerpoint.x.toFixed(3));&lt;/P&gt;
&lt;P&gt;&amp;nbsp; cY = parseFloat(centerpoint.y.toFixed(3));&lt;/P&gt;
&lt;P&gt;&amp;nbsp; newURL ="?zoom=" + zoomLevel + "&amp;amp;X=" + cX + "&amp;amp;Y=" + cY;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; //If the url contains an lyr parameter, remove part of url from ? to end.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if (window.location.href.indexOf("lyr") &amp;gt; 0){&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $("#viewURL").append(homeURL);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.history.pushState(null,null,window.location.href.slice(0,(window.location.href).indexOf('?')));&lt;/P&gt;
&lt;P&gt;&amp;nbsp; //If url has no lyr parameter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; } else {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $("#viewURL").empty();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; homeURL = window.location.href;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $("#viewURL").append(homeURL + newURL);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; //Create variable for load extent.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; extentI = map.extent;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; var I = "";&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I = "ExtentI:&amp;nbsp; XMin: " + extentI.xmin + "YMin: " + extentI.ymin + "XMax: " + extentI.xmax + "YMax: " + extentI.ymax;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//On extent change, change the url zoom and coordinate parameters.&lt;/P&gt;
&lt;P&gt;map.on("extent-change", function(){&lt;/P&gt;
&lt;P&gt;&amp;nbsp; extentC = map.extent;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; var C = "";&lt;/P&gt;
&lt;P&gt;&amp;nbsp; C = "ExtentC:&amp;nbsp; XMin: " + extentC.xmin + "YMin: " + extentC.ymin + "XMax: " + extentC.xmax + "YMax: " + extentC.ymax;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if (extentI == extentC){&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("Extent hasn't changed");&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if (extentI != extentC){&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $("#viewURL").empty();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; homeURL = window.location.href;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; zoomLevel = map.getZoom();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; centerpoint = webMercatorUtils.webMercatorToGeographic(map.extent.getCenter());&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cX = parseFloat(centerpoint.x.toFixed(3));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cY = parseFloat(centerpoint.y.toFixed(3));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; newURL ="?zoom=" + zoomLevel + "&amp;amp;X=" + cX + "&amp;amp;Y=" + cY;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $("#viewURL").append(homeURL + newURL);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;});&lt;/P&gt;

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Oct 2014 18:39:56 GMT</pubDate>
    <dc:creator>PamelaBond</dc:creator>
    <dc:date>2014-10-08T18:39:56Z</dc:date>
    <item>
      <title>Why does map.on 'extent-change' fire when the the map first loads?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-does-map-on-extent-change-fire-when-the-the/m-p/52883#M4666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to create a unique url string based on the map zoom level and center coordinate.&amp;nbsp; This is easy enough until, in some cases, I must remove part of the url before doing so.&amp;nbsp; I thought that using a combination of window.onload to remove part of the initial url and using map.on("extent-change", ...) to create the new url would work great, until I found out that extent-change will fire be window.onload finishes.&amp;nbsp; I am a little new at javascript (approx. 1 year in, mostly self-taught) and was wondering if anyone knew of a work around of sorts or another way to accomplish this.&amp;nbsp; Maybe some kind of deferred.&amp;nbsp; Here is a bit of code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14127931185019068" jivemacro_uid="_14127931185019068"&gt;
&lt;P&gt;//get the variables of areaID (hunt area, IOG area, or Access Yes! area), layerID (which layer to apply the ID query to), and label (what will appear in the legend).&amp;nbsp; Get the zoom and map center coordinate variables.&lt;/P&gt;
&lt;P&gt;var layerID, urlZoom, urlX, urlY, homeURL, zoomLevel, centerpoint, cX, cY, newURL, extentI, extentC;&lt;/P&gt;
&lt;P&gt;window.onload = function(){&lt;/P&gt;
&lt;P&gt;&amp;nbsp; layerID = getVariableByName('lyr');&lt;/P&gt;
&lt;P&gt;&amp;nbsp; urlZoom = getVariableByName('zoom');&lt;/P&gt;
&lt;P&gt;&amp;nbsp; urlX = getVariableByName('X');&lt;/P&gt;
&lt;P&gt;&amp;nbsp; urlY = getVariableByName('Y');&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if (typeof areaID != 'undefined'){&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; doQuery(layerID);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if (typeof urlZoom != 'undefined'){&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var point = new Point(urlX, urlY, new SpatialReference({ wkid: 4326}));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.setLevel(urlZoom);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.centerAt(point);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; //Get the url.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; homeURL = window.location.href;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; zoomLevel = map.getZoom();&lt;/P&gt;
&lt;P&gt;&amp;nbsp; centerpoint = webMercatorUtils.webMercatorToGeographic(map.extent.getCenter());&lt;/P&gt;
&lt;P&gt;&amp;nbsp; cX = parseFloat(centerpoint.x.toFixed(3));&lt;/P&gt;
&lt;P&gt;&amp;nbsp; cY = parseFloat(centerpoint.y.toFixed(3));&lt;/P&gt;
&lt;P&gt;&amp;nbsp; newURL ="?zoom=" + zoomLevel + "&amp;amp;X=" + cX + "&amp;amp;Y=" + cY;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; //If the url contains an lyr parameter, remove part of url from ? to end.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if (window.location.href.indexOf("lyr") &amp;gt; 0){&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $("#viewURL").append(homeURL);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.history.pushState(null,null,window.location.href.slice(0,(window.location.href).indexOf('?')));&lt;/P&gt;
&lt;P&gt;&amp;nbsp; //If url has no lyr parameter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; } else {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $("#viewURL").empty();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; homeURL = window.location.href;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $("#viewURL").append(homeURL + newURL);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; //Create variable for load extent.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; extentI = map.extent;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; var I = "";&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I = "ExtentI:&amp;nbsp; XMin: " + extentI.xmin + "YMin: " + extentI.ymin + "XMax: " + extentI.xmax + "YMax: " + extentI.ymax;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//On extent change, change the url zoom and coordinate parameters.&lt;/P&gt;
&lt;P&gt;map.on("extent-change", function(){&lt;/P&gt;
&lt;P&gt;&amp;nbsp; extentC = map.extent;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; var C = "";&lt;/P&gt;
&lt;P&gt;&amp;nbsp; C = "ExtentC:&amp;nbsp; XMin: " + extentC.xmin + "YMin: " + extentC.ymin + "XMax: " + extentC.xmax + "YMax: " + extentC.ymax;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if (extentI == extentC){&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("Extent hasn't changed");&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if (extentI != extentC){&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $("#viewURL").empty();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; homeURL = window.location.href;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; zoomLevel = map.getZoom();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; centerpoint = webMercatorUtils.webMercatorToGeographic(map.extent.getCenter());&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cX = parseFloat(centerpoint.x.toFixed(3));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cY = parseFloat(centerpoint.y.toFixed(3));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; newURL ="?zoom=" + zoomLevel + "&amp;amp;X=" + cX + "&amp;amp;Y=" + cY;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $("#viewURL").append(homeURL + newURL);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;});&lt;/P&gt;

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2014 18:39:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-does-map-on-extent-change-fire-when-the-the/m-p/52883#M4666</guid>
      <dc:creator>PamelaBond</dc:creator>
      <dc:date>2014-10-08T18:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: Why does map.on 'extent-change' fire when the the map first loads?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-does-map-on-extent-change-fire-when-the-the/m-p/52884#M4667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would try using a boolean variable in order to avoid running your code during that initial map extent change that occurs. So, something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_1412889772068290" jivemacro_uid="_1412889772068290"&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&lt;SPAN class="comment" style="font-weight: inherit; font-style: inherit; color: #008200; font-size: 9pt !important; background-color: inherit;"&gt;//get the variables of areaID (hunt area, IOG area, or Access Yes! area), layerID (which layer to apply the ID query to), and label (what will appear in the legend).&amp;nbsp; Get the zoom and map center coordinate variables.&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; layerID, urlZoom, urlX, urlY, homeURL, zoomLevel, centerpoint, cX, cY, newURL, extentI, extentC;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: black; font-size: 9pt !important; font-style: inherit; background-color: inherit; font-weight: inherit;"&gt;var initLoad = true;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;window.onload = &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;function&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;(){&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; layerID = getVariableByName(&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;'lyr'&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;);&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; urlZoom = getVariableByName(&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;'zoom'&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;);&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; urlX = getVariableByName(&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;'X'&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;);&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; urlY = getVariableByName(&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;'Y'&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;);&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; (&lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;typeof&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; areaID != &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;'undefined'&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;){&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; doQuery(layerID);&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; }&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; (&lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;typeof&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; urlZoom != &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;'undefined'&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;){&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; point = &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; Point(urlX, urlY, &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; SpatialReference({ wkid: &lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important; background-color: inherit;"&gt;4326&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;}));&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.setLevel(urlZoom);&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.centerAt(point);&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; }&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;SPAN class="comment" style="font-weight: inherit; font-style: inherit; color: #008200; font-size: 9pt !important; background-color: inherit;"&gt;//Get the url.&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; homeURL = window.location.href;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; zoomLevel = map.getZoom();&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; centerpoint = webMercatorUtils.webMercatorToGeographic(map.extent.getCenter());&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; cX = parseFloat(centerpoint.x.toFixed(&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important; background-color: inherit;"&gt;3&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;));&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; cY = parseFloat(centerpoint.y.toFixed(&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important; background-color: inherit;"&gt;3&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;));&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; newURL =&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"?zoom="&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; + zoomLevel + &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"&amp;amp;X="&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; + cX + &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"&amp;amp;Y="&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; + cY;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;SPAN class="comment" style="font-weight: inherit; font-style: inherit; color: #008200; font-size: 9pt !important; background-color: inherit;"&gt;//If the url contains an lyr parameter, remove part of url from ? to end.&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; (window.location.href.indexOf(&lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"lyr"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;) &amp;gt; &lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important; background-color: inherit;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;){&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"#viewURL"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;).append(homeURL);&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.history.pushState(&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;null&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;null&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;,window.location.href.slice(&lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important; background-color: inherit;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;,(window.location.href).indexOf(&lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;'?'&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;)));&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;SPAN class="comment" style="font-weight: inherit; font-style: inherit; color: #008200; font-size: 9pt !important; background-color: inherit;"&gt;//If url has no lyr parameter.&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; } &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; {&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"#viewURL"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;).empty();&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; homeURL = window.location.href;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"#viewURL"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;).append(homeURL + newURL);&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; }&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;SPAN class="comment" style="font-weight: inherit; font-style: inherit; color: #008200; font-size: 9pt !important; background-color: inherit;"&gt;//Create variable for load extent.&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; extentI = map.extent;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; I = &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;""&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; I = &lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"ExtentI:&amp;nbsp; XMin: "&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; + extentI.xmin + &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"YMin: "&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; + extentI.ymin + &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"XMax: "&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; + extentI.xmax + &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"YMax: "&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; + extentI.ymax;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;}&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&lt;SPAN class="comment" style="font-weight: inherit; font-style: inherit; color: #008200; font-size: 9pt !important; background-color: inherit;"&gt;//On extent change, change the url zoom and coordinate parameters.&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;map.on(&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"extent-change"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;, &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;function&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;(){&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: black; font-size: 9pt !important; font-style: inherit; background-color: inherit; font-weight: inherit;"&gt;&amp;nbsp; if(initLoad) {&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: black; font-size: 9pt !important; font-style: inherit; background-color: inherit; font-weight: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //this is the initial map extent change at page load&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: black; font-size: 9pt !important; font-style: inherit; background-color: inherit; font-weight: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; initLoad = false;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: black; font-size: 9pt !important; font-style: inherit; background-color: inherit; font-weight: inherit;"&gt;&amp;nbsp; } else { &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; extentC = map.extent;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; C = &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;""&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C = &lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"ExtentC:&amp;nbsp; XMin: "&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; + extentC.xmin + &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"YMin: "&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; + extentC.ymin + &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"XMax: "&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; + extentC.xmax + &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"YMax: "&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; + extentC.ymax;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; (extentI == extentC){&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"Extent hasn't changed"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;);&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; (extentI != extentC){&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"#viewURL"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;).empty();&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; homeURL = window.location.href;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zoomLevel = map.getZoom();&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; centerpoint = webMercatorUtils.webMercatorToGeographic(map.extent.getCenter());&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cX = parseFloat(centerpoint.x.toFixed(&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important; background-color: inherit;"&gt;3&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;));&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cY = parseFloat(centerpoint.y.toFixed(&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important; background-color: inherit;"&gt;3&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;));&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newURL =&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"?zoom="&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; + zoomLevel + &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"&amp;amp;X="&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; + cX + &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"&amp;amp;Y="&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; + cY;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"#viewURL"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;).append(homeURL + newURL);&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; } &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;});&lt;/SPAN&gt;&lt;/P&gt;


&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 21:23:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-does-map-on-extent-change-fire-when-the-the/m-p/52884#M4667</guid>
      <dc:creator>SteveCole</dc:creator>
      <dc:date>2014-10-09T21:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: Why does map.on 'extent-change' fire when the the map first loads?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-does-map-on-extent-change-fire-when-the-the/m-p/52885#M4668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply Steve.&amp;nbsp; If I run your code as is, none of my initLoad (in my case window.load) code runs.&amp;nbsp; I am not sure how this helps me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 18:46:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-does-map-on-extent-change-fire-when-the-the/m-p/52885#M4668</guid>
      <dc:creator>PamelaBond</dc:creator>
      <dc:date>2014-10-17T18:46:38Z</dc:date>
    </item>
  </channel>
</rss>

