<?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: Ctrl + Mouse click in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ctrl-mouse-click/m-p/425314#M39120</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you &lt;A href="https://community.esri.com/migrated-users/3101"&gt;Robert Scheitlin, GISP&lt;/A&gt;‌.&lt;/P&gt;&lt;P&gt;Can you solve another problem. i have added point with "Ctrl + mouse click" to map but i want to remove that point after 5 second or 3 second.&lt;/P&gt;&lt;P&gt;How is it possible??.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/456689_Capture.JPG" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Aug 2019 05:21:25 GMT</pubDate>
    <dc:creator>kawishabbas</dc:creator>
    <dc:date>2019-08-09T05:21:25Z</dc:date>
    <item>
      <title>Ctrl + Mouse click</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ctrl-mouse-click/m-p/425312#M39118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I want to use Ctrl key with mouse click to get coordinates. Following snapshot is working well on mouse click, is there any way to modify this code with Ctrl key????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/456562_Capture.JPG" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Aug 2019 05:25:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ctrl-mouse-click/m-p/425312#M39118</guid>
      <dc:creator>kawishabbas</dc:creator>
      <dc:date>2019-08-08T05:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: Ctrl + Mouse click</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ctrl-mouse-click/m-p/425313#M39119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kawish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; The ctrl key is part of the native object in your "show" object.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;view.on('click', function(show){
  console.info(show.native.ctrlKey);
});&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:10:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ctrl-mouse-click/m-p/425313#M39119</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T19:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: Ctrl + Mouse click</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ctrl-mouse-click/m-p/425314#M39120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you &lt;A href="https://community.esri.com/migrated-users/3101"&gt;Robert Scheitlin, GISP&lt;/A&gt;‌.&lt;/P&gt;&lt;P&gt;Can you solve another problem. i have added point with "Ctrl + mouse click" to map but i want to remove that point after 5 second or 3 second.&lt;/P&gt;&lt;P&gt;How is it possible??.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/456689_Capture.JPG" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Aug 2019 05:21:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ctrl-mouse-click/m-p/425314#M39120</guid>
      <dc:creator>kawishabbas</dc:creator>
      <dc:date>2019-08-09T05:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: Ctrl + Mouse click</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ctrl-mouse-click/m-p/425315#M39121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kawish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Sure just add a setTimeout to the end of your code that removes the graphic.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="token function"&gt;setTimeout&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;function&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;
  view&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;graphics&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;remove&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;pointGraphic&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; &lt;SPAN class="number token"&gt;5000&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;/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>Sat, 11 Dec 2021 19:10:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ctrl-mouse-click/m-p/425315#M39121</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T19:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: Ctrl + Mouse click</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ctrl-mouse-click/m-p/1072451#M73619</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1104"&gt;@RobertScheitlin__GISP&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please help me on this.&lt;/P&gt;&lt;P&gt;I'm receiving evt.native as 'undefined' while "CTRL + click" on the featurelayer here is my code,&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;/* eslint-disable */
import React, { useRef, useEffect } from 'react';
import MapView from '@arcgis/core/views/MapView';
import WebMap from '@arcgis/core/Map';
import FeatureLayer from '@arcgis/core/layers/FeatureLayer';
import Draw from '@arcgis/core/views/draw/Draw';
import Graphic from '@arcgis/core/Graphic';
import GraphicsLayer from '@arcgis/core/layers/GraphicsLayer';
import Point from '@arcgis/core/geometry/Point';
import MultiPoint from '@arcgis/core/geometry/Multipoint';
import Search from '@arcgis/core/widgets/Search'

import '../../assets/css/map.css';

