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

Issue changing style of map with layer that has images #487

Closed
benrudolph opened this issue Dec 31, 2017 · 1 comment
Closed

Issue changing style of map with layer that has images #487

benrudolph opened this issue Dec 31, 2017 · 1 comment

Comments

@benrudolph
Copy link
Contributor

This library throws an error if you try to change the style of the react map that contains a layer with loaded images

For example:

<ReactMap
  style={this.props.style}
  ...
>
  <Layer id="my-features" images={myImages}>
   {features}
  </Layer>
</ReactMap>

Then when you change this.props.style, the Layer throws an error because it tries to add the same images.

I believe the fix is to add a check for hasImage here: https://github.com/alex3165/react-mapbox-gl/blob/master/src/layer.ts#L181

@benrudolph benrudolph changed the title Issue changing style of map with autogenerated layer Issue changing style of map with layer that has images Dec 31, 2017
@alex3165
Copy link
Owner

alex3165 commented Jan 8, 2018

Hi @benrudolph Sorry for the late reply, there is an open issue for that #464 I was waiting to get some types from definitelyTyped to be merged but it seems quite critical so I might go ahead with a temporary hack around the types. In the meantime you can directly upload your images in mapbox studio if you are using it, they will be downloaded with your style

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

2 participants