Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not saving selected map style #14

Open
russellshome opened this issue Nov 4, 2019 · 3 comments
Open

Not saving selected map style #14

russellshome opened this issue Nov 4, 2019 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@russellshome
Copy link

When that selected map type is changed, that change is not saved.

The incorrect code is in our.umbraco.gmaps.controller.js
Starts with switch ($scope.mapType)

Upper case first letter is incorrect so 'Hybrid' should be 'hybrid' etc.

@ArnoldV ArnoldV added the bug Something isn't working label Nov 5, 2019
@ronaldbarendse
Copy link
Collaborator

Thanks for reporting @russellshome 👍 Getting or setting the map type shouldn't depend on casing differences, so this is indeed something that needs fixing!

Seems like Google uses all-lowercase and these values can also be retrieved from the google.maps.MapTypeId object using the uppercase variants (e.g. google.maps.MapTypeId.HYBRID):

google.maps.MapTypeId

I've already added an obsolete message to the C# property, so this will probably be rewritten for version 2 of this package:

[JsonProperty("maptype")]
[Obsolete("This property should not return a different value than previously set.")]
public string MapType
{
get
{
switch (this._mapType)
{
case "Hybrid":
return "google.maps.MapTypeId.HYBRID";
case "Satellite":
return "google.maps.MapTypeId.SATELLITE";
case "Terrain":
return "google.maps.MapTypeId.TERRAIN";
case "styled_map":
return "styled_map";
default:
return "google.maps.MapTypeId.ROADMAP";
}
}
set => this._mapType = value;
}

@bjarnef
Copy link
Contributor

bjarnef commented Nov 18, 2020

I noticed when you have entered a custom mapstyle JSON it is not possible to delete/clear this again.
After saving datatype instance it is loading the original mapstyle JSON.

Tested on v1.3.3 and Umbraco v8.9.0

@robertjf robertjf added the help wanted Extra attention is needed label Feb 27, 2023
@robertjf
Copy link
Collaborator

Hi all, can someone confirm whether this is still an issue in the current version for me.

Otherwise, this issue will be closed in a couple of weeks...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants