Topic: Changing Overlay at runtime

Hi,

I am trying to change a map overlay (created using MapTiler) at runtime and have noticed that it needs a change of zoom to occur before the change is reflected in the view. Is there a way of showing a change of overlay tiles without altering the zoom of the map?

Thanks

Nige

Re: Changing Overlay at runtime

Hello.

You need to unload customData.
Something like this:

lock (OnlineMapsTile.tiles)
{
    foreach (OnlineMapsTile t in OnlineMapsTile.tiles)
    {
        CData data = t.customData as CData;
        if (data != null)
        {
            if (data.texture != null) Destroy(data.texture);
            t.customData = null;
        }
    }
}
Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Changing Overlay at runtime

Thanks for your response. I am actually using a slightly modified version of a script you posted here http://forum.infinity-code.com/viewtopic.php?id=51 to display an overlay over the map tiles, it is modified only so it fits into the dependency injection framework that I use. When a different overlay is required I just change the path to the overlay tiles - but I have to manually change the zoom level for this to be reflected immediately. So my question is - is there a better way of doing this?

Thanks

Nigel

Re: Changing Overlay at runtime

If you use this script, it's even easier.
You need to clear the list of items:

items.Clear();
Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Changing Overlay at runtime

Thanks Alex ;-)