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

Update attribution options #83

Merged
merged 2 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
### Bug Fixes
### Others

## NEXT
### Bug Fixes
- Improved attribution management
### Others
- Update to MapLibre GL JS v4.1.3


## 2.0.1
### Bug Fixes
- Bundling issue solved by [#79](https://github.com/maptiler/maptiler-sdk-js/pull/79)
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"@maptiler/client": "^1.8.1",
"events": "^3.3.0",
"js-base64": "^3.7.4",
"maplibre-gl": "4.1.2",
"maplibre-gl": "^4.1.3",
"uuid": "^9.0.0"
}
}
5 changes: 3 additions & 2 deletions src/Map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ export class Map extends maplibregl.Map {
style,
maplibreLogo: false,
transformRequest: combineTransformRequest(options.transformRequest),
...(options.attributionControl ?? { attributionControl: false }),
});

if (config.caching) {
Expand Down Expand Up @@ -377,8 +378,8 @@ export class Map extends maplibregl.Map {
options.logoPosition,
);

// if attribution in option is `false` but the the logo shows up in the tileJson, then the attribution must show anyways
if (options.attributionControl === false) {
// if attribution in option is `false` or not provided, but the the logo shows up in the tileJson, then the attribution must show anyways
if (!options.attributionControl) {
this.addControl(
new AttributionControl({
customAttribution: options.customAttribution,
Expand Down
Loading