Skip to content
Merged
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
1 change: 1 addition & 0 deletions src/DGCustomization/src/DGMap.BaseLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ DG.Map.addInitHook(function() {
updateWhenIdle: false, // it's okay with preview tiles
previewUrl: previewTileUrl,
key: apiKey,
crossOrigin: true // force Origin request header
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

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

The crossOrigin option should be set to a string value like 'anonymous' or 'use-credentials', not a boolean true. While true will work as a truthy value when checked in conditional statements, it doesn't follow the standard Leaflet convention and HTML CORS attribute standards. The standard approach is to use crossOrigin: 'anonymous' to enable CORS with anonymous credentials, which will force the Origin request header.

Suggested change
crossOrigin: true // force Origin request header
crossOrigin: 'anonymous' // force Origin request header

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

Кажется, справедливое замечание. Нет?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Иишница путает немного. Это же опция инициализации объекта тайлового слоя.
https://github.com/Leaflet/Leaflet/blob/main/src/layer/tile/TileLayer.js#L163

Copy link
Contributor

Choose a reason for hiding this comment

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

А. Точно. Да, она тут запутала. Аппрув я поставил.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

И даже более того. Это я сослался на новую версию leaflet. А у нас 1.0.1, где вообще ТОЛЬКО boolean.
На это указывает и наш перекрытый метод
https://github.com/2gis/mapsapi/blob/master/src/DGCustomization/src/DGMobileImprove.js#L166
И в 1.0.1 ихсоднике точно так же. Так что строку тут вообще нельзя.

});

var currentTilesLang = ''; // 'ar' | ''
Expand Down
Loading