导包在项目目录下build.gradle内添加
maven {url 'https://esri.bintray.com/arcgis'}
导包在app目录下的build.gradle内添加
implementation 'com.esri.arcgisruntime:arcgis-android:100.8.0'
在onCreate中调用地图的setOnTouchListener函数具体代码如下
mMapView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
showImageAtMap(R.drawable.map_start, motionEvent);
return false;
}
});
private void showImageAtMap(int res, MotionEvent e) {
BitmapDrawable startDrawable = (BitmapDrawable) ContextCompat.getDrawable(getContext(), res);
final PictureMarkerSymbol pinSourceSymbol;
try {
pinSourceSymbol = PictureMarkerSymbol.createAsync(startDrawable).get();
pinSourceSymbol.loadAsync();
pinSourceSymbol.addDoneLoadingListener(new Ru