-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #480 from boostcampwm2023/map-개선
[Refactor] Tmap 렌더링 속도 개선을 위한 스펙 변경 (Tmapv2 → Tmpav3)
- Loading branch information
Showing
11 changed files
with
77 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,33 @@ | ||
import { ReactComponent as Pin } from '@/assets/icons/pin.svg'; | ||
import { TMap, TMapLatLng } from '@/types'; | ||
import { reactElementToString } from '@/utils'; | ||
|
||
import * as styles from './index.css'; | ||
|
||
const { Tmapv2 } = window; | ||
const { Tmapv3 } = window; | ||
|
||
type MarkerProps = { | ||
mapContent: TMap; | ||
position: TMapLatLng; | ||
theme: 'green' | 'red'; | ||
icon?: string; | ||
labelText?: string; | ||
}; | ||
|
||
export const Marker = ({ mapContent, position, theme }: MarkerProps) => | ||
new Tmapv2.Marker({ | ||
export function Marker({ | ||
mapContent, | ||
position, | ||
theme, | ||
labelText, | ||
}: MarkerProps) { | ||
return new Tmapv3.Marker({ | ||
position, | ||
iconHTML: reactElementToString( | ||
<Pin className={styles.marker({ theme })} width={50} height={50} />, | ||
), | ||
iconSize: new Tmapv2.Size(50, 50), | ||
map: mapContent, | ||
icon: `/src/assets/icons/marker-${theme}.svg`, | ||
iconSize: new Tmapv3.Size(50, 50), | ||
label: labelText | ||
? reactElementToString( | ||
<span className={styles.label({ theme })}>{labelText}</span>, | ||
) | ||
: '', | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export const DEFAULT_ZOOM_LEVEL = 16; | ||
export const INITIAL_LATITUDE = 37.566481622437934; | ||
export const INITIAL_LONGITUDE = 126.98502302169841; | ||
export const MAX_ZOOM_LEVEL = 17; | ||
export const MIN_ZOOM_LEVEL = 7; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters