Topic: Map to fill the screen

Ok I went through the documentation.
I have to use Adjust to Screen to fill the view.

But for some reason, it restricts zoom level to 3?

What I did:
1. Moved map Game object 512 on x and Z so it it is in the centre
2. Added Camera Orbit with Unity 0,0 as a target
3. Added Adjust to screen with Use max Side

Am I doing something wrong?

Please see attached image.

Post's attachments

Attachment icon Map.jpg 1.46 mb, 53 downloads since 2021-09-17 

2 (edited by artpen 2021-09-17 16:17:09)

Re: Map to fill the screen

It also looks like it makes map too big and it take longer to load textures ?
Would be good to have a way to decouple main camera from Map navigation?

Re: Map to fill the screen

Hello.

One of the limitations of Online Maps is that each coordinate can correspond to only one point on the screen / scene.
In other words: Online Maps will not wrap the map.

You have set Adjust To - GameObject and this is most likely causing problems on the right side of the image.

Why do you need Adjust to Screen?
This script does not fit the use case you showed here:
https://forum.infinity-code.com/viewtop … 7726#p7726

Kind Regards,
Infinity Code Team.

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

Re: Map to fill the screen

Hi Alex,

I played with RealTilesetSize Example. And it looks like it dynamically scales the tile and changes the texture relative to zoom level.
Because I want to be bale to see full world map as well say at zoom level 3 I will have to move camera away to be able to see all.
Is it correct? Will I get any Unity problems, cause I will have to move camera quite far smile

See my sketch. It is what I thought. Somehow connect camera distance to map to tile size. So it always covers the full screen and I can see full map at zoom level 3 or 5

Post's attachments

Attachment icon Scan 22 Sep 2021 at 20.48.jpeg 78.06 kb, 80 downloads since 2021-09-22 

Re: Map to fill the screen

Something like this? So I need to sync Camera distance (at Camera Orbit Script) with zoom levels ?

Re: Map to fill the screen

No, it won't work correctly, because Unity has huge accuracy problem with positions over 12k on any axis (I don't remember the exact value, but something like that).
This can create any kind of unpredictable bugs.
The equator is over 40 million meters long and the RealTilesetSize makes the size 1 meter = 1 unity world point.
I have not tested if there are camera bugs at this distance, but it is very possible that they will.
In another thread, you asked me about the scale for RealTilesetSize and this is a good way to avoid this.

Also, RealTilesetSize will work correctly for a maximum of half the Earth.
This script uses DistanceBetweenPoints method which calculate the closest distance on the sphere.
When you display more than half of the Earth, this method will return a much smaller value than expected.

About your sketch:
See OnlineMapsAdjustToScreen for an example of how to do this.

Kind Regards,
Infinity Code Team.

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

Re: Map to fill the screen

Apologies for so many questions but it feels like I am working in circles:)

What I am trying to get to is:

1. My procedurally generated buildings and roads are always in world scale 1m = 1unity unit
2. The mesh is always at 0,0 location
3. Map fills the screen
4. Map is in 1m = 1unit
5. Map could be seen as a full world map.
6. Camera target at 0,0

So 1 and 2 is done. 6 I think I can just move the map and the camera like your wizard  does by default.

As you can see I don’t want to scale or change position of my mesh because of the map. I want map to change.

It looks like there is no way of doing it?

So I can move camera away only so much until Unity will behave strange. And for argument sake it will get me up to zoom level 15. After this point maybe I can replace my model with a simple icon and just scale an icon not the whole mesh.

At zoom level 15 the actual mesh could become so small anyway.

Re: Map to fill the screen

Your point 2 conflicts with point 6 because the map is drawn from the top left corner.
Your points 1 and 4 conflict with point 5. I explained the reason in the previous post.

Programming, like other forms of art, like cinema or painting, is very often a cheating in which you simply create the appearance of some kind of effect and say that it is.
For example, in a movie, you cannot show a dragon, simply because they do not exist in reality. To show that there is a dragon, animatronics or CG is used, and the audience believes that it is.
Absolutely the same story here.
You are looking for ways to bypass hardware and software limitations. Only you know the real size of the map. It makes no difference to scale the map to the actual size, or objects to the size of the map. The user will never know how it actually works.
In another thread, you posted a video of what you plan to do. To do this, 1:1 scale is not needed at all. You can easily do this without changing the size of the map.

Kind Regards,
Infinity Code Team.

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

9 (edited by artpen 2021-09-23 16:27:38)

Re: Map to fill the screen

Thank you. Love your analogy:)
So you suggest it is ok to keep the map as it is and just scale game objects which are placed onto the map?

My worry is that if I will have many buildings and roads and I will start changing mesh points and rebuilding the mesh while zooming in and out it might be to computational expensive.

I just don't want to link my camera or created mesh in anyway to the map. There are so many sdk's and most of them for Unity are broken or in beta. All can change and want to be able just to change maps without worrying about my generative meshes.

Google SDK - too expensive
Mapbox SDK - basically died
ArcGIS - beta
Bing - mainly for VR and beta

I think your asset is the better option for me , just need to find a way to use it properly ...


I think I saw you had an example of placing object on to map?

Re: Map to fill the screen

Yes, I would leave the map at a fixed size.
You can scale objects instead of rebuilding the mesh.
Or you can make a 3D marker from an existing GameObject, set the sizeType to realWorld, and your object will be automatically positioned and scaled 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.