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

Non-Earth maps/projections (flat maps)? #1228

Closed
GarrettAlbright opened this issue May 9, 2022 · 6 comments
Closed

Non-Earth maps/projections (flat maps)? #1228

GarrettAlbright opened this issue May 9, 2022 · 6 comments
Labels
duplicate This issue or pull request already exists

Comments

@GarrettAlbright
Copy link

GarrettAlbright commented May 9, 2022

maplibre-gl-js version: All

Question

I'm investigating MapLibre as a more performant alternative for Leaflet for a client project (in particular we're finding maps which have very many markers are rather slow and cumbersome to use). The project does not display Earth maps; rather, maps representing levels or "worlds" in video games with markers indicating locations of collectible items and such. (We host our own tilesets for the maps.) Thus the maps never represent anything other than flat rectangles. We store marker locations as X, Y points in our database corresponding with the map being shown at the maximum zoom level.

With Leaflet this is possible using the Simple CRS, but as far as I can tell, this is not possible in MapBox; even if we cajoled the maxBounds option to force the map to only show an area much smaller than the real world, we still have the issue of MapLibre only using a map projection which would not show the lines of latitude and longitude as a grid of perfect squares, such that we couldn't accurately position our markers according to the X, Y locations we have stored for them.

Am I wrong? Is there a way to display an undistorted "flat" map in MapLibre and accurately place our markers without too much trouble?

@wipfli
Copy link
Member

wipfli commented May 10, 2022

That is an interesting use case. Maybe your question is related to custom projections. https://roadmap.maplibre.org/c/91-custom-coordinate-system-epsg-non-mercator-projection

@wipfli
Copy link
Member

wipfli commented May 10, 2022

By the way you might want to pack the points into vector tiles with something like tippecanoe or planetiler...

@GarrettAlbright
Copy link
Author

That is an interesting use case. Maybe your question is related to custom projections. https://roadmap.maplibre.org/c/91-custom-coordinate-system-epsg-non-mercator-projection

I do think allowing for a different projection is part of this, yes. MapBox has an equirectangular projection which seems like it'd do what we need.

By the way you might want to pack the points into vector tiles with something like tippecanoe or planetiler...

I'm not sure what you're saying here. Are you saying we should make vectorized tiles instead of just using the bitmaps we're using now? While that might be a plan for the future, our current goal is just to find a faster mapping system which can match the functionality of what we currently have. From there we can start considering improvements like that. :)

@HarelM
Copy link
Member

HarelM commented Aug 21, 2022

Is this a duplicate of #168?

@HarelM HarelM added enhancement New feature or request need more info Further information is requested labels Aug 21, 2022
@GarrettAlbright
Copy link
Author

GarrettAlbright commented Aug 22, 2022

Is this a duplicate of #168?

Partially, though importantly, for my needs, "another way to project the globe" is not what I'm asking for; I'm asking for "a way to show a flat plane." Or, if it helps to think of it that way, "a way to show a map that is already projected" can also work.

By the way, in case it helps anyone else, what I ended up doing for my client is keeping Leaflet but using Leaflet.PixiOverlay to show markers. This uses PixiJS for drawing stuff which renders to either WebGL or the browser canvas; we ended up forcing the canvas approach because most of our markers used different marker images and this was causing issues with WebGL not wanting to use that many textures. It was a lot of work since all of the custom marker stuff we were doing with the DOM before had to be redone as Pixi commands, but the end result was sufficiently fast maps no matter how many markers we cram onto them.

@HarelM
Copy link
Member

HarelM commented Aug 22, 2022

I think #168 is basically it, if you can specify coordinates system which will create flat plane you're good to go.
Also, as mentioned in the linked issue d3 can also help here I believe.
Feel free to add you use case to the linked issue.
Closing...

@HarelM HarelM closed this as completed Aug 22, 2022
@HarelM HarelM added duplicate This issue or pull request already exists and removed enhancement New feature or request need more info Further information is requested labels Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants