Skip to content

Commit

Permalink
chore: changes according to code review
Browse files Browse the repository at this point in the history
  • Loading branch information
raaymax committed Feb 19, 2024
1 parent 62583ad commit e68fb69
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 25 deletions.
2 changes: 1 addition & 1 deletion ui/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 ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@
"prettier": "^3.0.1",
"vite": "^4.4.9",
"vite-plugin-monaco-editor": "^1.1.0",
"volar-service-vetur": "latest"
"volar-service-vetur": "*"
}
}
41 changes: 18 additions & 23 deletions ui/src/core_components/embeds/CoreGoogleMaps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,32 +125,28 @@ const buildMarkers = async () => {
if (!fields.markers.value) return;
const { AdvancedMarkerElement } = await google.maps.importLibrary("marker") as google.maps.MarkerLibrary;
clearMarkers();
try {
const markersData = fields.markers.value as ({ lat: number; lng: number; name: string; }[])
markersData.forEach((markerData) => {
const marker = new AdvancedMarkerElement({
position: {
lat: markerData.lat,
lng: markerData.lng,
},
map,
title: markerData.name,
});
const markersData = fields.markers.value as ({ lat: number; lng: number; name: string; }[])
markersData.forEach((markerData) => {
const marker = new AdvancedMarkerElement({
position: {
lat: markerData.lat,
lng: markerData.lng,
},
map,
title: markerData.name,
});
markers.push(marker);
markers.push(marker);
marker.addListener('click', () => {
const event = new CustomEvent("gmap-marker-click", {
detail: {
payload: markerData,
},
});
rootEl.value.dispatchEvent(event);
marker.addListener('click', () => {
const event = new CustomEvent("gmap-marker-click", {
detail: {
payload: markerData,
},
});
rootEl.value.dispatchEvent(event);
});
} catch (e) {
console.log(e);
}
});
};
const clearMarkers = () => {
Expand Down Expand Up @@ -214,7 +210,6 @@ watch(fields.mapId, initMap);
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0);
}
.CoreGoogleMaps.beingEdited.selected .mask {
Expand Down

0 comments on commit e68fb69

Please sign in to comment.