-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Need Style for Marker image #1167
Comments
Currently you can put Image component as children of Marker to add custom style. |
+1 |
Why do you need to change marker image size? |
@christopherdro I think we can close it as it's old and out of scope of the library, nor in the roadmap or refers to bugs in other libs. |
If you say to me that has another kind of solution better or replaceable I close it myself. Because I think this is necessary. The costumization option. |
Why do you need to change marker image size? I had tested at the time a map that I did in RN with this lib. And it featured distinct sizes in different simulators. And different smartphones. Some he burst and the others size he looked normal. So if you have anything that can keep the ratio of the marker would be great. Proportion is important. |
So, you can't set image width in native marker. The image is used as is and that is documented native behavior. |
@alvelig as we cannot set the image width or height in the native marker, do I need to simply recreate the image at the different pixel densities for the @2x and @3x images? For example, save the image at 480 DPI for @3x, and at 320 DPI for the @2x versions? I am trying to clarify this as I have tested the @3x image structure (as referenced here) which does select the @3x image correctly on my LG Nexus 5, but displays it at full size (300 x 300) rather than the intended 100 x 100 as there are obviosuly no size dimensions set on the native marker. Recreating the image at the correct DPI for the @2x and @3x appears to work. Please see the screenshot below. |
@SKempin Check naming and pixels. It should work. You can try to check it in android emulators to see if this is device specific (it happens). Naming should be according to this specs (see @4x for android): https://developer.android.com/images/screens_support/devices-density_2x.png |
@alvelig This doesn't work without a Creating images at the relevant DPI's does work (as illustrated above) it seems, but simply creating the same image three times larger results in it displaying three times larger (as in the blue square on the example). |
If you have a square image files like this:
it MUST give you 100x100 picture on hdpi, xdpi, xxdpi and xxxdpi devices accordingly. If it doesn't, please make a test project to reproduce your problem and mention models and resolutions you've tried. |
@alvelig This does not happen. I am using an LG Nexus 5 (real device). Unfortunately I don't have time to create a test project currently, but I experience the same issues with standard |
So, first that's a react-native issue, not react-native-maps one. Second, I recently used the same technique for my project to have a complex marker with an image and it works perfectly. I bet that if you take time and make a simple project with one marker (it should take 15 minutes or so), I'll find a problem in your code. :) And third, also test it on the emulator with corresponding resolution to see that it works (or doesn't and there . |
@alvelig I will attempt to make a project tomorrow and share with you, thanks. Was the image a child of the marker or the prop of the marker in your project? Thanks |
prop:
I had to make 7 images (3 ios and 4 android) to fit this marker, because of differences in ios and android. But that was because of the complexity of the marker that's why I had to use image, otherwise I would have done it with views. |
@alvelig I've now created the demo repo and I'm still getting the same results on my LG Nexus 5. As you can see in the screenshot, the @3x image is correctly being chosen but it is displaying at 300 x 300, since the native marker cannot have a I haven't been able to test on any emulators as of yet. Thanks and I look forward to seeing what results you get. |
@SKempin it doesn't let me open it :) Please, can you check permissions for the project? |
@alvelig Please try again now - https://github.com/SKempin/markers-demo Thanks |
Add this marker:
Analyse :) P.S. I'm not happy that the images are not exact as the box. But that's how they appear somehow on Android. |
@alvelig Thanks very much. I understand now - basically I shouldn't have been judging the dimensions from the original 100 x 100 image, as your So to clarify, what size would you advise a marker image to be generally? The original image size, not the @3x or @4x size (I will scale the image up for these)? |
@alvelig thanks for your helpful responses. Isn't @1x for mdpi, @1.5x for hdpi, and so on? Or is PixelRatio something different? Here is reference to PixelRatio: The whole numbers (@1x, @2x, @3x, @4x) are straightforward. How would we represent the decimal densities like an image for @1.5x, @3.5x? I am guessing we can't just store an image like test@1.5x.png. If we can't store the decimal images like 1.5 and 3.5, would this mean those phones would find the nearest image (like 2 or 3)? |
The
<image>
from RN have bugs while updating the markes. We need something more "native" from the Map module.P.S. Things like control the Size.
Best Regards
The text was updated successfully, but these errors were encountered: