11declare var google : any ;
22import styles from './map-styles' ;
33import getMarkerPopup from './map-popup' ;
4- import { MarkerClusterer , SuperClusterAlgorithm } from '@googlemaps/markerclusterer' ;
4+ import {
5+ MarkerClusterer ,
6+ SuperClusterAlgorithm ,
7+ } from '@googlemaps/markerclusterer' ;
58
69export default async ( ) : Promise < void > => {
710 const mapElement = document . getElementById ( 'map' ) as HTMLElement ,
@@ -15,13 +18,16 @@ export default async (): Promise<void> => {
1518 places : any [ ] = [ ] ,
1619 markers : google . maps . marker = [ ] ;
1720 const infoWindow = new google . maps . InfoWindow ( ) ;
18- const map = new google . maps . Map ( document . getElementById ( 'map' ) as HTMLElement , {
19- mapTypeId : 'roadmap' ,
20- zoom : 12 ,
21- mapTypeControl : false ,
22- streetViewControl : false ,
23- styles,
24- } ) ;
21+ const map = new google . maps . Map (
22+ document . getElementById ( 'map' ) as HTMLElement ,
23+ {
24+ mapTypeId : 'roadmap' ,
25+ zoom : 12 ,
26+ mapTypeControl : false ,
27+ streetViewControl : false ,
28+ styles,
29+ } ,
30+ ) ;
2531
2632 try {
2733 const response = await fetch ( apiUrl , {
@@ -38,7 +44,11 @@ export default async (): Promise<void> => {
3844 const buildContent = ( { place } : { place : any } ) : string => {
3945 let coords = [ ] ;
4046 let htmlString = '<div class="popup-bubble-content">' ;
41- htmlString += place . image ? '<img class="popup-bubble-content-image" src="/storage/' + place . image . path + '" height="40" alt="">' : '' ;
47+ htmlString += place . image
48+ ? '<img class="popup-bubble-content-image" src="/storage/' +
49+ place . image . path +
50+ '" height="40" alt="">'
51+ : '' ;
4252 htmlString += '<h3 class="popup-bubble-content-title">' ;
4353 htmlString += place . title [ locale ] ;
4454 htmlString += '</h3>' ;
@@ -49,7 +59,10 @@ export default async (): Promise<void> => {
4959 htmlString += coords . join ( '<br>' ) ;
5060 htmlString += '</div>' ;
5161 if ( ! noButton ) {
52- htmlString += '<a class="popup-bubble-content-button" href="' + place . url + '">' ;
62+ htmlString +=
63+ '<a class="popup-bubble-content-button" href="' +
64+ place . url +
65+ '">' ;
5366 htmlString += buttonLabel ?? 'More info' ;
5467 htmlString += '</a>' ;
5568 }
0 commit comments