Google has, somewhat famously, backed out of China due to restrictions on search and geographic data publishing. In order to display a functional locator to Chinese visitors, a few settings must be dynamically updated when the visitor’s country is detected as China.
Directions links should use Baidu Maps in China. Google Maps functions in China for those outside of China, but not for those within its borders. This template includes conditional logic that displays Baidu for users from CN and the regular Google Maps directions for all others.
2. The Map Vendor should be switched to MapTiler. If the Interface is set to use Google Maps, the Map Vendor should be set to MapTiler GL. This can be done using Dynamic Parameters.
First, enable Dynamic Parameters as shown below:
Then, configure the Map Vendor setting to use
geoip_country_code is set to
CN by clicking the Dynamic Parameter option next to Map Vendor
Update the values in the Dynamic Parameter Editor as shown below:
Finally, save the Interface for the settings to take effect.
To test the effect of this change outside of China, an IP address can be “forced”. To do this,
Preview the Interface to obtain the URL, it will look similar to this example:
Obtain a Chinese IP address by Googling for an example.
Append the preview URL with the following special parameter
&_ip=220.127.116.11, where the IP address is any known Chinese IP Address. The final URL would be similar to this, but would use your preview link:
You may need to hard-reload when switching back and forth.