const Map = () =&amp;gt; {
  const mapDiv = useRef(null);
  const click_ref = useRef(null);

  useEffect(() =&amp;gt; {
    if (mapDiv.current) {
      /**
       * Initialize application
       */
      const pntGraphics = new GraphicsLayer();

      let renderer = {
        type: 'simple', // autocasts as new SimpleRenderer()
        symbol: {
          type: 'simple-fill', // autocasts as new SimpleFillSymbol()
          color: [255, 255, 255, 0.5],
          style: 'none',
          outline: {
            // autocasts as new SimpleLineSymbol()
            color: 'white',
            width: 2,
          },
        },
      };

      let drawPnt,
        graphic,
        ctrlKey = false,
        highlight,
        statesLyrView;

      const webmap = new WebMap({
        basemap: 'streets-vector',
      });

      const view = new MapView({
        container: mapDiv.current,
        map: webmap,
        center: [-98.43750059604514, 38.1986442207947],
        scale: 25000000,
        ui: {
          components: ['zoom', 'compass'],
        },
      });

      const searchWidget = new Search({
        view: view
      });

      view.ui.add(searchWidget, "top-right");

      const stateFeatureLayer = new FeatureLayer({
        url:
          'https://services2.arcgis.com/JoecHEvChY6qFe2m/arcgis/rest/services/USA_States/FeatureServer/0',
        outFields: ['*'],
      });

      const cityFeatureLayer = new FeatureLayer({
        url:
          'https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/0',
        outFields: ['*'],
      });

      webmap.addMany([stateFeatureLayer, cityFeatureLayer]);

      stateFeatureLayer.when(function () {
        view.whenLayerView(stateFeatureLayer).then(function (layerView) {
          statesLyrView = layerView;
        });
      });

      const draw = new Draw({
        view: view,
      });

      var sym = {
        type: 'simple-marker',
        style: 'circle',
        color: [0, 255, 255, 0.6],
        size: '8px',
        outline: {
          color: [0, 255, 255, 1],
          width: 1,
        },
      };

      view.ui.add('point-button', 'top-left');

      const drawPoint = () =&amp;gt; {
        console.log('in ');
        if (highlight) {
          highlight.remove();
        }
        const action = draw.create('point');
        action.on('cursor-update', function (evt) {
          view.graphics.removeAll();
          drawPnt = new Point({
            x: evt.coordinates[0],
            y: evt.coordinates[1],
            spatialReference: view.spatialReference,
          });
          graphic = new Graphic({
            geometry: drawPnt,
            symbol: sym,
          });
          view.graphics.add(graphic);
          /*if (ctrlKey &amp;amp;&amp;amp; !evt.native.ctrlKey) {
              draw.reset();
              view.graphics.removeAll();
              selectStates();
          }*/
        });
        action.on('draw-complete', function (evt) {
          if (evt.native.ctrlKey) {
            ctrlKey = true;
          } else {
            ctrlKey = false;
          }
          drawPnt = new Point({
            x: evt.coordinates[0],
            y: evt.coordinates[1],
            spatialReference: view.spatialReference,
          });
          graphic = new Graphic({
            geometry: drawPnt,
            symbol: sym,
          });
          pntGraphics.add(graphic);
          if (evt.native.ctrlKey) {
            drawPoint();
          } else {
            view.graphics.removeAll();
            selectStates();
          }
        });
        view.focus();
      }

      function selectStates() {
        console.log('in selectstate');
      }

      click_ref.current = drawPoint;
      //document.getElementById('point-button').onclick = drawPoint;
    }
  }, []);

  return (
    &amp;lt;div className="mapDiv" ref={mapDiv}&amp;gt;
      &amp;lt;button
        id="point-button"
        className="esri-widget esri-widget--button esri-interactive"
        title="Select Countries"
        onClick={()=&amp;gt;click_ref.current()}
      &amp;gt;
        &amp;lt;span className="esri-icon-map-pin"&amp;gt;&amp;lt;/span&amp;gt;
      &amp;lt;/button&amp;gt;
    &amp;lt;/div&amp;gt;
  );
};

export default Map;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm getting error at line:128&amp;nbsp; and 143, since evt.native showing as undefined.&lt;/P&gt;&lt;P&gt;I'm using&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"@arcgis/core"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"^4.19.1"&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"react"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"^17.0.2"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 25 Jun 2021 05:51:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ctrl-mouse-click/m-p/1072451#M73619</guid>
      <dc:creator>Valgenmap</dc:creator>
      <dc:date>2021-06-25T05:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Ctrl + Mouse click</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ctrl-mouse-click/m-p/1072521#M73624</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/248401"&gt;@Valgenmap&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;There is no event native (just as the error is telling you) on the 'draw-complete' event. You would have to figure out how to use the view click event if you want to capture the mouse click event.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2022 12:48:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ctrl-mouse-click/m-p/1072521#M73624</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2022-03-28T12:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: Ctrl + Mouse click</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ctrl-mouse-click/m-p/1072525#M73625</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1104"&gt;@RobertScheitlin__GISP&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Can you provide any idea regarding the multi-selection of the features by holding 'CTRL' and click in React-ESRI app.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;ValgenMap&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jun 2021 03:40:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ctrl-mouse-click/m-p/1072525#M73625</guid>
      <dc:creator>Valgenmap</dc:creator>
      <dc:date>2021-06-28T03:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: Ctrl + Mouse click</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ctrl-mouse-click/m-p/1158255#M76815</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/248401"&gt;@Valgenmap&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1104"&gt;@RobertScheitlin__GISP&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please help me on this.&lt;/P&gt;&lt;P&gt;I'm receiving evt.native as 'undefined' while "CTRL + click" with &lt;A href="https://cpstest.pro/" target="_self"&gt;cps test&lt;/A&gt; on the featurelayer here is my code,&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;/* eslint-disable */
