Select to view content in your preferred language

How to freehand draw in runtime 100.1

978
6
07-13-2017 02:54 AM
wusheng
Emerging Contributor

如何在runtime 100.1 中freehand draw

Tags (1)
0 Kudos
6 Replies
AlexanderNohe1
Honored Contributor
    @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
Emerging Contributor

Thank you very much

0 Kudos
wusheng
Emerging Contributor

But I found sketch conflict with mapview's DefaultMapViewOnTouchListener

0 Kudos
AlexanderNohe1
Honored Contributor

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
Honored Contributor

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
Emerging Contributor

I want to do a military plotting function

0 Kudos