<?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: Zoom To Polygon and Selected Point Outside Polygon in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-polygon-and-selected-point-outside-polygon/m-p/354388#M32818</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Since you can see what I am attempting, the next question is, how to modify my code. I have no problem with using the city boundary as a graphic. It serves no purpose besides display.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my code. I have quite a few comments, so hopefully it will answer any questions about how it works. Limited comments are when I am using an ESRI example; which did not really explain what was being done; this is just to explain gaps in my documentation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have the code for the entire app at: &lt;/SPAN&gt;&lt;A href="http://dl.dropbox.com/u/26169505/CityHireEligibleSample.zip" rel="nofollow noopener noreferrer" target="_blank"&gt;http://dl.dropbox.com/u/26169505/CityHireEligibleSample.zip&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;It's 3.94mb ESRI's limit is 2.0mb It's a public URL, so you do not need to have a dropbox account. I will remove this file when you download it or tomorrow.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your feedback. I will attempt to modify my code, but if you see what I need to do, that would be great too.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Chris&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Chris,&lt;BR /&gt;&lt;BR /&gt;Thanks for posting the video, very helpful.&lt;BR /&gt;&lt;BR /&gt;If I have this right, your city boundary is a dynamic map service layer? I was thinking it was a graphic on your map and not an overlay. Any chance you're willing to move to using your city boundary as a graphic instead of a dynamic map service layer?&lt;BR /&gt;&lt;BR /&gt;To answer your question about the union method I mentioned, you need two &lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/extent.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;extent&lt;/A&gt; geometries so you would need to create an extent from your point. Here's one method:&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
// point objects don't have an extent so&amp;nbsp; you need to
// calculate a small value to use as padding for your point
var px = (map.extent.xmax - map.extent.xmin) / map.width
// then create an extent
var ptExtent = new esri.geometry.Extent(
&amp;nbsp; pt.x - px, // xmin
&amp;nbsp; pt.y - px, // ymin
&amp;nbsp; pt.x + px, // xmax
&amp;nbsp; pt.y + px,&amp;nbsp; //ymax
&amp;nbsp; map.spatialReference
);
// union the two extents
// cityExtent would be the result of
// cityGraphic.getExtent()
var newExtent = ptExtent.union(cityExtent);
map.setExtent(newExtent);
&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 16:37:12 GMT</pubDate>
    <dc:creator>ChrisSergent</dc:creator>
    <dc:date>2021-12-11T16:37:12Z</dc:date>
    <item>
      <title>Zoom To Polygon and Selected Point Outside Polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-polygon-and-selected-point-outside-polygon/m-p/354382#M32812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I want my application to zoom to the extent of our city corporate boundaries and if an address point is outside of the city corporate boundary, I want to zoom to the extent where the city corporate boundary and the address point are visible.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have been able to get a envelope for the point, so what would the syntax be if I am correct to set the extent of the envelope of the city corporate boundary polygon and the created envelope from my address point combined?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is our external web service for our corporate boundary:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://maps.decaturil.gov/ArcGIS/rest/services/InternetVector/MapServer/39"&gt;http://maps.decaturil.gov/ArcGIS/rest/services/InternetVector/MapServer/39&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If there is a point outside of that polygon, how do I include it and zoom to both?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Still trying to figure out how I should ask this question, so please ask for clarity if needed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;chris&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2011 19:50:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-polygon-and-selected-point-outside-polygon/m-p/354382#M32812</guid>
      <dc:creator>ChrisSergent</dc:creator>
      <dc:date>2011-05-23T19:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom To Polygon and Selected Point Outside Polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-polygon-and-selected-point-outside-polygon/m-p/354383#M32813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It seems that you would want a function that creates a custom envelope. The input would be the envelope for the point and inside the function it would compare each value of the part of the envelope (xmin, ymin, etc.) with that of the city boundary and assign the more extreme value to the new envelope. This way the smallest value for a min and largest value of max will be used to expand the envelope when the point is outside the city boundary.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2011 20:17:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-polygon-and-selected-point-outside-polygon/m-p/354383#M32813</guid>
      <dc:creator>TonyContreras</dc:creator>
      <dc:date>2011-05-23T20:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom To Polygon and Selected Point Outside Polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-polygon-and-selected-point-outside-polygon/m-p/354384#M32814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is your city boundary geometry sent to the client? If so, you can do the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-create an esri.geometry.Polygon from your city boundary&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-use &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/polygon.htm#contains"&gt;polygon.contains()&lt;/A&gt;&lt;SPAN&gt; to test if your point is in your city boundary&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-if the point is in your polygon, set the map extent to the city boundary's extent&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-if the point is not in your polygon, create an extent from your point&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/extent.htm#union"&gt;union&lt;/A&gt;&lt;SPAN&gt; your point extent with the extent of your city boundary&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-set the map's extent to the unioned extent&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2011 21:00:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-polygon-and-selected-point-outside-polygon/m-p/354384#M32814</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2011-05-23T21:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom To Polygon and Selected Point Outside Polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-polygon-and-selected-point-outside-polygon/m-p/354385#M32815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have one final issue. The polygon that is the city boundaries is disappearing when I zoom to the new envelope.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is what my application is doing right now. Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;VIDEO src="http://youtu.be/Hx4h4dlBEjk?hd=1"&gt;&lt;/VIDEO&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;It seems that you would want a function that creates a custom envelope. The input would be the envelope for the point and inside the function it would compare each value of the part of the envelope (xmin, ymin, etc.) with that of the city boundary and assign the more extreme value to the new envelope. This way the smallest value for a min and largest value of max will be used to expand the envelope when the point is outside the city boundary.&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2011 18:58:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-polygon-and-selected-point-outside-polygon/m-p/354385#M32815</guid>
      <dc:creator>ChrisSergent</dc:creator>
      <dc:date>2011-05-25T18:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom To Polygon and Selected Point Outside Polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-polygon-and-selected-point-outside-polygon/m-p/354386#M32816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Derek,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I do think Union is what I should have done, but I am not sure how to apply it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is what I did, but I am still trying to figure out why the city boundary disappears on zooming in.&lt;/SPAN&gt;&lt;BR /&gt;&lt;VIDEO src="http://youtu.be/Hx4h4dlBEjk?hd=1"&gt;&lt;/VIDEO&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Is your city boundary geometry sent to the client? If so, you can do the following:&lt;BR /&gt;-create an esri.geometry.Polygon from your city boundary&lt;BR /&gt;-use &lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/polygon.htm#contains"&gt;polygon.contains()&lt;/A&gt; to test if your point is in your city boundary&lt;BR /&gt;-if the point is in your polygon, set the map extent to the city boundary's extent&lt;BR /&gt;-if the point is not in your polygon, create an extent from your point&lt;BR /&gt;-&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/extent.htm#union"&gt;union&lt;/A&gt; your point extent with the extent of your city boundary&lt;BR /&gt;-set the map's extent to the unioned extent&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2011 19:03:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-polygon-and-selected-point-outside-polygon/m-p/354386#M32816</guid>
      <dc:creator>ChrisSergent</dc:creator>
      <dc:date>2011-05-25T19:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom To Polygon and Selected Point Outside Polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-polygon-and-selected-point-outside-polygon/m-p/354387#M32817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Chris,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for posting the video, very helpful.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I have this right, your city boundary is a dynamic map service layer? I was thinking it was a graphic on your map and not an overlay. Any chance you're willing to move to using your city boundary as a graphic instead of a dynamic map service layer?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To answer your question about the union method I mentioned, you need two &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/extent.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;extent&lt;/A&gt;&lt;SPAN&gt; geometries so you would need to create an extent from your point. Here's one method:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
