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

Display some kind of warning if mapbox-gl CSS is is missing #5359

Closed
anandthakker opened this issue Sep 27, 2017 · 3 comments
Closed

Display some kind of warning if mapbox-gl CSS is is missing #5359

anandthakker opened this issue Sep 27, 2017 · 3 comments

Comments

@anandthakker
Copy link
Contributor

We should somehow issue a warning if the mapbox-gl CSS is missing. As suggested by @nfarina in #4048 (comment), a div added to the map's target element and hidden by our default CSS should do the trick.

@eltonjuan
Copy link

eltonjuan commented Nov 6, 2017

A random callout but if you're delivering your CSS in JS (e.g. local development with Webpack) the injection of this div causes Mapbox's calculation for determining the canvas size to be thrown off.

Not really an issue since you should be generating a CSS bundle in production, but was driving me a little mad (thinking my CSS rules were messed up). Figured I'd call it out in case anyone else goes searching...

@woodpav
Copy link

woodpav commented Nov 21, 2017

@eltonjuan How did you get around this? V annoying

@Srounsroun
Copy link

@tywoodpav Make sure to reference css link in index.html headers

<link href='https://api.mapbox.com/mapbox-gl-js/v0.42.0/mapbox-gl.css' rel='stylesheet' />

and load the correct style in mapbox:

var map = new mapboxgl.Map({
container: 'YOUR_CONTAINER_ELEMENT_ID',
style: 'mapbox://styles/mapbox/streets-v10'
});

as describe in https://www.mapbox.com/install/js/bundler-install/

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

No branches or pull requests

5 participants