1 (edited by ogli223 2016-08-02 10:28:27)

Topic: How can I choose which marker to use via script?

HI!

Whenever I add a marker via script, It only shows the green marker. how can I choose which marker to choose via script?

Re: How can I choose which marker to use via script?

Hello.

OnlineMaps.AddMarker has a parameter markerTexture.
Use this parameter to specify the marker texture.
http://infinity-code.com/doxygen/online … fa6fad9ee8

Kind Regards,
Infinity Code Team.

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

3 (edited by ogli223 2016-08-03 03:05:35)

Re: How can I choose which marker to use via script?

Hi again!

Am I using it right?

marker = OnlineMaps.instance.AddMarker(getPosition(), myNewMarker.png, "Player");

And should I put the myNewMarker.png in the folder with the defaultmarker.png?

Thanks Alex!

Re: How can I choose which marker to use via script?

No.

It should be:

// Must have "Read / Write enabled - ON".
public Texture2D myMarkerTexture;

void SomeMethod()
{
    marker = OnlineMaps.instance.AddMarker(getPosition(), myMarkerTexture, "Player");
}

You specify the texture of the marker in the inspector.
If you want to dynamically load texture, use Resources.Load.
https://docs.unity3d.com/ScriptReferenc … .Load.html

Kind Regards,
Infinity Code Team.

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