// point objects don't have an extent so&amp;nbsp; you need to
// calculate a small value to use as padding for your point
var px = (map.extent.xmax - map.extent.xmin) / map.width
// then create an extent
var ptExtent = new esri.geometry.Extent(
&amp;nbsp; pt.x - px, // xmin
&amp;nbsp; pt.y - px, // ymin
&amp;nbsp; pt.x + px, // xmax
&amp;nbsp; pt.y + px,&amp;nbsp; //ymax
&amp;nbsp; map.spatialReference
);
// union the two extents
// cityExtent would be the result of
// cityGraphic.getExtent()
var newExtent = ptExtent.union(cityExtent);
map.setExtent(newExtent);
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:37:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-polygon-and-selected-point-outside-polygon/m-p/354387#M32817</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2021-12-11T16:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom To Polygon and Selected Point Outside Polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-polygon-and-selected-point-outside-polygon/m-p/354388#M32818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Since you can see what I am attempting, the next question is, how to modify my code. I have no problem with using the city boundary as a graphic. It serves no purpose besides display.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my code. I have quite a few comments, so hopefully it will answer any questions about how it works. Limited comments are when I am using an ESRI example; which did not really explain what was being done; this is just to explain gaps in my documentation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have the code for the entire app at: &lt;/SPAN&gt;&lt;A href="http://dl.dropbox.com/u/26169505/CityHireEligibleSample.zip" rel="nofollow noopener noreferrer" target="_blank"&gt;http://dl.dropbox.com/u/26169505/CityHireEligibleSample.zip&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;It's 3.94mb ESRI's limit is 2.0mb It's a public URL, so you do not need to have a dropbox account. I will remove this file when you download it or tomorrow.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your feedback. I will attempt to modify my code, but if you see what I need to do, that would be great too.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Chris&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Chris,&lt;BR /&gt;&lt;BR /&gt;Thanks for posting the video, very helpful.&lt;BR /&gt;&lt;BR /&gt;If I have this right, your city boundary is a dynamic map service layer? I was thinking it was a graphic on your map and not an overlay. Any chance you're willing to move to using your city boundary as a graphic instead of a dynamic map service layer?&lt;BR /&gt;&lt;BR /&gt;To answer your question about the union method I mentioned, you need two &lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/extent.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;extent&lt;/A&gt; geometries so you would need to create an extent from your point. Here's one method:&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
// point objects don't have an extent so&amp;nbsp; you need to
// calculate a small value to use as padding for your point
var px = (map.extent.xmax - map.extent.xmin) / map.width
// then create an extent
var ptExtent = new esri.geometry.Extent(
&amp;nbsp; pt.x - px, // xmin
&amp;nbsp; pt.y - px, // ymin
&amp;nbsp; pt.x + px, // xmax
&amp;nbsp; pt.y + px,&amp;nbsp; //ymax
&amp;nbsp; map.spatialReference
);
// union the two extents
// cityExtent would be the result of
// cityGraphic.getExtent()
var newExtent = ptExtent.union(cityExtent);
map.setExtent(newExtent);
&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:37:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-polygon-and-selected-point-outside-polygon/m-p/354388#M32818</guid>
      <dc:creator>ChrisSergent</dc:creator>
      <dc:date>2021-12-11T16:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom To Polygon and Selected Point Outside Polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-polygon-and-selected-point-outside-polygon/m-p/354389#M32819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have modified the code and it buffers fine and the city boundaries remain, but it no longer zooms.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is a video of what is happening. I was providing an online demonstration while preparing it. &lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://youtu.be/BOcFc9deLLQ?hd=1"&gt;http://youtu.be/BOcFc9deLLQ?hd=1&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I uploaded a modified application here: &lt;/SPAN&gt;&lt;A href="http://db.tt/w6bI4sK"&gt;http://db.tt/w6bI4sK&lt;/A&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Since you can see what I am attempting, the next question is, how to modify my code. I have no problem with using the city boundary as a graphic. It serves no purpose besides display.&lt;BR /&gt;&lt;BR /&gt;Please let me know if I need to explain anything.&lt;BR /&gt;&lt;BR /&gt;Here is my code. I have quite a few comments, so hopefully it will answer any questions about how it works. Limited comments are when I am using an ESRI example; which did not really explain what was being done; this is just to explain gaps in my documentation.&lt;BR /&gt;&lt;BR /&gt;I have the code for the entire app at: &lt;A href="http://dl.dropbox.com/u/26169505/CityHireEligibleSample.zip"&gt;http://dl.dropbox.com/u/26169505/CityHireEligibleSample.zip&lt;/A&gt;&lt;BR /&gt;It's 3.94mb ESRI's limit is 2.0mb It's a public URL, so you do not need to have a dropbox account. I will remove this file when you download it or tomorrow.&lt;BR /&gt;&lt;BR /&gt;Thanks for your feedback. I will attempt to modify my code, but if you see what I need to do, that would be great too.&lt;BR /&gt;&lt;BR /&gt;Chris&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2011 18:50:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-polygon-and-selected-point-outside-polygon/m-p/354389#M32819</guid>
      <dc:creator>ChrisSergent</dc:creator>
      <dc:date>2011-05-26T18:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom To Polygon and Selected Point Outside Polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-polygon-and-selected-point-outside-polygon/m-p/354390#M32820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey Chris,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for posting another video, that makes it crystal clear to see what you're trying to do.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm going to suggest a slightly new idea...since you're adding a buffer to your map, how about setting your map extent to include the buffer and the city boundary?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To do this, you would take the extent of your buffer geometry, union it with your map extent and then set your map extent to the new extent. I'm looking at the code you uploaded yesterday and you would do this inside your "showBuffer" function. Here's how it would look:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function showBuffer(geometries) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; var symbol = new esri.symbol.SimpleFillSymbol(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esri.symbol.SimpleFillSymbol.STYLE_SOLID,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new esri.symbol.SimpleLineSymbol(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esri.symbol.SimpleLineSymbol.STYLE_SOLID,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new dojo.Color([0, 0, 255, 0.65]), 2
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new dojo.Color([0, 0, 255, 0.35])
&amp;nbsp;&amp;nbsp;&amp;nbsp; );
&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.forEach(geometries, function (geometry) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var graphic = new esri.Graphic(geometry, symbol);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.graphics.add(graphic);
&amp;nbsp;&amp;nbsp;&amp;nbsp; });

