如何在runtime 100.1 中freehand draw
@Override <SPAN class="keyword token">protected</SPAN> <SPAN class="keyword token">void</SPAN> <SPAN class="token function">onCreate</SPAN><SPAN class="punctuation token">(</SPAN>Bundle savedInstanceState<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">super</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">onCreate</SPAN><SPAN class="punctuation token">(</SPAN>savedInstanceState<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="token function">setContentView</SPAN><SPAN class="punctuation token">(</SPAN>R<SPAN class="punctuation token">.</SPAN>layout<SPAN class="punctuation token">.</SPAN>activity_main<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> MapView mapView <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>MapView<SPAN class="punctuation token">)</SPAN> <SPAN class="token function">findViewById</SPAN><SPAN class="punctuation token">(</SPAN>R<SPAN class="punctuation token">.</SPAN>id<SPAN class="punctuation token">.</SPAN>mapView<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> ArcGISMap map <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">ArcGISMap</SPAN><SPAN class="punctuation token">(</SPAN>Basemap<SPAN class="punctuation token">.</SPAN>Type<SPAN class="punctuation token">.</SPAN>DARK_GRAY_CANVAS_VECTOR<SPAN class="punctuation token">,</SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">4</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> mapView<SPAN class="punctuation token">.</SPAN><SPAN class="token function">setMap</SPAN><SPAN class="punctuation token">(</SPAN>map<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> SketchEditor sketchEditor <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">SketchEditor</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> mapView<SPAN class="punctuation token">.</SPAN><SPAN class="token function">setSketchEditor</SPAN><SPAN class="punctuation token">(</SPAN>sketchEditor<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> sketchEditor<SPAN class="punctuation token">.</SPAN><SPAN class="token function">start</SPAN><SPAN class="punctuation token">(</SPAN>SketchCreationMode<SPAN class="punctuation token">.</SPAN>FREEHAND_LINE<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
This is a basic implementation. It may require additional configuration on your end to suit your needs.
Thank you very much
But I found sketch conflict with mapview's DefaultMapViewOnTouchListener
Yes, I noticed this too and believe this may be part of the design. I will have to speak with my team regarding this.
If you are okay with me asking, there may be another solution for what you are attempting to do. Is there something you were hoping to do with the touch listener?
I want to do a military plotting function
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.