ted-piotrowski / mapbox-gl-shadow-simulator

Simulate terrain and structure shadows in a custom map layer
47 stars 5 forks source link

Remove method not available #3

Closed dadebue closed 1 year ago

dadebue commented 1 year ago

Hi Ted,

first and foremost: Awesome work, I really love the shade map and I'm thinking about including it in a project!

In the Readme you mention a remove method, to remove the shade from the map:

// sometime later...
    // ...remove layer
    shadeMap.remove();

Unfortunately this method doesn't exist on the class. See screenshot from VSCode: Screen 2022-11-30 at 12-45-47 Screen 2022-11-30 at 12-46-03

Im importing like this: import ShadeMap from 'mapbox-gl-shadow-simulator'

I'm creating the shade map like this:

const shadeMap = new ShadeMap({
  date: new Date(), // display shadows for current date
  color: '#01112f', // shade color
  opacity: 0.7,
   ...
}

Am I doing something wrong? Is there another way to remove the shade from the map?

BR Marco

ted-piotrowski commented 1 year ago

Nice catch. I just released version 0.16.0 on NPM, adding the remove() method. Let me know if it works for you.

dadebue commented 1 year ago

Yep working like a charm. Thanks :)