&amp;nbsp;&amp;nbsp;&amp;nbsp; // looks like you only buffer one point
&amp;nbsp;&amp;nbsp;&amp;nbsp; // so take the first geometry in the geometries array
&amp;nbsp;&amp;nbsp;&amp;nbsp; // and get its extent
&amp;nbsp;&amp;nbsp;&amp;nbsp; var bufferExtent = geometries[0].getExtent();
&amp;nbsp;&amp;nbsp;&amp;nbsp; // create a new extent that is the union of the buffer's
&amp;nbsp;&amp;nbsp;&amp;nbsp; // extent and the map's current extent
&amp;nbsp;&amp;nbsp;&amp;nbsp; var newExtent = bufferExtent.union(map.getExtent());
&amp;nbsp;&amp;nbsp;&amp;nbsp; // set the map's extent
&amp;nbsp;&amp;nbsp;&amp;nbsp; map.setExtent(newExtent);

&amp;nbsp;&amp;nbsp;&amp;nbsp; queryParams.spatialRelationship = esri.tasks.Query.SPATIAL_REL_INTERIORINTERSECTION;
&amp;nbsp;&amp;nbsp;&amp;nbsp; queryParams.returnGeometry = true;
&amp;nbsp;&amp;nbsp;&amp;nbsp; queryParams.geometry = geometries[0];
&amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask.execute(queryParams);
}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:22:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-polygon-and-selected-point-outside-polygon/m-p/354390#M32820</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2021-12-12T16:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom To Polygon and Selected Point Outside Polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-polygon-and-selected-point-outside-polygon/m-p/354391#M32821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Derek,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have gotten everything to work using the method of Zooming to the Polygon and City Boundary, but still need to figure out how to perform a union with a code driven envelope of a point against the City Boundary. I have a video that provides a demo of the code working with the Buffered Point and City Boundary that you can watch here - &lt;/SPAN&gt;&lt;A href="http://youtu.be/PMeB016v_xE?hd=1" rel="nofollow noopener noreferrer" target="_blank"&gt;http://youtu.be/PMeB016v_xE?hd=1&lt;/A&gt;&lt;SPAN&gt;. I also provide an example as to why I only want the Address Point and City Boundary.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In addition, I have attached the JavaScript code that is used in the aforementioned video. There was also a ticket on this issue originally, incident number - #933278. Thang; the tech support staff may be able to provide you with additional information about the issue with the WKID and the attempt to create a union on the point and city boundary.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Only one piece to go. I hope you know what I need to do! &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just in case you want to record feedback, here is the recording tool I use: &lt;/SPAN&gt;&lt;A href="http://camstudio.org/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://camstudio.org/&lt;/A&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Chris&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; Hey Chris,&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt;Thanks for posting another video, that makes it crystal clear to see what you're trying to do.&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;I'm going to suggest a slightly new idea...since you're adding a buffer to your map, how about setting your map extent to include the buffer and the city boundary?&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt;To do this, you would take the extent of your buffer geometry, union it with your map extent and then set your map extent to the new extent. I'm looking at the code you uploaded yesterday and you would do this inside your "showBuffer" function. Here's how it would look:&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; &lt;PRE class="lia-code-sample line-numbers language-none"&gt;function showBuffer(geometries) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; var symbol = new esri.symbol.SimpleFillSymbol(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esri.symbol.SimpleFillSymbol.STYLE_SOLID,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new esri.symbol.SimpleLineSymbol(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esri.symbol.SimpleLineSymbol.STYLE_SOLID,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new dojo.Color([0, 0, 255, 0.65]), 2
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new dojo.Color([0, 0, 255, 0.35])
&amp;nbsp;&amp;nbsp;&amp;nbsp; );
&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.forEach(geometries, function (geometry) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var graphic = new esri.Graphic(geometry, symbol);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.graphics.add(graphic);
&amp;nbsp;&amp;nbsp;&amp;nbsp; });

