1 (edited by danielesuppo 2019-06-05 19:28:33)

Topic: How to translate the map with custom function

I'd like to implement my own controllers to move, scale and rotate the map with touch on mobile device.
Actually in my classes I'm using a function like this one to move the map from one point to another one:

OnlineMaps.instance.projection.CoordinatesToTile(longitude, latitude, OnlineMaps.instance.zoom,
                        out double tx, out double ty);
OnlineMaps.instance.SetTilePosition(tx, ty);

but I think it's not a good idea to convert touch screen position in gps position, than get the difference, etc etc.

I'd like to be able to translate the map in a good and reliable way from screen delta positions, just like you did with the default touch control that you implemented (that I had to disable to not interfere with some others touch controls).
Could you suggest me how to do that?
Many thanks!

Re: How to translate the map with custom function


Internally, Online Maps works in the same way - it converts the screen position into a tile position, and calculate the difference.
Honestly, I do not know how this can be implemented differently.

Kind Regards,
Infinity Code Team.

Do not know the best way to thank the developer? Rate the asset in Asset Store!