Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
303 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 Reply

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...