Skip to content
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
4 changes: 2 additions & 2 deletions packages/maps/src/gmap/logo.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
img[src*='//mapapi.qq.com/web/jsapi/logo/logo_def.png'],
.logo-text {
.tmap-contianer--hide-logo img[src*='//mapapi.qq.com/web/jsapi/logo/logo_def.png'],
.tmap-contianer--hide-logo .logo-text {
Comment on lines +1 to +2
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

这个类名 tmap-contianer--hide-logo 中存在一个拼写错误,contianer 应该为 container

另外,这个 CSS 文件是用于 Google Map (gmap) 的,但类名以 tmap 开头,并且 img 选择器 img[src*='//mapapi.qq.com/web/jsapi/logo/logo_def.png'] 针对的是腾讯地图的 logo。这看起来是错误的。

建议进行以下修改:

  1. 使用更合适的类名 gmap-container--hide-logo
  2. 移除针对腾讯地图 logo 的 img 选择器,因为它不适用于 Google Map。

这样可以使代码更清晰且正确。请记得在 packages/maps/src/gmap/map.ts 中也同步更新类名。

.gmap-container--hide-logo .logo-text {

display: none !important;
}
4 changes: 2 additions & 2 deletions packages/maps/src/tdtmap/logo.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
img[src*='//mapapi.qq.com/web/jsapi/logo/logo_def.png'],
.logo-text {
.tencent-map--hide-logo img[src*='//mapapi.qq.com/web/jsapi/logo/logo_def.png'],
.tencent-map--hide-logo .logo-text {
Comment on lines +1 to +2
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

这个 CSS 文件是用于天地图 (tdtmap) 的,但 img 选择器 img[src*='//mapapi.qq.com/web/jsapi/logo/logo_def.png'] 针对的是腾讯地图的 logo,这似乎不正确。

建议移除这个不相关的 img 选择器。另外,为了与 tmap 区分,建议使用更具体的类名,例如 tdtmap-container--hide-logo

由于 tdtmap/map.ts 中尚未实现 hideLogo 功能,这个 CSS 当前不会生效,但进行以上修改可以让未来的实现更清晰。

.tdtmap-container--hide-logo .logo-text {

display: none !important;
}
4 changes: 2 additions & 2 deletions packages/maps/src/tmap/logo.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
img[src*='//mapapi.qq.com/web/jsapi/logo/logo_def.png'],
.logo-text {
.tencent-map--hide-logo img[src*='//mapapi.qq.com/web/jsapi/logo/logo_def.png'],
.tencent-map--hide-logo .logo-text {
Comment on lines +1 to +2
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

这里的类名 .tencent-map--hide-logopackages/maps/src/tmap/map.tshideLogo 方法实际添加的类名 tmap-contianer--hide-logo 不一致。这会导致隐藏 logo 的功能失效。

tmap-contianer--hide-logo 中还存在拼写错误 (contianer 应为 container)。

为了修复这个 bug 并提高代码一致性,建议将 TypeScript 文件中使用的类名统一为 tencent-map--hide-logo,因为它能更清晰地表达其用于腾讯地图的意图。

请在 packages/maps/src/tmap/map.ts 中做出如下修改:

// packages/maps/src/tmap/map.ts:507
DOM.addClass(container, 'tencent-map--hide-logo');

display: none !important;
}

Expand Down
Loading