1 (edited by zhenkai 2021-03-10 07:33:39)

Topic: reverse buildings from map into unity 3D space or vice-versa

Hi all, I am currently looking at the "Buildings" scene in the Online map examples scene. It can help to create a 3D model on the map when the user zooms in to a certain selected range. I would like to ask for advice if it is possible to reverse these buildings into 3D world space, scaling their size into real building size, taking 1 unit of length in unity as 1 meter. Alternatively, I have a set of 400 - 1000 3D cubes in unity that are tag along with decimal latitude, longitude, and altitude values, will it be possible to plot them on the Map generated using infinity code? Just like the example scene, these image cubes are only shown when the user zoom into the particular GPS coordinates that these cubes are located.

Sorry, I am still clueless about how to achieve any of these functions and I don't have any code to show. Would greatly appreciate if anyone can give me some hint about how to achieve them or any suggestion are greatly welcomed.

Thanks in advance!!

Post's attachments

Attachment icon random.PNG 406.03 kb, 61 downloads since 2021-03-10 

Re: reverse buildings from map into unity 3D space or vice-versa

Hello.

How to make that map had the real world size:
https://infinity-code.com/atlas/online- … mple.html.

You can create your cubes as 3D markers, and they will automatically position on the map, or you can position them yourself using API:
https://infinity-code.com/doxygen/onlin … eedf61eb0.

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 zhenkai 2021-03-11 08:01:03)

Re: reverse buildings from map into unity 3D space or vice-versa

Hi, I am currently looking at the creating of the 3D marker example shown here
https://infinity-code.com/atlas/online- … ample.html

May I ask how can I plot the 3D markers into the map automatically base on a given latitude, longitude, and altitude? thank you!


Update: Manage to plot the 3D markers by creating it directly with longitude and latitude input as parameters. Then, assign the altitude value to the altitude variable in the 3D marker class "OnlineMapsMarker3D".

4 (edited by zhenkai 2021-03-11 10:08:23)

Re: reverse buildings from map into unity 3D space or vice-versa

Hi again, anyone knows if I can destroy all 3D markers with a button click? So a function that can wipe up all 3D markers. Currently, the prefab I use has a specific tag call "marker". I tried to search all game object in the scene with tag == "marker" and destroy them. However, this causes an error when I re-instantiate ~400 markers. The total number of markers generated is more than what I specify in my code. So I assume I have to clear the markers properly instead of directly destroying them from the scene.

May I also know where to look for the code that controls the map shown when we click and drag to tileset? Instead of clicking and dragging the tileset to move the map, I would like to convert it into 4 UI buttons that move the map in 4 directions, up, down, left, and right. Thanks in advance!!

Re: reverse buildings from map into unity 3D space or vice-versa

OnlineMapsInteractiveElementManager.RemoveAllItems
https://infinity-code.com/doxygen/onlin … ce18930c6d

Kind Regards,
Infinity Code Team.

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

Re: reverse buildings from map into unity 3D space or vice-versa

May I also ask about the "buildings" script, mainly regarding the "Floor height" and "Floors". if I attach the "Real-world tileset size example" script does that mean that I wouldn't have to bother about the floor height and level of floors? Or must I always reset the number of floors depending on which building I am looking at? if I have a cluster of 5 buildings that have 5 levels, 10 levels, 20 levels, 1 level, and 100 levels how should I set the "floors" parameter? and what about building with different floor heights. Thank you once again for looking at my questions!

Re: reverse buildings from map into unity 3D space or vice-versa

Floors is used when OSM does not have information about the height or number of floors in a building.
A random number is selected within the specified range.
Floor Height is used when OSM has no height data.

When using Real-world tileset size, buildings will automatically adjust to 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.

Re: reverse buildings from map into unity 3D space or vice-versa

Thanks for all the answers, really help to clarify many of my doubts and solve many of my problems. May I know where I can look into the code that is related to the movement of the map?

I am still trying to apply the following:
"May I also know where to look for the code that controls the map shown when we click and drag to tileset? Instead of clicking and dragging the tileset to move the map, I would like to convert it into 4 UI buttons that move the map in 4 directions, up, down, left, and right. Thanks in advance!!"

The rationale for doing so is that I am currently putting the Online map into an environment that is somewhat similar to Unity's Scene, as such, I am unable to directly move the map by clicking and dragging on it and thus extra buttons are required to move the map. Would highly welcome any suggestions that can possibly help to solve this problem. Thank you!!

9 (edited by zhenkai 2021-03-12 08:28:17)

Re: reverse buildings from map into unity 3D space or vice-versa

Hi all, I am trying to destroy all 3D marker using this:
https://infinity-code.com/doxygen/onlin … ce18930c6d

I tried the following code:

public void DestroyAll3DMarker()
    {
        OnlineMapsInteractiveElementManager<OnlineMapsMarker3DManager, IOnlineMapsInteractiveElement>.RemoveAllItems();
    }

And there's an error when I try to run the method. This is probably more related to programming instead of the asset itself but can anyone help to explain this? I am unsure of what to fill within the "<>" for the code to work

Post's attachments

Attachment icon Capture.PNG 21.69 kb, 61 downloads since 2021-03-12 

Re: reverse buildings from map into unity 3D space or vice-versa

If you mean the source code, then it is inside the control scripts (there are many different scripts). But why do you need it? You don't need to modify the source code to override any map behavior. You can easily implement almost anything through the API.

See OnlineMapsKeyboardInput for an example of how to move the map using buttons.
And disable Allow User Control in the control inspector (most likely Tileset).

It's much easier:

OnlineMapsMarker3DManager.RemoveAllItems()
Kind Regards,
Infinity Code Team.

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