themronion / Maui.GoogleMaps

Map library for MAUI using Google maps API
https://www.nuget.org/packages/Onion.Maui.GoogleMaps/
MIT License
79 stars 35 forks source link

Document Using MauiImage As Pin #13

Closed T-T-P closed 1 year ago

T-T-P commented 1 year ago

SUMMARY

There does not currently appear to be any details or documentation of how to use "MauiImage" as a pin for the map, only stream or embedded resources seems to work as was the case in the Xamarin repository that was forked from.

DETAILS

Please could an example and/or documentation be created for using the "MauiImage" type as a pin on the map? This may require changes to the Maui.GoogleMaps package?

PLATFORMS

themronion commented 1 year ago

A MauiImage in the end is nothing else but a .png in the native resources folders. The sample repo has MauiImage usage examples - image01, image02, image03. Please use BitmapDescriptorFactory.FromBundle()

T-T-P commented 1 year ago

Apologies @themronion I missed that part of the sample. Could I ask, is there any way to resize the icon (width/height) when using FromBundle() as it doesn't automatically resize in the same way that FromStream() does when using an EmbeddedResource?

themronion commented 1 year ago

U can specify the size in the MauiImage tag in the csproj, that will be your base size for the icon

Quaedrikk commented 4 months ago

Hello @themronion , is it possible to do the resizing depending on the zoom size? I am trying to resize pin icons depending on map zoom and cannot seem to figure out how to achieve this. Thanks!

themronion commented 4 months ago

@Quaedrikk i don't completely understand what you need. Maybe u are looking for Scale property on the pin? Do u have a video of what u want to achieve?

Quaedrikk commented 4 months ago

I am trying to add numbered rooms into a building, however the pins i am using for the numbers do not scale down when i zoom in and cause visual clutter. I was unable to find any scale property on the pin or pinicon. Attached are screenshots of three levels of zoom with the same pins. If you need more clarification please let me know! Screenshot 2024-07-05 162952 Screenshot 2024-07-05 162943 Screenshot 2024-07-05 162935