angular-google-maps icon indicating copy to clipboard operation
angular-google-maps copied to clipboard

Feature RequestL Dynamically setting map language

Open npittsley opened this issue 9 years ago • 0 comments

Have a feature request?

I would love to be able to adjust the language at runtime. I was able to successfully do this with some small modification to the new service, uiGmapGoogleMapApiManualLoader and the "preventLoad' value.

By letting the "load" method accept a parameter, I am able to use manual load to have a user set the language at runtime. It would be best(for me) if this was in your code so that I did not break my code with future releases. Also, I searched everywhere on how to do this and feel this is the easiest solution for anyone who needs this feature. Below is an example, of course it could be further abstracted to handle any config value.

var languageCode = 'fr'; uiGmapGoogleMapApiManualLoader.load(languageCode);

/Updated function/ .service('uiGmapGoogleMapApiManualLoader', [ 'uiGmapMapScriptLoader', function(loader) { return { load: function(optional_language) { loader.manualLoad(optional_language); } };

/Updated function/ manualLoad: function (optional_language) { var config; config = usedConfiguration; if (optional_language) config.language = optional_language;

npittsley avatar Oct 31 '16 16:10 npittsley