import React, { useRef, useEffect } from 'react';
import MapView from '@arcgis/core/views/MapView';
import WebMap from '@arcgis/core/Map';
import FeatureLayer from '@arcgis/core/layers/FeatureLayer';
import Draw from '@arcgis/core/views/draw/Draw';
import Graphic from '@arcgis/core/Graphic';
import GraphicsLayer from '@arcgis/core/layers/GraphicsLayer';
import Point from '@arcgis/core/geometry/Point';
import MultiPoint from '@arcgis/core/geometry/Multipoint';
import Search from '@arcgis/core/widgets/Search'

import '../../assets/css/map.css';

const Map = () =&amp;gt; {
  const mapDiv = useRef(null);
  const click_ref = useRef(null);

  useEffect(() =&amp;gt; {
    if (mapDiv.current) {
      /**
       * Initialize application
       */
      const pntGraphics = new GraphicsLayer();

      let renderer = {
        type: 'simple', // autocasts as new SimpleRenderer()
        symbol: {
          type: 'simple-fill', // autocasts as new SimpleFillSymbol()
          color: [255, 255, 255, 0.5],
          style: 'none',
          outline: {
            // autocasts as new SimpleLineSymbol()
            color: 'white',
            width: 2,
          },
        },
      };

      let drawPnt,
        graphic,
        ctrlKey = false,
        highlight,
        statesLyrView;

      const webmap = new WebMap({
        basemap: 'streets-vector',
      });

      const view = new MapView({
        container: mapDiv.current,
        map: webmap,
        center: [-98.43750059604514, 38.1986442207947],
        scale: 25000000,
        ui: {
          components: ['zoom', 'compass'],
        },
      });

      const searchWidget = new Search({
        view: view
      });

      view.ui.add(searchWidget, "top-right");

      const stateFeatureLayer = new FeatureLayer({
        url:
          'https://services2.arcgis.com/JoecHEvChY6qFe2m/arcgis/rest/services/USA_States/FeatureServer/0',
        outFields: ['*'],
      });

      const cityFeatureLayer = new FeatureLayer({
        url:
          'https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/0',
        outFields: ['*'],
      });

      webmap.addMany([stateFeatureLayer, cityFeatureLayer]);

      stateFeatureLayer.when(function () {
        view.whenLayerView(stateFeatureLayer).then(function (layerView) {
          statesLyrView = layerView;
        });
      });

      const draw = new Draw({
        view: view,
      });

      var sym = {
        type: 'simple-marker',
        style: 'circle',
        color: [0, 255, 255, 0.6],
        size: '8px',
        outline: {
          color: [0, 255, 255, 1],
          width: 1,
        },
      };

      view.ui.add('point-button', 'top-left');

      const drawPoint = () =&amp;gt; {
        console.log('in ');
        if (highlight) {
          highlight.remove();
        }
        const action = draw.create('point');
        action.on('cursor-update', function (evt) {
          view.graphics.removeAll();
          drawPnt = new Point({
            x: evt.coordinates[0],
            y: evt.coordinates[1],
            spatialReference: view.spatialReference,
          });
          graphic = new Graphic({
            geometry: drawPnt,
            symbol: sym,
          });
          view.graphics.add(graphic);
          /*if (ctrlKey &amp;amp;&amp;amp; !evt.native.ctrlKey) {
              draw.reset();
              view.graphics.removeAll();
              selectStates();
          }*/
        });
        action.on('draw-complete', function (evt) {
          if (evt.native.ctrlKey) {
            ctrlKey = true;
          } else {
            ctrlKey = false;
          }
          drawPnt = new Point({
            x: evt.coordinates[0],
            y: evt.coordinates[1],
            spatialReference: view.spatialReference,
          });
          graphic = new Graphic({
            geometry: drawPnt,
            symbol: sym,
          });
          pntGraphics.add(graphic);
          if (evt.native.ctrlKey) {
            drawPoint();
          } else {
            view.graphics.removeAll();
            selectStates();
          }
        });
        view.focus();
      }

      function selectStates() {
        console.log('in selectstate');
      }

      click_ref.current = drawPoint;
      //document.getElementById('point-button').onclick = drawPoint;
    }
  }, []);

  return (
    &amp;lt;div className="mapDiv" ref={mapDiv}&amp;gt;
      &amp;lt;button
        id="point-button"
        className="esri-widget esri-widget--button esri-interactive"
        title="Select Countries"
        onClick={()=&amp;gt;click_ref.current()}
      &amp;gt;
        &amp;lt;span className="esri-icon-map-pin"&amp;gt;&amp;lt;/span&amp;gt;
      &amp;lt;/button&amp;gt;
    &amp;lt;/div&amp;gt;
  );
};

