Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
321 views
in Technique[技术] by (71.8m points)

ios - How to change the language on GoogleMap?

I use GMSMapView from Google Maps iOS SDK in my application. I can change app language in settings page. How to change language on map in runtime?

I can reload or recreate map on this method

(void)prepareMap
{
    [self.viewForMap removeAllSubviews];
    GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:latitude longitude:longtitude];
    GMSMapView *mapView = [GMSMapView mapWithFrame:rect camera:camera];
    [self.viewForMap addSubview:mapView];
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

As answered in Using the Google Maps APIs - How can I get the Google Maps APIs to display in a language other than English?:

By default the API will attempt to load the most appropriate language based on the users location or browser settings. Some APIs allow you to explicitly set a language when you make a request.

From there, you may add language parameter in your HTTPS request in some Google Maps APIs. However, for some APIs that doesn't allow this, you have to first determine the current location with the use of Core Location Framework as suggested in this SO post - iphone default map app open with different language.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...