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

SpriteAtlas out of space #2164

Closed
mapmeld opened this issue Feb 21, 2016 · 10 comments
Closed

SpriteAtlas out of space #2164

mapmeld opened this issue Feb 21, 2016 · 10 comments

Comments

@mapmeld
Copy link

mapmeld commented Feb 21, 2016

In August 2014, I used MapBoxGL to make a Van Gogh texture map: http://mapmeld.github.io/van-gogh-map/#6/42.786/-73.260 which got some positive press: http://thecreatorsproject.vice.com/blog/explore-a-van-gogh-styled-google-maps-remix

I'm updating the map for current MapBoxGL and hopefully making it customizable for people to select other artworks and extract textures from their own images. I got two of the textures loading and then "SpriteAtlas out of space" warning (related to #1897). It is a large sprite.png file, so I shrunk it 50% and got more of the textures to load, but still issues: http://art-maps.herokuapp.com/create It actually depends where you first load the map, so if you open in Antarctica you'll see snow and water but no other textures loaded, and if you open in a forest area you'll get forest textures prioritized first.

screen shot 2016-02-19 at 11 19 28 pm

I don't want to make sprite.png smaller and smaller, so: Is there a target limit? Can I make SpriteAtlas bigger? Is this a bad idea?

Thanks! -- Nick

@lucaswoj
Copy link
Contributor

Hello! There is a finite amount of space in the SpriteAtlas and no easy way to make it larger. As far as I know, nobody has explored designing a basemap using high resolution textures like this.

ref #141

Anything else to add @bhousel @ansis? Any good follow-ups here?

@bhousel
Copy link
Contributor

bhousel commented Mar 11, 2016

This is such an awesome map! I love seeing people push the boundaries of what they can do with Mapbox GL..

I don't have anything to add other than that we do plan to improve the resource management of the glyph/sprite atlases so that they can resize larger if needed, and so that the atlas textures only contain what is needed to render the visible portion of the map.

We can leave this issue open and revisit it in a few months..

@mapmeld
Copy link
Author

mapmeld commented Mar 13, 2016

I've downloaded a copy of mapboxgl.js so that I could make SpriteAtlas bigger. Here's an example of it working: http://art-maps.herokuapp.com/map/view/56e4cbd0d08d821100da1f2a#3.09/27.71/-84.70

screen shot 2016-03-12 at 5 31 52 pm

The one landuse that I can't get to work is "sand". On the outdoors JSON, there's a straightforward definition of it: https://github.com/mapbox/mapbox-gl-styles/blob/master/styles/outdoors-v7.json#L400-L413 On my own map it's very similar (https://github.com/mapmeld/texture-maps/blob/master/static/sample-map.js#L120-L127) but using fill-pattern. I can't get it to show up on my map, so the Sahara looks super-empty. I tried switching to fill-color and it wasn't coming through

@lucaswoj
Copy link
Contributor

The one landuse that I can't get to work is "sand".

Please read the documentation for the data source you are using. https://www.mapbox.com/developers/vector-tiles/mapbox-terrain/#landcover

@mapmeld
Copy link
Author

mapmeld commented Mar 14, 2016

Thanks! I'm set for now, then.

@Politify
Copy link

Politify commented May 4, 2016

Has any progress been made on this? Currently trying to squeeze 338 icons onto the sprite but it keeps throwing the error. Resizing the SVGs doesn't seem to do much either.

@mapmeld
Copy link
Author

mapmeld commented May 4, 2016

@Politify for my project I made my own copy of mapboxgl.js and changed the one part where it generates the SpriteAtlas to this.spriteAtlas=new SpriteAtlas(500,1200)

@Politify
Copy link

Politify commented May 4, 2016

@mapmeld Thank you! You still hosted the sprites with Mapbox, right?

@mapmeld
Copy link
Author

mapmeld commented May 4, 2016

I host the sprite and specs myself.

  • when I initialize the map here, I have a script like
new mapboxgl.Map({
    container: 'map',
    center: [-73.26, 42.786],
    zoom: 6,
    style: {
      "version": 8,
      "sprite": spriteID,

and spriteID is a variable, in this case the string "/halfsprite"

that directs MapBoxGL to pull in /halfsprite.json for the coordinates, and /halfsprite.png, and (mandatory) retina version /[email protected] - they all share the same name

@Politify
Copy link

Politify commented May 5, 2016

Works pretty nicely but some markers are distorted. Not sure if you've run into this problem.
screenshot 2016-05-04 20 10 06

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

5 participants