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

Allow "None" and color values for basemaps #635

Closed
makella opened this issue Apr 30, 2019 · 11 comments
Closed

Allow "None" and color values for basemaps #635

makella opened this issue Apr 30, 2019 · 11 comments
Assignees

Comments

@makella
Copy link
Contributor

makella commented Apr 30, 2019

Context

There will be times where a user may not want a basemap and/or would want to add their own layer of contextual geography.

Since basemaps are Mapbox GL, should we have some sort of "helper" for no basemap? I'm assuming this would default to white or black with an option available to change the color.

[ ] Empty basemap

Allows to display a map without basemap

Map(
    [Layer(Dataset('populated_places')], 
    context=context,
    basemap=None
)

[ ] Color basemap

Use a single background color

Map(
    [Layer(Dataset('populated_places')], 
    context=context,
    basemap='#FABADA'
)
@andy-esch
Copy link
Contributor

I added support beyond our basemaps in the original vmap function: https://cartoframes.readthedocs.io/en/stable/contrib.html#cartoframes.contrib.vector.vmap It takes a dictionary of a mvt source and an optional token (mostly for mapbox maps).

I also opened this a while back but didn't write much: #509

@andy-esch
Copy link
Contributor

I also want a mvt source for mars terrain

@makella
Copy link
Contributor Author

makella commented Apr 30, 2019

oops sorry didn't realize there was already an open issue! if you prefer, we can close this or vice-versa. Regardless I really like the idea of the no basemap option and adding other basemaps (including Mars) :)

@andy-esch
Copy link
Contributor

I'll close the other as this already has more content. But I agree 100% that no basemaps means users can be more creative on visualizations. It also means more art can happen, which is something I'd love to see in cartoframes :)

@elenatorro
Copy link
Contributor

+1 🎉

@andy-esch
Copy link
Contributor

I also wonder if just letting basemap=False or basemap=None is all we need instead of a helper.

@elenatorro
Copy link
Contributor

I'd go for:

  • basemap=False for no basemap
  • basemap='#FABADA' to set the color

@makella
Copy link
Contributor Author

makella commented May 3, 2019

like!!

@elenatorro elenatorro changed the title Helper for a no basemap option? Allow "None" and color values for basemaps May 3, 2019
@elenatorro elenatorro added the Next label May 3, 2019
@Jesus89 Jesus89 self-assigned this May 17, 2019
@Jesus89
Copy link
Member

Jesus89 commented May 17, 2019

Hi!

I have made research in the MGL API. These are the map styles we need to use in these cases:

basemap=False

style: {
  'version': 8,
  'sources': {},
  'layers': []
}

basemap='#0F0'

style: {
  'version': 8,
  'sources': {},
  'layers': [{
      'id': 'background',
      'type': 'background',
      'paint': {
        'background-color': '#0F0'
      }
  }]
}

@makella
Copy link
Contributor Author

makella commented May 17, 2019

niiiiice!!

@Jesus89
Copy link
Member

Jesus89 commented May 20, 2019

I have implemented basemap= None, True, False, 'string color'.

@Jesus89 Jesus89 closed this as completed May 20, 2019
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

4 participants