How to freehand draw in runtime 100.1

786
6
07-13-2017 02:54 AM
wusheng
New Contributor

如何在runtime 100.1 中freehand draw

Tags (1)
0 Kudos
6 Replies
AlexanderNohe1
Occasional Contributor III
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        MapView mapView = (MapView) findViewById(R.id.mapView);
        ArcGISMap map = new ArcGISMap(Basemap.Type.DARK_GRAY_CANVAS_VECTOR, 0, 0, 4);
        mapView.setMap(map);

        SketchEditor sketchEditor = new SketchEditor();

        mapView.setSketchEditor(sketchEditor);
        sketchEditor.start(SketchCreationMode.FREEHAND_LINE);
    }

This is a basic implementation.  It may require additional configuration on your end to suit your needs.

wusheng
New Contributor

Thank you very much

0 Kudos
wusheng
New Contributor

But I found sketch conflict with mapview's DefaultMapViewOnTouchListener

0 Kudos
AlexanderNohe1
Occasional Contributor III

Yes, I noticed this too and believe this may be part of the design.  I will have to speak with my team regarding this.

0 Kudos
AlexanderNohe1
Occasional Contributor III

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?

0 Kudos
wusheng
New Contributor

I want to do a military plotting function

0 Kudos