Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi to all,
I'm using the 2.0.1 version and I noticed one issue (it took me 4h but who cares). I have a multilanguage site, and when I change to German version properties like Latitude and Longitude are with a comma (19,44534) and not point as it should be (19.44534). Google map stays greyed out as it can't parse those values.
I will try to update to 2.0.3, maybe this is already fixed.
I managed to fixed this issue by using ToString() to always translate to a specific culture, otherwise, it would translate decimal properties to comma version if you leave them in a razor with the active German language.
<div class="map" id="map" data-longitude="@Model.Content.ShopLocation.Longitude.ToString(CultureInfo.CreateSpecificCulture("en-GB"))" data-latitude="@Model.Content.ShopLocation.Latitude.ToString(CultureInfo.CreateSpecificCulture("en-GB"))" data-zoom="@Model.Content.ShopLocation.Zoom"></div>
Maybe this will help somebody.
Thank you for your information, I just wanted to make others aware if they read your post that this issue has nothing to do with how Angular Google Maps displays or stores values internally (Its uses Invariant Culture throughout), but this issue is to do with how Razor displays a decimal value type - this is really is your responsibility and depends how you wish to consume the decimal values.
eg. @Model.Content.ShopLocation.Longitude and @Model.Content.ShopLocation.Latitude are decimal types and its up to you how you turn them into strings. Just in the same way, as a date being stored in a DateTime date type is your responsibility how you convert to a string.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted