<?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: UNABLE TO ZOOM TO POINT FEATURE in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-zoom-to-point-feature/m-p/592912#M55478</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Bharath,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Don't forget to mark this question as answered by clicking on the "Correct Answer" link on the reply that answered your question.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Oct 2016 12:49:56 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2016-10-18T12:49:56Z</dc:date>
    <item>
      <title>UNABLE TO ZOOM TO POINT FEATURE</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-zoom-to-point-feature/m-p/592908#M55474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is my code i am able to add graphics but unable to zoom please help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;BR /&gt;&amp;lt;html&amp;gt; &lt;BR /&gt; &amp;lt;head&amp;gt;&lt;BR /&gt; &amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&amp;gt;&lt;BR /&gt; &amp;lt;meta http-equiv="X-UA-Compatible" content="IE=7, IE=9, IE=10"&amp;gt;&lt;BR /&gt; &amp;lt;!--The viewport meta tag is used to improve the presentation and behavior of the samples &lt;BR /&gt; on iOS devices--&amp;gt;&lt;BR /&gt; &amp;lt;meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"&amp;gt;&lt;BR /&gt; &amp;lt;title&amp;gt;Identify with Popup&amp;lt;/title&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt; &amp;lt;link rel="stylesheet" href="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fserverapi.arcgisonline.com%2Fjsapi%2Farcgis%2F3.5%2Fjs%2Fesri%2Fcss%2Fesri.css" rel="nofollow" target="_blank"&gt;http://serverapi.arcgisonline.com/jsapi/arcgis/3.5/js/esri/css/esri.css&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt; &amp;lt;style&amp;gt;&lt;BR /&gt; html, body, #mapDiv {&lt;BR /&gt; height:100%;&lt;BR /&gt; width:100%;&lt;BR /&gt; margin:0;&lt;BR /&gt; padding:0;&lt;BR /&gt; }&lt;BR /&gt; &amp;lt;/style&amp;gt;&lt;BR /&gt; &lt;BR /&gt;&lt;SPAN&gt; &amp;lt;script src="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fserverapi.arcgisonline.com%2Fjsapi%2Farcgis%2F3.5%2F" rel="nofollow" target="_blank"&gt;http://serverapi.arcgisonline.com/jsapi/arcgis/3.5/&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&amp;lt;/script&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt; &amp;lt;script type="text/javascript"&amp;gt;&lt;BR /&gt; dojo.require("esri.map");&lt;BR /&gt; dojo.require("esri.tasks.query");&lt;/P&gt;&lt;P&gt;var map, queryTask, query;&lt;BR /&gt; var symbol, infoTemplate;&lt;BR /&gt; var totalExtent;&lt;/P&gt;&lt;P&gt;function init() {&lt;BR /&gt; map = new esri.Map("mapDiv", {&lt;BR /&gt; center: [19.46, 50.382],&lt;BR /&gt; zoom: 4&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;dynamicmap = new esri.layers.ArcGISDynamicMapServiceLayer("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Flocalhost%3A6080%2Farcgis%2Frest%2Fservices%2Fedit%2FMapServer" rel="nofollow" target="_blank"&gt;http://localhost:6080/arcgis/rest/services/edit/MapServer&lt;/A&gt;&lt;SPAN&gt;");&lt;/SPAN&gt;&lt;BR /&gt; map.addLayer(dynamicmap);&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;queryTask = new esri.tasks.QueryTask("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Flocalhost%3A6080%2Farcgis%2Frest%2Fservices%2Fedit%2FMapServer%2F20" rel="nofollow" target="_blank"&gt;http://localhost:6080/arcgis/rest/services/edit/MapServer/20&lt;/A&gt;&lt;SPAN&gt;");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;// //initialize query&lt;BR /&gt; query = new esri.tasks.Query();&lt;BR /&gt; query.returnGeometry = true;&lt;BR /&gt; query.outFields = ["LTP_ID ", "OBJECTID "];&lt;/P&gt;&lt;P&gt;//create symbol for selected features&lt;BR /&gt; symbol = new esri.symbol.SimpleMarkerSymbol();&lt;BR /&gt; symbol.setStyle(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE);&lt;BR /&gt; symbol.setSize(10);&lt;BR /&gt; symbol.setColor(new esri.Color([255, 255, 0, 0.5]));&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; function executeQueryTask(sTownID) {&lt;BR /&gt;// debugger;&lt;BR /&gt; //set query based on what user typed in for population;&lt;BR /&gt; //query.where = "POP04 &amp;gt; " + population;&lt;BR /&gt; // var sTownID = $get('population').value ;&lt;/P&gt;&lt;P&gt;query.where = "LTP_ID ='" + sTownID + "'";&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; //execute query&lt;BR /&gt; queryTask.execute(query, showResults);&lt;BR /&gt; // var zm = queryTask.execute(query, showResults);&lt;BR /&gt; // map.centerAndZoom(zm, 2);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;function showResults(featureSet) {&lt;BR /&gt; debugger;&lt;BR /&gt; &lt;BR /&gt; //remove all graphics on the maps graphics layer&lt;BR /&gt; map.graphics.clear();&lt;/P&gt;&lt;P&gt;//Performance enhancer - assign featureSet array to a single variable.&lt;BR /&gt; var resultFeatures = featureSet.features;&lt;/P&gt;&lt;P&gt;//Loop through each feature returned&lt;/P&gt;&lt;P&gt;for (var i = 0, il = resultFeatures.length; i &amp;lt; il; i++) {&lt;BR /&gt; //Get the current feature from the featureSet.&lt;BR /&gt; //Feature is a graphic&lt;BR /&gt; var graphic = resultFeatures&lt;I&gt;;&lt;BR /&gt; //graphic.setSymbol(symbol);&lt;/I&gt;&lt;/P&gt;&lt;P&gt;//Set the infoTemplate.&lt;BR /&gt; //graphic.setInfoTemplate(infoTemplate);&lt;/P&gt;&lt;P&gt;//Add graphic to the map graphics layer. &lt;BR /&gt;map.graphics.add(graphic);&lt;/P&gt;&lt;P&gt;map.setExtent(graphic.geometry.getExtent(), true);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;dojo.ready(init);&lt;BR /&gt; &amp;lt;/script&amp;gt;&lt;BR /&gt; &amp;lt;/head&amp;gt;&lt;BR /&gt; &lt;BR /&gt; &amp;lt;body&amp;gt;&lt;BR /&gt; &amp;lt;br/&amp;gt;&lt;BR /&gt; Enter Value : &amp;lt;input type="text" id="pop" /&amp;gt;&lt;BR /&gt; &lt;BR /&gt; &amp;lt;input type="button" value="Get Details" onclick="executeQueryTask(dojo.byId('pop').value);" /&amp;gt;&lt;BR /&gt; &amp;lt;div id="mapDiv" style="width:1000px; height:800px; border:1px solid #000;"&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt; &lt;BR /&gt; &amp;lt;/body&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/html&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2016 12:03:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-zoom-to-point-feature/m-p/592908#M55474</guid>
      <dc:creator>bharathreddy</dc:creator>
      <dc:date>2016-10-17T12:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: UNABLE TO ZOOM TO POINT FEATURE</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-zoom-to-point-feature/m-p/592909#M55475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bharath,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;A Point geometry does not have an extent, so this code does nothing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;setExtent&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;graphic&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;geometry&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getExtent&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;true&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like this would work better:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;graphic&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;geometry&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;type &lt;SPAN class="operator token"&gt;===&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'point'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; mz &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getMaxZoom&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mz &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;centerAndZoom&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;graphic&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;geometry&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; mz &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;centerAndZoom&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;graphic&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;geometry&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0.25&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&amp;nbsp; 
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;setExtent&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;graphic&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;geometry&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getExtent&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&amp;nbsp; 
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:27:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-zoom-to-point-feature/m-p/592909#M55475</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-12T01:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: UNABLE TO ZOOM TO POINT FEATURE</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-zoom-to-point-feature/m-p/592910#M55476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the above didnt work for me&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 04:30:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-zoom-to-point-feature/m-p/592910#M55476</guid>
      <dc:creator>bharathreddy</dc:creator>
      <dc:date>2016-10-18T04:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: UNABLE TO ZOOM TO POINT FEATURE</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-zoom-to-point-feature/m-p/592911#M55477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it worked for me with few modifications&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 10:15:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-zoom-to-point-feature/m-p/592911#M55477</guid>
      <dc:creator>bharathreddy</dc:creator>
      <dc:date>2016-10-18T10:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: UNABLE TO ZOOM TO POINT FEATURE</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-zoom-to-point-feature/m-p/592912#M55478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Bharath,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Don't forget to mark this question as answered by clicking on the "Correct Answer" link on the reply that answered your question.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 12:49:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-zoom-to-point-feature/m-p/592912#M55478</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-10-18T12:49:56Z</dc:date>
    </item>
  </channel>
</rss>

