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

Allow Customization of OpenLayers Format Parameters #408

Merged
merged 3 commits into from
Jun 12, 2024

Conversation

ambrazasp
Copy link
Contributor

As described in #407, format option is set as new MVT() for OpenLayers.

However in some cases you need to rewrite format and pass MVT options.

There is two solutions:

  • Pass MVT options
  • Pass custom formater

In this case it's easier to go with 2nd option (passing custom formatter).

From now on you can do something like this:

new PMTilesVectorSource({
  ..., 
  format: new MVT({
    featureClass: ol.Feature,
    idProperty: 'customId',
  }),
})

openlayers/src/index.js Outdated Show resolved Hide resolved
@bdon bdon merged commit 15d5166 into protomaps:main Jun 12, 2024
2 checks passed
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.

2 participants