我正在尝试使用需要上下文来实例化 UI 对象的本机映射库,我该如何传递它?
native 函数是 android.view.View 的扩展,它需要的参数是一个 Context。
例子.vue:
<template>
<Page class="page">
<StackLayout>
<Placeholder @creatingView="creatingView"/>
</StackLayout>
</Page>
</template>
<script>
export default {
methods: {
creatingView(args){
//This is where I need the context as a parameter
const nativeView = new com.esri.arcgisruntime.mapping.view.MapView(this.context);
args.view = nativeView;
}
}
};
</script>