Topic: Adding Markers based on Latitude Longitudes

Hello,

I have a list of location cordinates  (Lat. and Long.) and I'm trying to instantiate markers on the maps based on that, I couldnt find anything in the documentation or the script to do that. Could you please guide me on would I go on about doing that?.

Thanks.

Cheers,
Mridul

Re: Adding Markers based on Latitude Longitudes

Hello.

OnlineMaps.AddMarker
http://infinity-code.com/doxygen/online … fa6fad9ee8
Please note: X - longitude, Y - latitude.

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

Kind Regards,
Infinity Code Team.

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

Re: Adding Markers based on Latitude Longitudes

Cool, thanks!

Re: Adding Markers based on Latitude Longitudes

Hi,
I have a few animated markers I wanna add, so I am adding them as 3d objects , when I add them in from the online map tile set control as 3d marker they work just fine , but I wanna spawn them on the map based on lat/long , so I did try using the marker 3d_example script provided, it is instantiating the marker object(clone) but it is disabled for some reason, any idea why it is behaving so?

Thanks.
Cheers,
Mridul

Re: Adding Markers based on Latitude Longitudes

Hello.

It is difficult to say what the problem is, because you have not shown the script.
In most cases, this occurs when the confused latitude and longitude.
X - longitude, Y - latitude.

If your problem is something else, please show your script.

Kind Regards,
Infinity Code Team.

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

Re: Adding Markers based on Latitude Longitudes

Hi Alex,

I can successfully generate the markers (the lat and long were wrong just as you pointed out, thanks) but I am trying to generate about 1000 3D markers(gameObjects) and there are gonna be way more about 100k eventually. but when I generate the unity experiences a freeze for about 4-5 seconds before it starts working correctly.

I did go through the thread where you tried to generate 1M markers , will something like that work for gameObjects too? (in the traffic simulation thread you mention going about generating gameObjects is easier then generating same number of markers).
so can you guide me as of how I should proceed? because once the markers are loaded they work quite nicely, and I dont need them visible below 4 or even 5 zoom level.

Right now I am simply using a foreach loop to iterate through a list of coordinates.

Thanks.
Cheers,
Mridul

Re: Adding Markers based on Latitude Longitudes

Hello.

Markers have a lot logic that works for each marker.
Of course, if you have a lot of markers, it will be slow.

To make this work fast, you need to make your own marker system.
In your case, 3D marker system.

General logic of marker system:
If the coordinates of the marker on the visible part of the map:
* If the marker does not exist, create it.
* Update the position of marker.
If the coordinates of the marker is outside of the visible part of the map, and it exists, remove it.

Fastest way to find the position of the marker in the scene see TrafficSimulation.OnRenderObject.
http://forum.infinity-code.com/viewtopi … 1142#p1142
If someone finds a way to further optimize this code, please let me know.

But for 100k markers that will be not enough.
You need to minimize the number of markers, for which you need to make a calculation.
Here you will help the idea from the example with a million markers.
The main idea is: you split the map into small areas, such as 10x10 degrees or less, and calculates only the areas that are on the map.

Kind Regards,
Infinity Code Team.

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