liodali / osm_flutter

OpenStreetMap plugin for flutter
https://pub.dev/packages/flutter_osm_plugin
MIT License
228 stars 95 forks source link

Icon Marker Size in iOS #216

Open liodali opened 2 years ago

liodali commented 2 years ago

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

jesussmile commented 2 years ago

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.

liodali commented 2 years ago

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

vmwsree commented 2 years ago

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

liodali commented 2 years ago

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 commented 2 years ago

check the new version 0.39.0

jesussmile commented 2 years ago

IMG_F90546A50310-1

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

jesussmile commented 2 years ago
Screen Shot 2022-08-12 at 8 09 33 AM

Seema to work only on simulators

liodali commented 2 years ago

try to use iconWidget and put asset in sizedbox widget

jesussmile commented 2 years ago

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 ?

liodali commented 2 years ago

try this example

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

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.

liodali commented 2 years ago

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

jesussmile commented 2 years ago

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: @.***>

liodali commented 2 years ago

yeah i notice that problem i will why that is happen

liodali commented 2 years ago

i will publish fix for that tonight

EdoardoVignati commented 1 year ago

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/