<?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 a feature on a mouse click event in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-a-feature-on-a-mouse-click-event/m-p/551016#M51387</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using developer tools, I found there was an error with another part of my code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 May 2016 14:24:43 GMT</pubDate>
    <dc:creator>RoxanneWilson</dc:creator>
    <dc:date>2016-05-23T14:24:43Z</dc:date>
    <item>
      <title>Zoom to a feature on a mouse click event</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-a-feature-on-a-mouse-click-event/m-p/551009#M51380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, working on my first app and I have a point layer with a few locations in it.&amp;nbsp; I'm trying to create an event where, when the user clicks on a location, the map extent zooms to that location.&amp;nbsp; This is what I have so far and it doesn't work (not a shocker)....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;layerName.on("click", function (zoom) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; map.zoom (zoom.layer.setZoom(4));&lt;/P&gt;&lt;P&gt; });&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2016 20:31:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-a-feature-on-a-mouse-click-event/m-p/551009#M51380</guid>
      <dc:creator>RoxanneWilson</dc:creator>
      <dc:date>2016-05-20T20:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to a feature on a mouse click event</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-a-feature-on-a-mouse-click-event/m-p/551010#M51381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you using a sample? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you post more of your code? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2016 21:48:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-a-feature-on-a-mouse-click-event/m-p/551010#M51381</guid>
      <dc:creator>RickeyFight</dc:creator>
      <dc:date>2016-05-20T21:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to a feature on a mouse click event</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-a-feature-on-a-mouse-click-event/m-p/551011#M51382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Roxanne,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Zoom is not a method of map.&amp;nbsp; When a graphic in a feature layer is clicked, it will return the graphic,&amp;nbsp; You can then use the graphic geometry or the event mapPoint to zoom to that location.&amp;nbsp; Here is a further explanation:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/3/jsapi/featurelayer-amd.html#event-click" title="https://developers.arcgis.com/javascript/3/jsapi/featurelayer-amd.html#event-click"&gt;FeatureLayer | API Reference | ArcGIS API for JavaScript&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It should look something like this:&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;layerName.on("click", function (event) {&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="pln" style="color: #595959;"&gt;map&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt;centerAndZoom&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt;event.mapPoint&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;, &lt;/SPAN&gt;&lt;SPAN class="lit" style="color: #009999;"&gt;4&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;});&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2016 21:54:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-a-feature-on-a-mouse-click-event/m-p/551011#M51382</guid>
      <dc:creator>TomSellsted</dc:creator>
      <dc:date>2016-05-20T21:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to a feature on a mouse click event</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-a-feature-on-a-mouse-click-event/m-p/551012#M51383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've added that into my code, but nothing is happening yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do I need to add something else?&amp;nbsp; I've been reading about event listeners, but I don't understand a lot of that quite yet.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2016 13:33:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-a-feature-on-a-mouse-click-event/m-p/551012#M51383</guid>
      <dc:creator>RoxanneWilson</dc:creator>
      <dc:date>2016-05-23T13:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to a feature on a mouse click event</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-a-feature-on-a-mouse-click-event/m-p/551013#M51384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The click tolerance might cause that you are just missing the features with the click event and therefore nothing is happening.&amp;nbsp; Try setting the click event on the map object.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2016 13:53:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-a-feature-on-a-mouse-click-event/m-p/551013#M51384</guid>
      <dc:creator>FC_Basson</dc:creator>
      <dc:date>2016-05-23T13:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to a feature on a mouse click event</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-a-feature-on-a-mouse-click-event/m-p/551014#M51385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;on this function &lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;layerName.on("click", function (event) {&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;take the selected geometry &lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;event&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;.graphic&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;and zoom on the map&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN class="pln" style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #595959;"&gt;map&lt;/SPAN&gt;&lt;SPAN class="pun" style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #666600;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #595959;"&gt;centerAndZoom&lt;/SPAN&gt;&lt;SPAN class="pun" style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #666600;"&gt;(&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;event&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;.graphic.geometry&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="pun" style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #666600;"&gt;, &lt;/SPAN&gt;&lt;SPAN class="lit" style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #009999;"&gt;4&lt;/SPAN&gt;&lt;SPAN class="pun" style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #666600;"&gt;);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; &lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;});&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2016 13:57:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-a-feature-on-a-mouse-click-event/m-p/551014#M51385</guid>
      <dc:creator>PanagiotisPapadopoulos</dc:creator>
      <dc:date>2016-05-23T13:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to a feature on a mouse click event</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-a-feature-on-a-mouse-click-event/m-p/551015#M51386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This doesn't appear to do anything either.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;layer.on("click", function (event) {&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; map.centerAndZoom(event.graphic.geometry, 4);&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2016 14:21:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-a-feature-on-a-mouse-click-event/m-p/551015#M51386</guid>
      <dc:creator>RoxanneWilson</dc:creator>
      <dc:date>2016-05-23T14:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to a feature on a mouse click event</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-a-feature-on-a-mouse-click-event/m-p/551016#M51387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using developer tools, I found there was an error with another part of my code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2016 14:24:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-a-feature-on-a-mouse-click-event/m-p/551016#M51387</guid>
      <dc:creator>RoxanneWilson</dc:creator>
      <dc:date>2016-05-23T14:24:43Z</dc:date>
    </item>
  </channel>
</rss>

