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

Implement v2 styles endpoint and update layer inheritance #182

Merged
merged 20 commits into from
May 30, 2023

Conversation

gowin20
Copy link
Contributor

@gowin20 gowin20 commented May 25, 2023

Implements #150 #174 #170

#150 - Change VectorBasemapLayer to inherit from VectorTileLayer

  • VectorBasemapLayer now inherits onAdd and _createMaplibreLayer from VectorTileLayer, and performs a super call to the VectorTileLayer constructor.
  • Some functions remain unmerged, such as onRemove and _asyncAdd, due to the dynamic data attribution in VectorBasemapLayer

#174 - add support for the v2 basemap styles service

(see #175)

  • Added new getBasemapStyleV2Url function that returns a formatted reference to the new v2 endpoint
  • New version parameter in VectorBasemapLayer that specifies the endpoint to access (1 or 2) If not provided, the version will attempt to set itself based on the provided style enumeration
  • New language parameter that works with v2 of the service, accepts valid language parameters

#170 - fix default pane for VectorBasemapLayer

(see #181)

  • Fixed a bug where VectorBasemapLayer was not being added to the tilePane
  • Added additional code to create a new esri-details pane for styles of type :Details//details
  • Changed default z-index of esri-labels pane to display below the overlayPane
  • Added unit tests

@gowin20 gowin20 changed the title Rebase basemaps Add support for the Basemap styles service V2 endpoint May 25, 2023
@gowin20 gowin20 changed the title Add support for the Basemap styles service V2 endpoint Implement v2 styles endpoint and update layer inheritance May 25, 2023
@gavinr gavinr requested review from patrickarlt and gavinr May 26, 2023 13:25
Copy link
Contributor

@gavinr gavinr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall seems to work for me. A few small things:

examples/languages.html Outdated Show resolved Hide resolved
})
}).to.throw('The \'language\' parameter is not supported for custom basemap styles')
})

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a unit test for the new functionality "it should load a v2 basemap if using a v2 basemap key enum even if not passing the version: 2 property" - can you add a unit test for that case?

src/VectorTileLayer.js Outdated Show resolved Hide resolved
Copy link
Contributor

@patrickarlt patrickarlt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Minor code suggestion but please add the test that @gavinr has indicated.

src/Util.js Outdated Show resolved Hide resolved
@gavinr gavinr merged commit 8c31733 into Esri:master May 30, 2023
@gavinr
Copy link
Contributor

gavinr commented May 31, 2023

Released in v4.1.0.

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