Topic: Full refresh

Hi,

I want to implement a button to change the type of the map (like in google maps, I want the user to be able to change from terrain, to satellite and so on) how can I force a full refresh of the map when the type is changed?

Re: Full refresh

Hello.

Redrawing the map when changing the type of map occurs automatically.
Example of how to change the type of map:
http://infinity-code.com/atlas/online-m … ample.html

Kind Regards,
Infinity Code Team.

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

Re: Full refresh

awesome thanks!

4 (edited by DDQ 2024-11-04 15:25:09)

Re: Full refresh

Hi, this solution doesn't seem to work for me. I have a Mapbox map integrated into the asset (works), but if I try to alter the mapID, I need to do it somehow like this:

        OnlineMaps.instance.mapType = mapTypeID;
        OnlineMapsProvider.MapType mapType = OnlineMapsProvider.FindMapType(mapTypeID);
        OnlineMapsProvider.ExtraField field = GetExtraField(mapType.extraFields, "mapid");
        field.value = Mapbox_ID_Light;

This actually changes the map to the correct one, whenever I scroll over an uncached area, but it doesn' refresh the existing tiles.

I tried below, without success:

        OnlineMapsCache.instance.ClearFileCache();

        foreach (OnlineMapsTile tile in OnlineMapsTile.tiles) tile.Dispose();
        OnlineMapsTile.tiles.Clear();
        OnlineMaps.instance.Redraw();
        OnlineMaps.instance.tileManager.Reset();

Re: Full refresh

Hi.

When you use multiple map types from the same provider, you'd better register your own providers and/or map types.
Example:
https://infinity-code.com/atlas/online- … ample.html

Kind Regards,
Infinity Code Team.

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