<?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 How to prevent a user from dropping a marker/pin/point on to a map if the map is zoomed out? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-prevent-a-user-from-dropping-a-marker-pin/m-p/493111#M45801</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 have a map that allows a user to drop a pin/point.marker on to it.&amp;nbsp; Now what I want is to prevent a user from dropping a pin if the map is zoomed out, for example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if(view.zoom &amp;gt;=11)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//allow the user to drop pin&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;alert("please zoom in");&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where would I implement this if/else statement on the following code:&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; &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; console.log("X = ", evt.graphic.geometry.x);&lt;BR /&gt; console.log("Y = ", evt.graphic.geometry.y);&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;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Feb 2020 12:29:04 GMT</pubDate>
    <dc:creator>SiyabongaKubeka</dc:creator>
    <dc:date>2020-02-26T12:29:04Z</dc:date>
    <item>
      <title>How to prevent a user from dropping a marker/pin/point on to a map if the map is zoomed out?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-prevent-a-user-from-dropping-a-marker-pin/m-p/493111#M45801</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 have a map that allows a user to drop a pin/point.marker on to it.&amp;nbsp; Now what I want is to prevent a user from dropping a pin if the map is zoomed out, for example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if(view.zoom &amp;gt;=11)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//allow the user to drop pin&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;alert("please zoom in");&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where would I implement this if/else statement on the following code:&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; &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; console.log("X = ", evt.graphic.geometry.x);&lt;BR /&gt; console.log("Y = ", evt.graphic.geometry.y);&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Feb 2020 12:29:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-prevent-a-user-from-dropping-a-marker-pin/m-p/493111#M45801</guid>
      <dc:creator>SiyabongaKubeka</dc:creator>
      <dc:date>2020-02-26T12:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to prevent a user from dropping a marker/pin/point on to a map if the map is zoomed out?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-prevent-a-user-from-dropping-a-marker-pin/m-p/493112#M45802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This should work.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;      sketch&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;on&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'create'&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;evt&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;view&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;zoom &lt;SPAN class="operator token"&gt;&amp;gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;11&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
          &lt;SPAN class="comment token"&gt;//allow the user to drop pin&lt;/SPAN&gt;
          console&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;log&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"X = "&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; evt&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;x&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
          console&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;log&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Y = "&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; evt&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;y&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;else&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
          &lt;SPAN class="token function"&gt;alert&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"please zoom in"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
          evt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;graphic&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;layer&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;evt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;graphic&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="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;/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>Sat, 11 Dec 2021 21:42:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-prevent-a-user-from-dropping-a-marker-pin/m-p/493112#M45802</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T21:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to prevent a user from dropping a marker/pin/point on to a map if the map is zoomed out?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-prevent-a-user-from-dropping-a-marker-pin/m-p/493113#M45803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much Robert.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2020 10:35:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-prevent-a-user-from-dropping-a-marker-pin/m-p/493113#M45803</guid>
      <dc:creator>SiyabongaKubeka</dc:creator>
      <dc:date>2020-02-27T10:35:57Z</dc:date>
    </item>
  </channel>
</rss>

