Topic: Can't create markers

I'm trying to create marker and can't get it to work. They don't even get added to the ONLINE MAPS MARKER MANAGER components when I attempt to create a marker. Here are the different ways I have tried:

public OnlineMapsMarkerManager markerManager;
public OnlineMapsMarker markerHotspot;

void Start()
{
     //1ST ATTEMPT
     markerManager.Create(new Vector2(newLongitude, newLatitude), textureHotspot, "hotspot!");     
     
     //2ND ATTEMPT       
     markerHotspot = OnlineMapsMarkerManager.CreateItem(new Vector2(newLatitude, newLongitude), "hotspot");

     //3RD ATTEMPT
     markerHotspot = OnlineMaps.instance.AddMarker(new Vector2(newLatitude, newLongitude), "hotspot");
}


None of these attempts work. What am I missing?
Thanks

Re: Can't create markers

Hello.

You need to manually add Online Maps Marker Manager to the map GameObject, and all your ways will work.
Or you can add it using a script:

OnlineMaps.instance.gameObject.AddComponent<OnlineMapsMarkerManager>();
Kind Regards,
Infinity Code Team.

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

3 (edited by Learning2Swim 2019-06-28 17:21:31)

Re: Can't create markers

Online Maps Marker Manager is already attached to the map GameObject. I tried to remove it so that I can add it during runtime, and it says that I can't because Online Maps UI Image Control needs it.

edit: It's also attached/referenced in the editor, and there are no errors.

Pic attached

Post's attachments

Attachment icon Screen Shot 2019-06-28 at 12.16.22 PM.png 222.36 kb, 4 downloads since 2019-06-28 

Re: Can't create markers

I just tried your script for UI Image Control, and the first way works correctly.
The second and third ways work, but the marker is created in the wrong location, because you use the wrong order of parameters: X - longitude, Y - latitude.

Video:
https://www.dropbox.com/s/qaqi1p7il5kkq … t.mp4?dl=0

Kind Regards,
Infinity Code Team.

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

Re: Can't create markers

I'm doing the same thing, not getting the same results.

What's also odd is the "Add Marker by M" option doesn't work.
When I press either "m" or "M" during runtime, a marker is never added. Only added if I click that actual"Add Marker" button.

Anyways, thanks for the video above showing how you set it up. I'm going to keep trying to figure out where I'm coming up short.

Re: Can't create markers

This is most likely due to the same reason for which no markers are created.
I just checked, and for me it works correctly.

Just to make sure:
Do you have one instance of the map in the scene?

Kind Regards,
Infinity Code Team.

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

Re: Can't create markers

It was my fault, I had a condition prior to it that wasn't allowing it to actually make the marker. After that I was able to figure it out, the quick video you made really helped.

Thanks for your quick responses.