rungwiroon / BlazorGoogleMaps

Blazor interop for GoogleMap library
MIT License
319 stars 102 forks source link

Icon.Rotation does not seem to do anything. #265

Closed SykesJohn closed 1 year ago

SykesJohn commented 1 year ago

I was hoping the I could rotate my map marker with the Rotation property of Icon but it does not seem to work. What is the Rotation property for?

valentasm1 commented 1 year ago

Small demo?

SykesJohn commented 1 year ago

I just added Rotation in the standard demo program like this:

var marker = await Marker.CreateAsync(_map1.JsRuntime, new MarkerOptions() { Position = mapCenter, Map = _map1.InteropObject, //Label = $"Test {markers.Count}", ZIndex = ZIndex, //CollisionBehavior = CollisionBehavior.OPTIONAL_AND_HIDES_LOWER_PRIORITY,//2021-07 supported only in beta google maps version Animation = Animation.Bounce, Icon = new Icon() { Url = https: //developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png, Rotation = 45 } //Icon = https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png });

Uncomment the code on line 248 in MapMarker.razor.cs and add the Rotation line.

valentasm1 commented 1 year ago

Could not find it in google Icon reference https://developers.google.com/maps/documentation/javascript/reference/marker#Icon Marked as obsolete, but too lazy to make nuget.