Topic: Draw graticules

I would like to draw the longitude and  latitude on the online maps.
But I don't understand how the script OnlineMapsDrawingLine.cs works.

Is there any convenient way to draw the graticules on the map?


thanks a lot if there are more details to show how to draw ^^

Re: Draw graticules

Hello.

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: Draw graticules


THANKS!

Re: Draw graticules


But I still have some problems.
If I draw too much lines and zoom too much, it will stop working and crash.
How can I solve this?

Thanks for helping

Re: Draw graticules

Please explain your problem in more detail and show your script that draws lines.

Kind Regards,
Infinity Code Team.

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

6 (edited by ZOE 2018-12-19 02:37:25)

Re: Draw graticules

Alex Vertax wrote:

Please explain your problem in more detail and show your script that draws lines.

This is my scripts,  when I zoom to larger than 10, the scenes become choppy.  sad

Post's attachments

Attachment icon DrawLine.cs 2.66 kb, 95 downloads since 2018-12-19 

Re: Draw graticules

You are trying to draw some kind of grid, right?

There are a lot of problems in your script:
1. Drawing API is not designed for this purpose.
It is much better to use overlay here, or to limit the drawing area by viewing area.

2. You will have a different distance between the horizontal lines, and they will not be horizontal at all.
I do not know, maybe so planned, but it looks suspicious.

3. For zoom >= 16, you have 7200 drawing elements, which is a lot.

4. Your code does not work as expected, because "i" will never be equal to 180.
Why:
https://www.extremeoptimization.com/res … rmats.aspx
This means that every Update you create new lines.

5. GameObject.Destroy (GameObject.Find ("Drawings"));
By destroying this GameObject you do nothing, because the map will create it again with the lines that were added earlier.
Use OnlineMaps.RemoveDrawingElement or OnlineMaps.RemoveAllDrawingElements.

P.S. This is just a quick look at your script. Perhaps this has more problems.

Kind Regards,
Infinity Code Team.

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

Re: Draw graticules

Thanks, I'll try another way

Alex Vertax wrote:

You are trying to draw some kind of grid, right?

There are a lot of problems in your script:
1. Drawing API is not designed for this purpose.
It is much better to use overlay here, or to limit the drawing area by viewing area.

2. You will have a different distance between the horizontal lines, and they will not be horizontal at all.
I do not know, maybe so planned, but it looks suspicious.

3. For zoom >= 16, you have 7200 drawing elements, which is a lot.

4. Your code does not work as expected, because "i" will never be equal to 180.
Why:
https://www.extremeoptimization.com/res … rmats.aspx
This means that every Update you create new lines.

5. GameObject.Destroy (GameObject.Find ("Drawings"));
By destroying this GameObject you do nothing, because the map will create it again with the lines that were added earlier.
Use OnlineMaps.RemoveDrawingElement or OnlineMaps.RemoveAllDrawingElements.

P.S. This is just a quick look at your script. Perhaps this has more problems.