1 (edited by astraldata 2016-04-10 11:04:57)

Topic: Get/Set current map scroll location center lat/lon coordinates

How would I both get and set the current center of the map (at runtime) by inputting some lat/lon coordinates? Is there a function/method for this? If so, where/how would I use this? And if not, could anyone show me the code to do this?

I'd also like to get/set marker coordinates too in realtime, but I can't seem to find any documentation on how to go about this. Any help would be much appreciated!

Re: Get/Set current map scroll location center lat/lon coordinates

Hello.

Single precision - OnlineMaps.position
http://infinity-code.com/doxygen/online … 83961edbce

Double precision - OnlineMaps.GetPosition / OnlineMaps.SetPosition
http://infinity-code.com/doxygen/online … b84e75f062
http://infinity-code.com/doxygen/online … e65d01d9b7

Examples:

OnlineMaps.instance.position = new Vector2(10, 20); // X - Longitude, Y - Latitude
double lng, lat;
OnlineMaps.instance.GetPosition(out lng, out lat);
OnlineMaps.instance.SetPosition(lng, lat);

Single precision - OnlineMapsMarkerBase.position
http://infinity-code.com/doxygen/online … 0a8c559dcd

[Online Maps v2.4.0.4+] Double precision - OnlineMapsMarkerBase.GetPosition / OnlineMapsMarkerBase.SetPosition

Examples:

marker.position = new Vector2(10, 20); // X - Longitude, Y - Latitude
double lng, lat;
marker.GetPosition(out lng, out lat);
marker.SetPosition(lng, lat);
Kind Regards,
Infinity Code Team.

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