export default Map;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm getting error at line:128&amp;nbsp; and 143, since evt.native showing as undefined.&lt;/P&gt;&lt;P&gt;I'm using&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"@arcgis/core"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"^4.19.1"&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"react"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"^17.0.2"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;HR /&gt;&lt;P&gt;Is this code snippet working for anyone? I am not able to get it to run at all. A little noob here, please help.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2022 05:46:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ctrl-mouse-click/m-p/1158255#M76815</guid>
      <dc:creator>NickIrwin</dc:creator>
      <dc:date>2022-03-28T05:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: Ctrl + Mouse click</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ctrl-mouse-click/m-p/1158337#M76825</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/573610"&gt;@NickIrwin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In 4.13 the draw action had a native property. I am not sure when it was removed but now in 4.23 there is no native property returned in the DrawAction. I mentioned this above to vlagebmap back on&amp;nbsp;&lt;SPAN&gt;‎06-25-2021.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is what it would look like in 4.23 (vanilla JS)&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;

&amp;lt;head&amp;gt;
  &amp;lt;meta charset="utf-8" /&amp;gt;
  &amp;lt;meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" /&amp;gt;
  &amp;lt;title&amp;gt;Select by Point&amp;lt;/title&amp;gt;

  &amp;lt;link rel="stylesheet" href="https://js.arcgis.com/4.23/esri/themes/light/main.css" /&amp;gt;
  &amp;lt;script src="https://js.arcgis.com/4.23/"&amp;gt;&amp;lt;/script&amp;gt;

  &amp;lt;style&amp;gt;
    html,
    body,
    #viewDiv {
      padding: 0;
      margin: 0;
      height: 100%;
      width: 100%;
    }
  &amp;lt;/style&amp;gt;
  &amp;lt;script&amp;gt;
    require([
      "esri/views/draw/Draw",
      "esri/Map",
      "esri/Graphic",
      "esri/layers/GraphicsLayer",
      "esri/layers/FeatureLayer",
      "esri/geometry/Point",
      "esri/geometry/Multipoint",
      "esri/views/MapView"
    ], function (Draw, Map, Graphic, GraphicsLayer, FeatureLayer, Point, Multipoint, MapView) {
      const pntGraphics = new GraphicsLayer();
      let viewClickEvtHandler = null, viewMouseMoveEvtHandler = null;
      var renderer = {
          type: "simple", // autocasts as new SimpleRenderer()
          symbol: {
            type: "simple-fill", // autocasts as new SimpleFillSymbol()
            color: [255, 255, 255, 0.5],
            style: "none",
            outline: {  // autocasts as new SimpleLineSymbol()
              color: "white",
              width: 2
            }
          }
        };
      const statesLyr = new FeatureLayer({
        url: 'https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/2',
        renderer: renderer,
        outFields: ['*']
      });

      const cityFeatureLayer = new FeatureLayer({
        url: 'https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/0',
        outFields: ['*'],
      });

      let drawPnt, graphic, ctrlKey = false, moveCtrlKey = false, highlight, statesLyrView;

      const map = new Map({
        basemap: 'streets-vector',
        layers: [pntGraphics, statesLyr, cityFeatureLayer]
      });

      const view = new MapView({
        container: "viewDiv",
        map: map,
        center: [-98.43750059604514, 38.1986442207947],
        scale: 25000000,
        ui: {
          components: ['zoom', 'compass'],
        }
      });

      statesLyr.when(function(){
        view.whenLayerView(statesLyr).then(function(layerView) {
          statesLyrView = layerView;
        });
      })

      const draw = new Draw({
        view: view
      });

      var sym = {
        type: "simple-marker",
        style: "circle",
        color: [0, 255, 255, 0.6],
        size: "8px",
        outline: {
          color: [0, 255, 255, 1],
          width: 1
        }
      };

      view.ui.add("point-button", "top-left");

      document.getElementById("point-button").onclick = drawPoint;

      function drawPoint() {
        if(viewMouseMoveEvtHandler){
          viewMouseMoveEvtHandler.remove()
          viewMouseMoveEvtHandler = null
        }
        if(viewClickEvtHandler){
          viewClickEvtHandler.remove()
          viewClickEvtHandler = null
        }
        const action = draw.create("point");
        viewMouseMoveEvtHandler = view.on('pointer-move', (evt) =&amp;gt; {
          if (evt.native.ctrlKey) {
            moveCtrlKey = true;
          }else{
            moveCtrlKey = false;
          }
        })
        viewClickEvtHandler = view.on('pointer-down', (evt)=&amp;gt;{
          if (evt.native.ctrlKey) {
            ctrlKey = true;
          }else{
            ctrlKey = false;
          }
        })
        if (highlight) {
          highlight.remove();
        }
  
        // Give a visual feedback to users as they move the pointer over the view
        action.on("cursor-update", function (evt) {
          view.graphics.removeAll();
          drawPnt = new Point({
            x: evt.coordinates[0],
            y: evt.coordinates[1],
            spatialReference: view.spatialReference
          });
          graphic = new Graphic({
            geometry: drawPnt,
            symbol: sym
          });
          view.graphics.add(graphic);
          if(ctrlKey &amp;amp;&amp;amp; !moveCtrlKey){
            draw.reset();
            view.graphics.removeAll();
            selectStates();
          }
        });

        action.on("draw-complete", function (evt) {
          drawPnt = new Point({
            x: evt.coordinates[0],
            y: evt.coordinates[1],
            spatialReference: view.spatialReference
          });

          graphic = new Graphic({
            geometry: drawPnt,
            symbol: sym
          });
          pntGraphics.add(graphic);
          if (ctrlKey) {
            drawPoint();
          } else {
            view.graphics.removeAll();
            selectStates();
          }
        });
        view.focus();
      };

      function selectStates(){
        ctrlKey = false
        moveCtrlKey = false
        if(viewMouseMoveEvtHandler){
          viewMouseMoveEvtHandler.remove()
          viewMouseMoveEvtHandler = null
        }
        if(viewClickEvtHandler){
          viewClickEvtHandler.remove()
          viewClickEvtHandler = null
        }
        let mp = new Multipoint({
          spatialReference: view.spatialReference
        });
        let pntArray = pntGraphics.graphics.map(function(gra){
          mp.addPoint(gra.geometry);
        });
        
        const query = {
          geometry: mp,
          outFields: ["*"],
          outSpatialReference: view.spatialReference,
          returnGeometry: true
        };
        statesLyr.queryFeatures(query)
        .then(function(results){
          const graphics = results.features;
          // remove existing highlighted features
          if (highlight) {
            highlight.remove();
          }

          // highlight query results
          highlight = statesLyrView.highlight(graphics);
          pntGraphics.removeAll();
        }).catch(function(err){
          console.error(err);
        })
      }
    });
  &amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;
  &amp;lt;div id="viewDiv"&amp;gt;
    &amp;lt;div id="point-button" class="esri-widget esri-widget--button esri-interactive" title="Select Countries"&amp;gt;
      &amp;lt;span class="esri-icon-map-pin"&amp;gt;&amp;lt;/span&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;

&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2022 14:06:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ctrl-mouse-click/m-p/1158337#M76825</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2022-03-28T14:06:20Z</dc:date>
    </item>
  </channel>
</rss>

