<?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: How to drop a pin from variables in JavaScript in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-drop-a-pin-from-variables-in-javascript/m-p/1425#M90</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Egge-Jan Polle&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much, let me try that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 31 Mar 2020 08:53:59 GMT</pubDate>
    <dc:creator>SiyabongaKubeka</dc:creator>
    <dc:date>2020-03-31T08:53:59Z</dc:date>
    <item>
      <title>How to drop a pin from variables in JavaScript</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-drop-a-pin-from-variables-in-javascript/m-p/1423#M88</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to drop a pin using data that is saved on to JavaScript Variables, x and y. How can I do that. Below is the code to drop a pin and get coordinates, is there a way I can change it so that I drop the pin using data that is saved on variables?&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 charset="utf-8" /&amp;gt;&lt;BR /&gt; &amp;lt;meta&lt;BR /&gt; name="viewport"&lt;BR /&gt; content="initial-scale=1,maximum-scale=1,user-scalable=no"&lt;BR /&gt; /&amp;gt;&lt;BR /&gt; &amp;lt;title&amp;gt;DEA GIS APPLICATION&amp;lt;/title&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;link&lt;BR /&gt; rel="stylesheet"&lt;BR /&gt; href="https://js.arcgis.com/4.12/esri/themes/light/main.css"&lt;BR /&gt; /&amp;gt;&lt;BR /&gt; &amp;lt;script src="https://js.arcgis.com/4.12/"&amp;gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;style&amp;gt;&lt;BR /&gt; html,&lt;BR /&gt; body,&lt;BR /&gt; #viewDiv {&lt;BR /&gt; padding: 0;&lt;BR /&gt; margin: 0;&lt;BR /&gt; height: 100%;&lt;BR /&gt; width: 100%;&lt;BR /&gt; }&lt;BR /&gt; .esri-sketch__section.esri-sketch__tool-section:last-of-type {&lt;BR /&gt; display:none;&lt;BR /&gt; }&lt;BR /&gt; .esri-sketch__section.esri-sketch__tool-section:nth-child(2) {&lt;BR /&gt; border-right: none;&lt;BR /&gt; }&lt;BR /&gt; &amp;lt;/style&amp;gt;&lt;BR /&gt; &amp;lt;script&amp;gt;&lt;BR /&gt; require([&lt;BR /&gt; "esri/widgets/Sketch",&lt;BR /&gt; "esri/Map",&lt;BR /&gt; "esri/layers/GraphicsLayer",&lt;BR /&gt; "esri/views/MapView"&lt;BR /&gt; ], function(Sketch, Map, GraphicsLayer, MapView) {&lt;BR /&gt; const layer = new GraphicsLayer();&lt;/P&gt;&lt;P&gt;const map = new Map({&lt;BR /&gt; basemap: "streets",&lt;BR /&gt; layers: [layer]&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;const view = new MapView({&lt;BR /&gt; container: "viewDiv",&lt;BR /&gt; map: map,&lt;BR /&gt; zoom: 5,&lt;BR /&gt; center: [90, 45]&lt;BR /&gt; });&lt;BR /&gt; &lt;BR /&gt; var symbol = {&lt;BR /&gt; type: "simple-marker", // autocasts as new SimpleMarkerSymbol()&lt;BR /&gt; style: "circle",&lt;BR /&gt; color: "blue",&lt;BR /&gt; size: "8px", // pixels&lt;BR /&gt; outline: { // autocasts as new SimpleLineSymbol()&lt;BR /&gt; color: [ 255, 255, 0 ],&lt;BR /&gt; width: 1 // points&lt;BR /&gt; }&lt;BR /&gt; };&lt;/P&gt;&lt;P&gt;const sketch = new Sketch({&lt;BR /&gt; layer: layer,&lt;BR /&gt; view: view,&lt;BR /&gt; symbol: symbol,&lt;BR /&gt; availableCreateTools: ["point"]&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;view.ui.add(sketch, "top-right");&lt;BR /&gt; &lt;BR /&gt; sketch.on('create', function (evt) {&lt;BR /&gt; if (view.zoom &amp;gt;= 11) {&lt;BR /&gt; // check if the create event's state has changed to complete indicating&lt;BR /&gt; // the graphic create operation is completed.&lt;BR /&gt; let gra = evt.graphic.clone();&lt;BR /&gt; evt.graphic.layer.removeAll();&lt;BR /&gt; gra.symbol.color = "blue";&lt;BR /&gt; layer.add(gra);&lt;BR /&gt; console.log("X = ", gra.geometry.x);&lt;BR /&gt; console.log("Y = ", gra.geometry.y);&lt;BR /&gt; } else {&lt;BR /&gt; alert("please zoom in");&lt;BR /&gt; evt.graphic.layer.remove(evt.graphic);&lt;BR /&gt; }&lt;BR /&gt; });&lt;BR /&gt; });&lt;BR /&gt; &amp;lt;/script&amp;gt;&lt;BR /&gt; &amp;lt;/head&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;body&amp;gt;&lt;BR /&gt; &amp;lt;div id="viewDiv"&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;/body&amp;gt;&lt;BR /&gt;&amp;lt;/html&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please assist.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2020 07:09:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-drop-a-pin-from-variables-in-javascript/m-p/1423#M88</guid>
      <dc:creator>SiyabongaKubeka</dc:creator>
      <dc:date>2020-03-31T07:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to drop a pin from variables in JavaScript</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-drop-a-pin-from-variables-in-javascript/m-p/1424#M89</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG class="image-1 j-img-floatend jive-image" src="https://community.esri.com/legacyfs/online/486876_pastedImage_3.png" style="float: right;" /&gt;&lt;/P&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/387933"&gt;Siyabonga Kubeka&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;P&gt;Recently, I did create a little app - with the ArcGIS API for JavaScript 4.x - with a custom tool to enter WGS84 Coordinates to zoom to a certain point, see screen capture attached.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;These entries are used to create a new Graphic that is added to the MapView. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;/P&gt;&lt;P&gt;You can find (the source code of) the app here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Ftwiav.nl%2Ftutorial%2Farcgis%2Fjavascript%2Farcgis_javascript_tutorial_go_to_lat_lon.htm" rel="nofollow" target="_blank"&gt;ArcGIS JavaScript Tutorial - Go to Latitude/Longitude&lt;/A&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this useful to you?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Egge-Jan&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2020 07:59:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-drop-a-pin-from-variables-in-javascript/m-p/1424#M89</guid>
      <dc:creator>Egge-Jan_Pollé</dc:creator>
      <dc:date>2020-03-31T07:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to drop a pin from variables in JavaScript</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-drop-a-pin-from-variables-in-javascript/m-p/1425#M90</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Egge-Jan Polle&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much, let me try that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2020 08:53:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-drop-a-pin-from-variables-in-javascript/m-p/1425#M90</guid>
      <dc:creator>SiyabongaKubeka</dc:creator>
      <dc:date>2020-03-31T08:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to drop a pin from variables in JavaScript</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-drop-a-pin-from-variables-in-javascript/m-p/1426#M91</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Egge-Jan Polle&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I please the .htm file? Please email to siyakubeka@live.com&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2020 09:26:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-drop-a-pin-from-variables-in-javascript/m-p/1426#M91</guid>
      <dc:creator>SiyabongaKubeka</dc:creator>
      <dc:date>2020-03-31T09:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to drop a pin from variables in JavaScript</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-drop-a-pin-from-variables-in-javascript/m-p/1427#M92</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/387933"&gt;Siyabonga Kubeka&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, of course! You can view the source in your browser, and copy the full .htm file from there.&lt;/P&gt;&lt;P&gt;You can access the source - both in Firefox and Google Chrome - by hitting Ctrl+U with the page open --&amp;gt; the source will then be opened in a separate window.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you know this trick already?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Egge-Jan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2020 09:48:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-drop-a-pin-from-variables-in-javascript/m-p/1427#M92</guid>
      <dc:creator>Egge-Jan_Pollé</dc:creator>
      <dc:date>2020-03-31T09:48:31Z</dc:date>
    </item>
  </channel>
</rss>