&lt;SPAN style="color:&amp;quot;red&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // looks like you only buffer one point
&amp;nbsp;&amp;nbsp;&amp;nbsp; // so take the first geometry in the geometries array
&amp;nbsp;&amp;nbsp;&amp;nbsp; // and get its extent
&amp;nbsp;&amp;nbsp;&amp;nbsp; var bufferExtent = geometries[0].getExtent();
&amp;nbsp;&amp;nbsp;&amp;nbsp; // create a new extent that is the union of the buffer's
&amp;nbsp;&amp;nbsp;&amp;nbsp; // extent and the map's current extent
&amp;nbsp;&amp;nbsp;&amp;nbsp; var newExtent = bufferExtent.union(map.getExtent());
&amp;nbsp;&amp;nbsp;&amp;nbsp; // set the map's extent
&amp;nbsp;&amp;nbsp;&amp;nbsp; map.setExtent(newExtent);&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; queryParams.spatialRelationship = esri.tasks.Query.SPATIAL_REL_INTERIORINTERSECTION;
&amp;nbsp;&amp;nbsp;&amp;nbsp; queryParams.returnGeometry = true;
&amp;nbsp;&amp;nbsp;&amp;nbsp; queryParams.geometry = geometries[0];
&amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask.execute(queryParams);
}&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:37:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-polygon-and-selected-point-outside-polygon/m-p/354391#M32821</guid>
      <dc:creator>ChrisSergent</dc:creator>
      <dc:date>2021-12-11T16:37:14Z</dc:date>
    </item>
  </channel>
</rss>

