<?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 Re: Select by URL Parameters - zoom to point? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/select-by-url-parameters-zoom-to-point/m-p/336004#M31048</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tried-&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function showResults(featureSet)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//Zoom to the extent of the graphics&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;query.where = "";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var centerPoint = evt.mapPoint;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var mapWidth = theMap.extent.getWidth();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var pixelWidth = mapWidth/theMap.width;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Calculate a 10 pixel envelope width (5 pixel tolerance on each side)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var tolerance = 5 * pixelWidth;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var queryExtent = new esri.geometry.Extent(centerPoint.x -tolerance, centerPoint.y -tolerance, centerPoint.x +tolerance, centerPoint.y +tolerance, theMap.spatialReference);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.geometry = queryExtent;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var ResultEnv = query.geometry.getExtent().expand(10.0);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;theMap.setExtent(ResultEnv);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but I get an error: ReferenceError: evt is not defined&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Mar 2012 19:25:42 GMT</pubDate>
    <dc:creator>LizDaRos</dc:creator>
    <dc:date>2012-03-02T19:25:42Z</dc:date>
    <item>
      <title>Select by URL Parameters - zoom to point?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/select-by-url-parameters-zoom-to-point/m-p/336000#M31044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to use the code sample &lt;/SPAN&gt;&lt;A href="http://www.arcgis.com/home/item.html?id=92ff586d7e934fde9ee62356592f8761"&gt;here&lt;/A&gt;&lt;SPAN&gt; to use URL parameters to select one or more POINT features and zoom the map to those features. I have configured it using one of my polygon features and it works but I'm trying to use it for a point feature.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When I try passing this URL parameter the symbol appears around the point but the map does not zoom in or display the points information. Also I get this error- TypeError: query.geometry is null&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone know what I need to add to my code to allow this to work properly? I've tried a few different ways but not having much luck.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 17:29:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/select-by-url-parameters-zoom-to-point/m-p/336000#M31044</guid>
      <dc:creator>LizDaRos</dc:creator>
      <dc:date>2012-02-29T17:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: Select by URL Parameters - zoom to point?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/select-by-url-parameters-zoom-to-point/m-p/336001#M31045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I'm trying to use the code sample &lt;A href="http://www.arcgis.com/home/item.html?id=92ff586d7e934fde9ee62356592f8761" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt; to use URL parameters to select one or more POINT features and zoom the map to those features. I have configured it using one of my polygon features and it works but I'm trying to use it for a point feature.&lt;BR /&gt;When I try passing this URL parameter the symbol appears around the point but the map does not zoom in or display the points information. Also I get this error- TypeError: query.geometry is null&lt;BR /&gt;Does anyone know what I need to add to my code to allow this to work properly? I've tried a few different ways but not having much luck.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;From the error message, I think the problem lies in the queryExtent in your executeQueryTask(evt) function. Try this to see if it works:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
function executeQueryTask(evt)
{

&amp;nbsp;&amp;nbsp;&amp;nbsp; query.where = "";
&amp;nbsp;&amp;nbsp;&amp;nbsp; var centerPoint = evt.mapPoint;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var mapWidth = theMap.extent.getWidth();
&amp;nbsp;&amp;nbsp;&amp;nbsp; var pixelWidth = mapWidth/theMap.width;
&amp;nbsp;&amp;nbsp;&amp;nbsp; //Calculate a 10 pixel envelope width (5 pixel tolerance on each side)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var tolerance = 5 * pixelWidth;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var queryExtent = new esri.geometry.Extent(centerPoint.x -tolerance, centerPoint.y -tolerance, centerPoint.x +tolerance, centerPoint.y +tolerance, theMap.spatialReference);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.geometry = queryExtent;

&amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask.execute(query, showResults);
}

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:55:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/select-by-url-parameters-zoom-to-point/m-p/336001#M31045</guid>
      <dc:creator>HemingZhu</dc:creator>
      <dc:date>2021-12-11T15:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: Select by URL Parameters - zoom to point?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/select-by-url-parameters-zoom-to-point/m-p/336002#M31046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for taking a look at it, unfortunately I still get the same error. Could the issue also be in- &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var ResultEnv = query.geometry.getExtent().expand(10.0);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;??&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2012 17:27:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/select-by-url-parameters-zoom-to-point/m-p/336002#M31046</guid>
      <dc:creator>LizDaRos</dc:creator>
      <dc:date>2012-03-02T17:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: Select by URL Parameters - zoom to point?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/select-by-url-parameters-zoom-to-point/m-p/336003#M31047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thanks for taking a look at it, unfortunately I still get the same error. Could the issue also be in- &lt;BR /&gt;var ResultEnv = query.geometry.getExtent().expand(10.0);&lt;BR /&gt;&lt;BR /&gt;??&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, you need to change make similiar changes on you showResults function.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2012 18:02:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/select-by-url-parameters-zoom-to-point/m-p/336003#M31047</guid>
      <dc:creator>HemingZhu</dc:creator>
      <dc:date>2012-03-02T18:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: Select by URL Parameters - zoom to point?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/select-by-url-parameters-zoom-to-point/m-p/336004#M31048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tried-&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function showResults(featureSet)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//Zoom to the extent of the graphics&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;query.where = "";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var centerPoint = evt.mapPoint;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var mapWidth = theMap.extent.getWidth();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var pixelWidth = mapWidth/theMap.width;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Calculate a 10 pixel envelope width (5 pixel tolerance on each side)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var tolerance = 5 * pixelWidth;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var queryExtent = new esri.geometry.Extent(centerPoint.x -tolerance, centerPoint.y -tolerance, centerPoint.x +tolerance, centerPoint.y +tolerance, theMap.spatialReference);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.geometry = queryExtent;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var ResultEnv = query.geometry.getExtent().expand(10.0);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;theMap.setExtent(ResultEnv);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but I get an error: ReferenceError: evt is not defined&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2012 19:25:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/select-by-url-parameters-zoom-to-point/m-p/336004#M31048</guid>
      <dc:creator>LizDaRos</dc:creator>
      <dc:date>2012-03-02T19:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: Select by URL Parameters - zoom to point?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/select-by-url-parameters-zoom-to-point/m-p/336005#M31049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I tried-&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function showResults(featureSet)&lt;BR /&gt;&lt;BR /&gt;//Zoom to the extent of the graphics&lt;BR /&gt;query.where = "";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var centerPoint = evt.mapPoint;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var mapWidth = theMap.extent.getWidth();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var pixelWidth = mapWidth/theMap.width;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Calculate a 10 pixel envelope width (5 pixel tolerance on each side)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var tolerance = 5 * pixelWidth;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var queryExtent = new esri.geometry.Extent(centerPoint.x -tolerance, centerPoint.y -tolerance, centerPoint.x +tolerance, centerPoint.y +tolerance, theMap.spatialReference);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.geometry = queryExtent;&lt;BR /&gt;var ResultEnv = query.geometry.getExtent().expand(10.0);&lt;BR /&gt;theMap.setExtent(ResultEnv);&lt;BR /&gt;&lt;BR /&gt;but I get an error: ReferenceError: evt is not defined&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You will have to use the featureSet's extent not evt. Like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; 
var ResultEnv =esri.graphicsExtent(featureSet.features);
theMap.setExtent(ResultEnv);
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:55:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/select-by-url-parameters-zoom-to-point/m-p/336005#M31049</guid>
      <dc:creator>HemingZhu</dc:creator>
      <dc:date>2021-12-11T15:55:14Z</dc:date>
    </item>
  </channel>
</rss>

