Need help to get a screen capture of a mapbox map on iOS



I have tried in 2 days to find a way to get a screen capture of a map (plugin MAPBOX) via the plugin Nativescript Screenshot. I am not able to figure out what to put between the parenthesis:

onbuttonTap() {
  this.img.imageSource = plugin.getImage(??????);
  this.folder = fs.knownFolders.documents();
  this.path = fs.path.join(this.folder.path, "xxx.png");
  this.saved = this.img.imageSource.saveToFile(this.path, "png");

Any suggestions or another way to do this?


plugin.getImage accepts a view. So you can just pass in the view of the mapbox component and it will create an image of that portion of the screen.

In Angular you can use a ViewChild look-up, in regular NativeScript you can use page.getViewById to look-up that container.


Thanks Sean,

I have really tried all items on the html and ViewChild, but I cannot find any view that is accepted by the plugin.getimage.
I am fairly new to angular and nativescript and normally I manage to figure out how to do stuff, but this one was tricky. Maybe I have misinterpreted what a view is?

Do you have a working example?