Topic: Unity iOS map problem

Hallo there.In my main project I have method(), that draw my map by button click, but don't do this on start, but in android build all is ok.
What can be wrong?
Need help!

I use tileset.

public void setDefaultLayer() 
 { 
  string lang = settingsData.languageId.ToString().ToLower() + "-" + settingsData.languageId.ToString(); 
 
  mapPlugin.customProviderURL = "https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i{zoom}!2i{x}!3i{y}!4i256!2m3!1e0!2sm!3i350018650!3m14!2s" + lang + "!3sUS!5e18!12m1!1e47!12m3!1e37!2m1!1ssmartmaps!12m4!1e26!2m2!1sstyles!2zcy50OjF8cy5lOmwudC5mfHAuYzojZmY2MTk1YTAscy50OjE4fHMuZTpnLnN8cC52Om9mZixzLnQ6NXxzLmU6Z3xwLmw6MHxwLnM6MHxwLmM6I2ZmZjVmNWYyfHAuZzoxLHMudDo4MXxwLmw6LTN8cC5nOjEuMDAscy50OjEzMTR8cC52Om9mZixzLnQ6MnxwLnY6b2ZmLHMudDo0MHxzLmU6Zy5mfHAuYzojZmZiYWU1Y2V8cC52Om9uLHMudDozfHAuczotMTAwfHAubDo0NXxwLnY6c2ltcGxpZmllZCxzLnQ6NDl8cC52OnNpbXBsaWZpZWQscy50OjQ5fHMuZTpnLmZ8cC5jOiNmZmZhYzlhOXxwLnY6c2ltcGxpZmllZCxzLnQ6NDl8cy5lOmwudHxwLmM6I2ZmNGU0ZTRlLHMudDo1MHxzLmU6bC50LmZ8cC5jOiNmZjc4Nzg3OCxzLnQ6NTB8cy5lOmwuaXxwLnY6b2ZmLHMudDo0fHAudjpzaW1wbGlmaWVkLHMudDoxMDU5fHMuZTpsLml8cC5oOiMwYTAwZmZ8cC5zOi03N3xwLmc6MC41N3xwLmw6MCxzLnQ6MTA1N3xzLmU6bC50LmZ8cC5jOiNmZjQzMzIxZSxzLnQ6MTA1N3xzLmU6bC5pfHAuaDojZmY2YzAwfHAubDo0fHAuZzowLjc1fHAuczotNjgscy50OjZ8cC5jOiNmZmVhZjZmOHxwLnY6b24scy50OjZ8cy5lOmcuZnxwLmM6I2ZmYzdlY2VkLHMudDo2fHMuZTpsLnQuZnxwLmw6LTQ5fHAuczotNTN8cC5nOjAuNzk!4e0"; 
 
  mapPlugin.RedrawImmediately(); 
 }

Re: Unity iOS map problem

Hello.

Unfortunately, I did not understand your description of the problem.
But based on your code, I see that you want to redraw the map with "provider - custom" with another language.
First of all, by changing the url in this way, you will have problems with caching.
Here the right way is to create your own provider, and just change the language of the map.
Example:

using UnityEngine;

public class ChangeCustomProviderLanguage:MonoBehaviour
{
    public string language = "en";

    private void OnGUI()
    {
        if (GUILayout.Button("Update language"))
        {
            OnlineMaps.instance.language = language;
        }
    }

    private void Start()
    {
        string url = "https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i{zoom}!2i{x}!3i{y}!4i256!2m3!1e0!2sm!3i350018650!3m14!2s{lng}!3sUS!5e18!12m1!1e47!12m3!1e37!2m1!1ssmartmaps!12m4!1e26!2m2!1sstyles!2zcy50OjF8cy5lOmwudC5mfHAuYzojZmY2MTk1YTAscy50OjE4fHMuZTpnLnN8cC52Om9mZixzLnQ6NXxzLmU6Z3xwLmw6MHxwLnM6MHxwLmM6I2ZmZjVmNWYyfHAuZzoxLHMudDo4MXxwLmw6LTN8cC5nOjEuMDAscy50OjEzMTR8cC52Om9mZixzLnQ6MnxwLnY6b2ZmLHMudDo0MHxzLmU6Zy5mfHAuYzojZmZiYWU1Y2V8cC52Om9uLHMudDozfHAuczotMTAwfHAubDo0NXxwLnY6c2ltcGxpZmllZCxzLnQ6NDl8cC52OnNpbXBsaWZpZWQscy50OjQ5fHMuZTpnLmZ8cC5jOiNmZmZhYzlhOXxwLnY6c2ltcGxpZmllZCxzLnQ6NDl8cy5lOmwudHxwLmM6I2ZmNGU0ZTRlLHMudDo1MHxzLmU6bC50LmZ8cC5jOiNmZjc4Nzg3OCxzLnQ6NTB8cy5lOmwuaXxwLnY6b2ZmLHMudDo0fHAudjpzaW1wbGlmaWVkLHMudDoxMDU5fHMuZTpsLml8cC5oOiMwYTAwZmZ8cC5zOi03N3xwLmc6MC41N3xwLmw6MCxzLnQ6MTA1N3xzLmU6bC50LmZ8cC5jOiNmZjQzMzIxZSxzLnQ6MTA1N3xzLmU6bC5pfHAuaDojZmY2YzAwfHAubDo0fHAuZzowLjc1fHAuczotNjgscy50OjZ8cC5jOiNmZmVhZjZmOHxwLnY6b24scy50OjZ8cy5lOmcuZnxwLmM6I2ZmYzdlY2VkLHMudDo2fHMuZTpsLnQuZnxwLmw6LTQ5fHAuczotNTN8cC5nOjAuNzk!4e0";

        OnlineMapsProvider.Create("myprovider").AppendTypes(
            new OnlineMapsProvider.MapType("mystyle") { urlWithLabels = url, }
        );

        OnlineMaps.instance.mapType = "myprovider.mystyle";
    }
}

Notice {lng} tag in URL.
This will work correctly with the cache.

Kind Regards,
Infinity Code Team