0

I've done just about everything to try get the maps to work for the French and Portuguese cultures

The map renders fine when a culture of en-US or even ar-DZ is selected, I require the maps to render for 2 additional sites, the one is French and the other Portuguese.

I have specified the correct language for the google maps to render as, I have tried both pt and pt-BR, fr-FR, fr-MZ and just fr among others.

I have done some digging and this is what is returned for the map images

http://maps.googleapis.com/maps/gen_204?target=api&ev=api_viewport&cad=host:clients-url.com,v:26,r:1,mt:m,c:NaN%2CNaN,sp:NaNxNaN,size:1920x422,relsize:0.40,token:42utqeova9,src:apiv3,ts:6jxdfg

Notice the "c:NaN%2CNaN,sp:NaNxNaN", the map is built but with no images, there are also no controls, however there is a hand to pan the map.

I have created different API keys served from different regions, I've tried forcing the language to English through the language attribute, nothing seems to be working

When I pass the correct language through and disable the API key, I get the API error key missing displaying in french or Portuguese so that seems to be working. I'm assuming it has to do with the way the cultures are handled in umbraco.

What should I do to get the maps to display the tile images with a PT or FR culture?

Sebastian Brosch
  • 42,106
  • 15
  • 72
  • 87
  • 2
    Does the [Google Maps Javascript API v3 localization sample map work for you](http://googlemaps.github.io/js-samples/map_language/map_lang.html)? – geocodezip Dec 01 '16 at 21:07

1 Answers1

2

The google angular maps package returns the coordinates as decimals which get converted from -26.88888 to -26,88888 which was not a valid coordinate, returning it in a valid culture fixed this

var loc = Model.Content.GetPropertyValue<AngularGoogleMaps.Model>("mapLocation");    

var lat = string.Format(System.Globalization.CultureInfo.GetCultureInfo("en-US"), "{0:0.0}", loc.Latitude);
var lng = string.Format(System.Globalization.CultureInfo.GetCultureInfo("en-US"), "{0:0.0}", loc.Longitude);