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

Topic: How to translate the map with custom function

Hello,
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

Hello.

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.

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