<?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 Reverse geocode map on click 4.17 in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/reverse-geocode-map-on-click-4-17/m-p/1007232#M71023</link>
    <description>&lt;P&gt;Hello, I am using the latest API version and it seems like there are some changes so the previous questions and posts are not helping me solve this problem.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to lookup an address by clicking on the map but I keep getting:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;locator.locationToAddress is not a function&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my code, I tried to console.log(locator) and I do not see any methods, I'm not sure if I am creating the Locator object properly&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;this.view.on("click", event =&amp;gt;{
    this.view.graphics.removeAll();
    var point = {
        type: "point", // autocasts as new Point()
        longitude: event.mapPoint.longitude,
        latitude: event.mapPoint.latitude,
      };
    var markerSymbol = {
        type: "simple-marker", // autocasts as new SimpleMarkerSymbol()
        color: [226, 119, 40]
    };
    var pointGraphic = new Graphic({
        geometry: point,
        symbol: markerSymbol
    });
    
    this.view.graphics.add(pointGraphic);

    
    console.log("errr");
    var locator = new Locator({
        url: "https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer"
    });
    console.log(locator);
    locator.locationToAddress({location: event.mapPoint}).then(function(response){
        console.log(response);
     });

    this.clickedOnMap(event);
    
});&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;In the same file above this I am using esri-loader with Reactjs&amp;nbsp; and I load the modules using&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;loadModules(["esri/Map", "esri/views/MapView", "esri/widgets/Search", "esri/Graphic", "esri/geometry/Point", "esri/tasks/Locator", "esri/geometry/SpatialReference", "esri/geometry/support/webMercatorUtils"], { css: true })
            .then(([ArcGISMap, MapView, Search, Graphic, Locator, SpatialReference, webMercatorUtils, Point]) =&amp;gt; {
....
....
SNIP&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;I hope someone would be able to help me with this.&amp;nbsp;&lt;BR /&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 06 Dec 2020 19:40:59 GMT</pubDate>
    <dc:creator>laitha0</dc:creator>
    <dc:date>2020-12-06T19:40:59Z</dc:date>
    <item>
      <title>Reverse geocode map on click 4.17</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/reverse-geocode-map-on-click-4-17/m-p/1007232#M71023</link>
      <description>&lt;P&gt;Hello, I am using the latest API version and it seems like there are some changes so the previous questions and posts are not helping me solve this problem.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to lookup an address by clicking on the map but I keep getting:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;locator.locationToAddress is not a function&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my code, I tried to console.log(locator) and I do not see any methods, I'm not sure if I am creating the Locator object properly&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;this.view.on("click", event =&amp;gt;{
    this.view.graphics.removeAll();
    var point = {
        type: "point", // autocasts as new Point()
        longitude: event.mapPoint.longitude,
        latitude: event.mapPoint.latitude,
      };
    var markerSymbol = {
        type: "simple-marker", // autocasts as new SimpleMarkerSymbol()
        color: [226, 119, 40]
    };
    var pointGraphic = new Graphic({
        geometry: point,
        symbol: markerSymbol
    });
    
    this.view.graphics.add(pointGraphic);

    
    console.log("errr");
    var locator = new Locator({
        url: "https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer"
    });
    console.log(locator);
    locator.locationToAddress({location: event.mapPoint}).then(function(response){
        console.log(response);
     });

    this.clickedOnMap(event);
    
});&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;In the same file above this I am using esri-loader with Reactjs&amp;nbsp; and I load the modules using&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;loadModules(["esri/Map", "esri/views/MapView", "esri/widgets/Search", "esri/Graphic", "esri/geometry/Point", "esri/tasks/Locator", "esri/geometry/SpatialReference", "esri/geometry/support/webMercatorUtils"], { css: true })
            .then(([ArcGISMap, MapView, Search, Graphic, Locator, SpatialReference, webMercatorUtils, Point]) =&amp;gt; {
....
....
SNIP&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;I hope someone would be able to help me with this.&amp;nbsp;&lt;BR /&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Dec 2020 19:40:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/reverse-geocode-map-on-click-4-17/m-p/1007232#M71023</guid>
      <dc:creator>laitha0</dc:creator>
      <dc:date>2020-12-06T19:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: Reverse geocode map on click 4.17</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/reverse-geocode-map-on-click-4-17/m-p/1007381#M71036</link>
      <description>&lt;P&gt;Hi Laitha,&lt;/P&gt;&lt;P&gt;When using loadModules, the order of the imports does need to match I think. Try moving "Point" between "Graphic" and "Locator" after the .then like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;loadModules(["esri/Map", "esri/views/MapView",
             "esri/widgets/Search", "esri/Graphic",
             "esri/geometry/Point", "esri/tasks/Locator",
             "esri/geometry/SpatialReference",
             "esri/geometry/support/webMercatorUtils"],
             { css: true }).then(([ArcGISMap, MapView, Search,
                                   Graphic, Point, Locator,
                                   SpatialReference, webMercatorUtils]) =&amp;gt; {}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps! You may also find these resources helpful:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/labs/browse/?product=javascript&amp;amp;topic=geocoding" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/labs/browse/?product=javascript&amp;amp;topic=geocoding&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 16:18:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/reverse-geocode-map-on-click-4-17/m-p/1007381#M71036</guid>
      <dc:creator>Ethan</dc:creator>
      <dc:date>2020-12-07T16:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: Reverse geocode map on click 4.17</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/reverse-geocode-map-on-click-4-17/m-p/1007494#M71039</link>
      <description>&lt;P&gt;very interesting the order did matter !&lt;BR /&gt;I just moved Locator before Point and created the Locator before adding the graphic to the map and now it worked !!&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 18:57:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/reverse-geocode-map-on-click-4-17/m-p/1007494#M71039</guid>
      <dc:creator>laitha0</dc:creator>
      <dc:date>2020-12-07T18:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: Reverse geocode map on click 4.17</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/reverse-geocode-map-on-click-4-17/m-p/1007495#M71040</link>
      <description>&lt;P&gt;Thanks for the help&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/116423"&gt;@Ethan&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 18:58:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/reverse-geocode-map-on-click-4-17/m-p/1007495#M71040</guid>
      <dc:creator>laitha0</dc:creator>
      <dc:date>2020-12-07T18:58:09Z</dc:date>
    </item>
  </channel>
</rss>

