Skip to content

Commit

Permalink
1.0.2 nuget
Browse files Browse the repository at this point in the history
#84 BugFix. Added marker animations
  • Loading branch information
valentasm committed Jan 1, 2021
1 parent a4d8576 commit 3cd1a99
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion GoogleMapsComponents/GoogleMapsComponents.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<RazorLangVersion>3.0</RazorLangVersion>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<PackageId>BlazorGoogleMaps</PackageId>
<Version>1.0.1</Version>
<Version>1.0.2</Version>
<Authors>Rungwiroon</Authors>
<Company>QueueStack Solution</Company>
<Product>BlazorGoogleMaps</Product>
Expand Down
4 changes: 2 additions & 2 deletions GoogleMapsComponents/Maps/Animation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ public enum Animation
/// <summary>
/// Marker bounces until animation is stopped.
/// </summary>
[EnumMember(Value = "bounce")]
[EnumMember(Value = "google.maps.Animation.BOUNCE")]
Bounce,

/// <summary>
/// Marker falls from the top of the map ending with a small bounce.
/// </summary>
[EnumMember(Value = "drop")]
[EnumMember(Value = "google.maps.Animation.DROP")]
Drop
}
}
9 changes: 9 additions & 0 deletions GoogleMapsComponents/Maps/MarkerLabel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
namespace GoogleMapsComponents.Maps
{
/// <summary>
/// https://developers.google.com/maps/documentation/javascript/reference/marker#MarkerLabel.className
/// These options specify the appearance of a marker label. A marker label is a single character of text which will appear inside the marker.
/// If you are using it with a custom marker, you can reposition it with the labelOrigin property in the Icon class.
/// </summary>
Expand Down Expand Up @@ -36,5 +37,13 @@ public class MarkerLabel
/// The text to be displayed in the label.
/// </summary>
public string Text { get; set; }
/// <summary>
/// The className property of the label's element (equivalent to the element's class attribute).
/// Multiple space-separated CSS classes can be added. Default is no CSS class (an empty string).
/// The font color, size, weight, and family can only be set via the other properties of MarkerLabel.
/// CSS classes should not be used to change the position nor orientation of the label
/// (e.g. using translations and rotations) if also using marker collision management.
/// </summary>
public string ClassName { get; set; }
}
}
10 changes: 10 additions & 0 deletions GoogleMapsComponents/wwwroot/objectManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ function tryParseJson(item) {
} else {
for (var propertyName in item2) {
let propertyValue = item2[propertyName];
if (propertyValue !== null && typeof propertyValue === "string" && propertyValue.indexOf("google.maps.Animation") == 0) {
switch (propertyValue) {
case "google.maps.Animation.DROP":
item2[propertyName] = google.maps.Animation.DROP;
case "google.maps.Animation.BOUNCE":
item2[propertyName] = google.maps.Animation.BOUNCE;
default:
}
}

if (typeof propertyValue === "object"
&& propertyValue !== null
&& "guidString" in propertyValue) {
Expand Down
1 change: 1 addition & 0 deletions ServerSideDemo/Pages/MapMarker.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ private async Task AddMarker()
Position = mapCenter,
Map = map1.InteropObject,
Label = $"Test {markers.Count}",
Animation = Animation.Bounce
//Icon = new Icon()
//{
// Url = "https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png"
Expand Down

0 comments on commit 3cd1a99

Please sign in to comment.