If anyone is interested, we've built a freehand draw tool for the JavaScript 4.0 API. GitHub repo:
GitHub - kingy68/esri-javascript-draw-4
Can be extended/changed to handle other shapes pretty easily, we only needed freehand draw.
Note: this is only an interim solution until the proper draw tools are released, it is not being developed further/supported.
Hi Jordan,
Thanks for your update. I thought you might have some inside news about it. Let's wait for the next version then.
Regards,
Jing
Hey J W,
I haven't been able to find gestureManager as an object of the View at 4.2. My guess is that Esri Inc. have wrapped this functionality up into the inputManager. At this stage, it looks like they are still changing the inputManager design (it has changed from 4.0, 4.1 to 4.2), hence the need to keep finding new ways to disable the map controls.
I've only sat down looking at the inputManager at 4.2 for about 30 minutes or so, and the handlers seemed like the easiest way to control the map controls so far. If you think there is a better way, then submit some changes to the repo above with a pull request and I'll take a look (or someone from Esri Inc. might be able to provide some insights here!).
Cheers,
Jordan
With 4.2 API, instead of using the handlers of "view.container", is there anyway to use something like "gestureManager" or "inputManager" for the 2D view? Thanks,
Hi All,
I've updated the repo in the original post to work with the 4.2 API.
Never mind, I figured that out. It was view.gestureManager.inputManager.gestures["double-click"].options.enable = false;
Is there a way to disable double-click? I wanted to disable double click as well but I couldn't find any API reference.
Thanks.
Thank you. It works fine for me.
Do you have a workaround for the projection problem?
https://community.esri.com/thread/184034-graphics-not-displayed-in-js-api-41-with-custom-projection-works-in-40
Hey,
Just an update on this, I have noticed that you will get odd behaviour if using touch screens with the above properties. To get around it, you can use these instead:
view<SPAN class="punctuation token">.</SPAN>gestureManager<SPAN class="punctuation token">.</SPAN>inputManager<SPAN class="punctuation token">.</SPAN>gestures<SPAN class="punctuation token">.</SPAN>drag<SPAN class="punctuation token">.</SPAN>options<SPAN class="punctuation token">.</SPAN>enable <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">false</SPAN><SPAN class="punctuation token">;</SPAN> view<SPAN class="punctuation token">.</SPAN>gestureManager<SPAN class="punctuation token">.</SPAN>inputManager<SPAN class="punctuation token">.</SPAN>gestures<SPAN class="punctuation token">.</SPAN>altdrag<SPAN class="punctuation token">.</SPAN>options<SPAN class="punctuation token">.</SPAN>enable <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">false</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN></SPAN>
Thanks. I saw this method in your JavaScript file. It works well.
View.gestureManager.inputManager.manager.options.enable = false
That should disable all gestures on the Map View object. Then setting that same property to true, will enable it again.
See how that goes.
Thanks. Is there any easy way to disable map's navigation in version 4.1?
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.