Topic: Example: Simulation of movement marker on the route

In working with the following example I'm encountering a behavior I'm not sure is intended. The marker only seems to move along the route when the map is being updated, either by being dragged around or having the zoom changed. Do I need to move that code into a different Update call?

Thanks again!


http://infinity-code.com/atlas/online-m … ample.html

Re: Example: Simulation of movement marker on the route

Hello.

I tested this example on all types of map. It works well.
Perhaps you are using an older version of the script.
In Online Maps v2.3.0.1 this example has been updated (current version on the website or in Online Maps v2.3.0.1+).
Check that in line 131 called redrawing of map.

Kind Regards,
Infinity Code Team.

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

Re: Example: Simulation of movement marker on the route

Just to be safe, I replaced the code I had in the example with what you've got posted, even though I checked that line and it looked the same. I'm still getting the same behavior. If I set "Look to Marker" to true, it updates fine. If I set "Orient Marker..." to true it updates jerkily- probably at each step.

I put a break line on the Redraw line you mentioned- and had actually done so before I read your reply as that's a likely suspect- but it never got called. If I replace this: (OnlineMaps.instance.target != OnlineMapsTarget.tileset) with (true) everything moves along just fine. Can you help me understand that clause, why it's needed, and why it might be failing in this case?

Also, is there anything obviously set improperly that you can see in the image I've attached?

Thanks!

Post's attachments

Attachment icon OnlineMaps.JPG 111.32 kb, 123 downloads since 2016-02-26 

Re: Example: Simulation of movement marker on the route

Now I see the problem.
Just remove check (OnlineMaps.instance.target != OnlineMapsTarget.tileset).
Thank you very much for point out this bug.
We fixed this example.

Kind Regards,
Infinity Code Team.

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

Re: Example: Simulation of movement marker on the route

Also, if I wanted to replace the 2D marker you use in the example with a 3D marker, it seems I need to handle this line:

marker.rotation = 1.25f - OnlineMapsUtils.Angle2D((Vector2)p2, (Vector2)points[pointIndex + 1]) / 360;

rather differently, as a 3D marker's rotation takes quaternions and the 2D one takes a float.

Re: Example: Simulation of movement marker on the route

Something like:

marker3D.instance.transform.localRotation = Quaternion.Euler(0, 1.25f - OnlineMapsUtils.Angle2D((Vector2)p1, (Vector2)p2), 0);

or

marker3D.rotation = Quaternion.Euler(0, 1.25f - OnlineMapsUtils.Angle2D((Vector2)p1, (Vector2)p2), 0);
Kind Regards,
Infinity Code Team.

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

Re: Example: Simulation of movement marker on the route

Thanks! That's exactly what I was looking for. Happy to help!