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

set default map style option to an empty style #6748 #7672

Closed
wants to merge 1 commit into from

Conversation

stepankuzmin
Copy link
Contributor

This PR sets the default map style option to an empty style according to #6748
I'm not sure about hardcoding version, maybe there is a more convenient way?

  • briefly describe the changes in this PR
  • manually test the debug page

@stepankuzmin
Copy link
Contributor Author

I've noticed, that unit test that checks if the load event is emitted after a style is set is now broken because a style is now always set.

t.test('emits load event after a style is set', (t) => {
    t.stub(Map.prototype, '_detectMissingCSS');
    const map = new Map({ container: window.document.createElement('div') });

    map.on('load', fail);

    setTimeout(() => {
        map.off('load', fail);
        map.on('load', pass);
        map.setStyle(createStyle());
    }, 1);

    function fail() { t.ok(false); }
    function pass() { t.end(); }
});

Should I rewrite this test, or it should work as conceived?

@andrewharvey
Copy link
Collaborator

andrewharvey commented Jun 28, 2019

I'm 👍 for this change.

Should I rewrite this test, or it should work as conceived?

I would say rewrite the test, as if the map would now have a default empty style then map.on('load') can be triggered even without setStyle.

@vakila
Copy link

vakila commented Oct 30, 2019

Closing this out as it has moved to #8924, thanks @stepankuzmin @arindam1993 !

@vakila vakila closed this Oct 30, 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

Successfully merging this pull request may close these issues.

3 participants