Topic: TMS Tiles

Hi,

Firstly I want to say what amazing asset you have created for the Unity community here - thanks.

Ok, so I have collections of custom tiles that come in the TMS tile arrangement (0,0 at bottom left) rather than the Google / OSM arrangement  (0,0 at top left). So while I could probably create an editor script to correct this using this approach taken from https://alastaira.wordpress.com/2011/07 … ordinates/

z = zoomlevel;
ymax = 1 <<  z;
y = ymax - y - 1;

I wondered if it would be relatively simple or even possible for you guys to accommodate this within your tool? wink

Thanks

Nige

Re: TMS Tiles

Hello.

Example attached.

Post's attachments

Attachment icon LoadTMSTilesExample.cs 1014 b, 183 downloads since 2015-10-27 

Kind Regards,
Infinity Code Team.

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

Re: TMS Tiles

Thanks Alex, I have tried your approach but am having some strange effects.

When I first start the project in the editor the tiles are in the correct arrangement but then almost immediately they revert to the default arrangement and the sections of the map view start flickering?

I have added my version of your example script here so you can see what I have done, which is basically just try and load the tiles from Resources ...

Other than than that I have just added the script to the Tileset map game object in the Tilset example scene

Any idea what might be going on? Have I approached this in the correct way? Feel like I am missing some important but probably obvious bit of information wink

Post's attachments

Attachment icon LoadTMSTiles.cs 1.11 kb, 188 downloads since 2015-10-27 

Re: TMS Tiles

I am attaching a gif showing what I am trying to describe - for your reference I can load the same tiles into Leaflet with the TMS tag set to true and they are displayed correctly?

Post's attachments

Attachment icon ScreenGrab_01.gif 1.49 mb, 139 downloads since 2015-10-27 

Re: TMS Tiles

The problem is that you change tile.y.

The right way:

string path = String.Format("OnlineMapsTiles/{0}/{1}/{2}", tile.zoom, tile.x, y);
tileTexture = Resources.Load(path) as Texture2D;
Kind Regards,
Infinity Code Team.

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

Re: TMS Tiles

Oops hmm

Perfect - thank you Alex