Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hao to add two maps in the scene graph? #27

Closed
jiaxianghao opened this issue Jun 1, 2023 · 3 comments
Closed

Hao to add two maps in the scene graph? #27

jiaxianghao opened this issue Jun 1, 2023 · 3 comments

Comments

@jiaxianghao
Copy link

Hello matthew, my development environment cannot be connected to the internet, so I need to read map data from the geoserver. However, there is a blurry global map and a clear local map on the geoserver. After reading your source code, I found that it is impossible to add two maps. Do you have any good ideas?

@jiaxianghao
Copy link
Author

Thank you.

@matthew-reid
Copy link
Contributor

matthew-reid commented Jun 1, 2023

It's not directly supported, but you might be able to do what you want with any one of these 3 methods:

Method 1. Combine both maps into a single map hierarchy. For example, imagine a situation where the tiles follow a <z>/<x>/<y>.png naming convention, the low-res map goes up to level 8, and the high res map goes up to level 14. In that case you would combine the low res folders 0-8 into the same directory as the high-res folders 9-14.

Method 2. Use relative filesystem path to the tiles (this method doesn't work with http URL). You would specify the path to the tiles in the PlanetEarth.json as "url": "MyTiles/z/x/y.png". You would then create two asset packages, one with the high res tiles, and one with the low res tiles, and both packages would have their tile hierarchy under a MyTiles folder. When the engine searches at runtime for a tile, it will search in both asset packages, and find the appropriate tile in the appropriate package.

Method 3. Create a custom TileSource, derived from the TileSource base class. This custom TileSource would wraps multiple tile sources. You'd have to write a custom createImage function which calls createImage on the appopriate wrapped TileSource for the tile level queried.

@jiaxianghao
Copy link
Author

OK,I got it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants