osm_flutter icon indicating copy to clipboard operation
osm_flutter copied to clipboard

Icon Marker Size in iOS

Open liodali opened this issue 3 years ago • 16 comments

it seems that icon marker in iOS doesn't follow the size put in flutter side,

  • [x] fix size of icon
  • [x] if their is no size define in flutter size keep the same behaviour

liodali avatar Jan 18 '22 18:01 liodali

Yes on, the android side, most phone have the option to change the resolution of the screen, like HD (1480 x 720, FHD+(2220 X 1080) WQHD+ (2960 X1440), Every time you change the resolution the icon size will also change making it too tiny on higher resolution. This behavior only happens with custom icons. Edit: the default icon og arrow and yellow person size dont change.

jesussmile avatar Jan 20 '22 13:01 jesussmile

yeah for default icon they stay the same because they built nativaly not like custom icon I built them in flutter and after that i send them to native to native view , but i didn't notice that for custom icon in android that I will check it also

liodali avatar Jan 21 '22 11:01 liodali

I am using widgets(because user profile pic is part of the marker with some status icon) as icon and in iOS its really small. android its ok

vmwsree avatar Jul 27 '22 13:07 vmwsree

i will fix that sorry the problem in ios that size should be defined in the marker not like android i can use drawable i will make it bigger for now until i implement my solution for size icon i will try to fix it in the next week

liodali avatar Jul 27 '22 13:07 liodali

check the new version 0.39.0

liodali avatar Aug 11 '22 20:08 liodali

IMG_F90546A50310-1

tried is doesn't seem to work. my file is in .png format. tested it in real device.

jesussmile avatar Aug 12 '22 01:08 jesussmile

Screen Shot 2022-08-12 at 8 09 33 AM

Seema to work only on simulators

jesussmile avatar Aug 12 '22 02:08 jesussmile

try to use iconWidget and put asset in sizedbox widget

liodali avatar Aug 12 '22 06:08 liodali

this is my code

 userLocationMarker: UserLocationMaker(
            personMarker: MarkerIcon(
              assetMarker:
                  AssetMarker(image: AssetImage("images/images/car-ios.png")),
            ),
            directionArrowMarker: MarkerIcon(
              assetMarker:
                  AssetMarker(image: AssetImage("images/images/car-ios.png")),
            ),
          ),

I tried many ways, how do u want me to do it ?

jesussmile avatar Aug 13 '22 04:08 jesussmile

try this example

MarkerIcon(
       iconWidget:  Image.asset(
                      "images/images/car-ios.png",
                      width: 24,
                      height: 32,
                  ),
),

liodali avatar Aug 13 '22 09:08 liodali

I did! what happens is when I run the app ,for a second the size will change but then again to back to some weird size again. I think when the user location changes the size also change back to default.

jesussmile avatar Aug 16 '22 04:08 jesussmile

that wierd the problem that now i cannot test on my iphone ( don't adapter for my old iphone :disappointed: ) but i will re-check the logic of the marker when location changes i will make sure to fix this problem soon sorry for that

liodali avatar Aug 16 '22 18:08 liodali

C UumbSent from my Galaxyxb b -------- Original message --------From: hamza mohamed alin @.> Date: 8/16/22 23:54 (GMT+05:45) To: liodali/osm_flutter @.> Cc: jesussmile @.>, Comment @.> Subject: Re: [liodali/osm_flutter] Icon Marker Size in iOS (Issue #216)

that wierd the problem that d now i cannot test on my iphone ( don't adapter for my old iphone 😞 )

but i will re-check the logic of the marker when location changes

i will make sure to fix this problem soon sorry for that

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

jesussmile avatar Aug 17 '22 00:08 jesussmile

yeah i notice that problem i will why that is happen

liodali avatar Aug 21 '22 10:08 liodali

i will publish fix for that tonight

liodali avatar Aug 21 '22 15:08 liodali

I used a very creative way to fix the size across multiple devices: https://www.edoardovignati.it/constant-size-of-a-widget-across-multiple-devices-and-screen-resolutions-in-flutter/

EdoardoVignati avatar Jul 30 '23 12:07 EdoardoVignati