Giter Club home page Giter Club logo

Comments (12)

elliotstokes avatar elliotstokes commented on July 26, 2024 2

I've done a bit of digging and have come up with a possible solution.

You need to grab all the textureviews contained within that view and then render them on top of the base bitmap using a canvas.

Solution can be found within this thread (fastlane/fastlane#2081). I've tried it out and I'm correctly seeing my map image.

from react-native-view-shot.

alvarolorentedev avatar alvarolorentedev commented on July 26, 2024 1

hello sorry for the delay in getting back here but i had a crazy week. I think is a good thing to try, if you want i am cloning and doing some tests to see if i can create a PR 👍 , let me know if any of you is doing the same so we dont overlap 😛

from react-native-view-shot.

alvarolorentedev avatar alvarolorentedev commented on July 26, 2024 1

well i can see the map now :) with this commit https://github.com/kanekotic/react-native-view-shot/commit/fab00971c1da74ae9ad1a2e09d939e2740821c6f , the view is missaligned when I export but I will try to solve that ... but seems a good direction to solve this 😄

from react-native-view-shot.

alvarolorentedev avatar alvarolorentedev commented on July 26, 2024 1

so I have been putting a bit of time on this, but still having issues, the problem is how to combine different layers in the bitmap, specifically what areas are going to be ignored, also the layering seem a bit complex. I will keep you guys posted.

meanwhile I find a small workaround for maps that could interest you @elliotstokes and is set the property cacheEnabled to true in the MapView to get the map as an image (it works for me, I have not tried it to change it on the fly).

from react-native-view-shot.

gerardus1995 avatar gerardus1995 commented on July 26, 2024 1

Yes it works! Thanks!

from react-native-view-shot.

elliotstokes avatar elliotstokes commented on July 26, 2024

Hey. I'm seeing the same issue (android only). I'm guessing it's something to do with the way the maps are rendered.

from react-native-view-shot.

gre avatar gre commented on July 26, 2024

this might be somehow related to the same problem appearing for WebView ( #34 ) . there are probably some kind of View like OpenGL View that are not friendly with current implementation of snapshotting. I'm wondering if it's solvable and i would be happy if anyone want to investigate.

it would be good to have somewhere a test app that test bunch of different kind of view, so we can easily test things and do a checklist of things supported per platform.

from react-native-view-shot.

gre avatar gre commented on July 26, 2024

mmh that's very promising! do you think it can be done generically on a View?

from react-native-view-shot.

gre avatar gre commented on July 26, 2024

yeah feel free to do this and get a PR! that would be awesome =)

I guess we'll eventually need to investigate the same for iOS, but ok for now to just focus on android

from react-native-view-shot.

gre avatar gre commented on July 26, 2024

https://github.com/gre/react-native-view-shot-example now includes a react-native-maps example. it seems to work on iOS but I can reproduce the problem for Android.

from react-native-view-shot.

gerardus1995 avatar gerardus1995 commented on July 26, 2024

Yes, on Android still i see a black snapshot with only the google logo.

from react-native-view-shot.

gre avatar gre commented on July 26, 2024

@gerardus1995 what about this https://github.com/airbnb/react-native-maps#take-snapshot-of-map ?

if that lib can do the snapshotting instead, we will close that issue.

from react-native-view-shot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.