-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MapView.Marker Image resizes 3x bigger after CodePush #1276
Comments
Thanks for reporting! Thanks, |
Hi @alexandergoncharov ! thanks for answering. Unfortunately, we're not able to create a test project (configure react-native-maps + configure react-native-code-push with new keys etc) since it will take several hours and we don't that time right now. The issue is related only with the prop Until is fixed, is there any way to 'ignore' assets or certain code to not be updated via code-push? Because we can't use code-push since it makes Maps unusable and we really want to use it. Thanks again @alexandergoncharov and team! |
If it helps: we found that if we pass an Unfortunately we can not use this since react-native-maps has a known bug that on Android if you pass an So we can only use the image prop for rendering marker custom images. Thanks! |
+1. |
Hi @gonzaloreciog , About ignoring assets: I'm not sure about ignoring but You can use Thanks, |
We are facing same issue. |
Hi guys, directory structure after adding images:
For more info about react-native images please check docs: https://facebook.github.io/react-native/docs/images.html Please, try the solution and let us know if it was helpful. |
Hi @PackZhang, did you try the solution with adding @2x and @3x images as I described here |
@NickToropov |
@PackZhang could you please provide us with sample app that reproduces the issue? |
Hi guys, @PackZhang, @gonzaloreciog, can anyone create a sample app that reproduces this issue? |
Hi all! I've created a demo app - Issue1276.zip
Expected: image on map should retain its sizes Please, let me know if the issue is reproduced on the demo or make changes in it to reproduce the issue. |
+1 |
Hi guys, @PackZhang, @gonzaloreciog, could you let me know if you have a chance to look at my comment above |
@NickToropov Does this one work for iOS as well? Because I copied your code over my project and it still produce the same error on Production of iOS. |
@phatlaunchdeck, I tested on Android as @gonzaloreciog specified that issue is reproduced on both Android and iOS. Will test it with iOS and come back a bit later. |
Hi guys! try to use the following workaround:
It should work for both iOS and Android. Please let me know if it works for you. |
Hi all, I'll close this issue for now as there is no activity here. If anyone still faces the issue and suggested workaround doesn't solve the problem please reopen this one. |
Hi @NickToropov , I tried the above solution with Image component you gave us. It did work on Android but only in Debug mode, not Release. |
Hey, just did a fresh reinstall of our application, and am getting this issue as well. "react-native": "0.56.0-rc.3",
"react-native-maps": "0.21.0",
"react-native-code-push": "5.3.5", This is definitely a new bug as it did not happen before our rebuild. I have confirmed i have @2x and @3x respective resolutions of the marker images. |
Okay, so in this thread I see a few people report they have issues with Android-production-only Image marker fix not working. Now first lemme say I don't like this solution, and hope that this isn't the accepted fix, but a solution that works for me: In the production build, Android doesn't seem to know that the files are being referenced as source for the marker images when inside a marker component. <Image source={require('./icons/emptypin.png')} style={{ width: 0, height: 0 }} />
<Image source={require('./icons/greenpin.png')} style={{ width: 0, height: 0 }} />
<Image source={require('./icons/youarehere.png')} style={{ width: 0, height: 0 }} /> Putting every marker we used as a regular ol' image in the app near our map view (anywhere really) gets the job done on Production Android build. Then on my marker components I was able to reference them as usual: <Marker onPress={this.handlePress} coordinate={coordinate}>
<ImageBackground style={{ width: 30, height: 30 }} source={icons[active ? 'active' : 'inactive']}>
<Text style={styles.text} white={!active}>{children}</Text>
</ImageBackground>
</Marker> Both the ImageBackground component and the Image component seemed to work 👌 |
I also having this problem with following usage;
"react-native-code-push": "^5.3.5" |
Any development or workarounds ? I tried with bundling manually without assets and releasing update with --update-contents-path but that removed all images from app. |
Might related to images' |
Hi @gonzaloreciog, @sercanov, @deehuey, My Steps to reproduce:
Solution:
Can you guys try this solution and reply if it helped? |
I tried the solution and it worked perfectly. Thanks. Is there any open PR or discussion on react-native side ? P.S. I also used patch-package to simplify the patching process |
Hi @sercanov, |
Hi guys! I'm going to close this issue for now as it's not related to CodePush and there is a workaround provided by @yuri-kulikov. |
Hey guys, a fix has been merged into master in the React Native project. You can create a patch file from the following diff: https://patch-diff.githubusercontent.com/raw/facebook/react-native/pull/23446.diff |
Steps to Reproduce
<MapView.marker />
(react-native-maps) and pass an image as a prop:image={require("ourproject/src/images/1.png")}
Expected Behavior
Images should maintain same size with and without Codepush update.
Actual Behavior
After Codepush update the MapView images get resized like 3-4x times bigger.
See screenshots comparison:
Fresh release without CodePush: 👇
CodePush update: 👇
Environment
Happens on Staging + Production
Both
Thanks! Would be awesome to know how to fix this.
The text was updated successfully, but these errors were encountered: