Skip to content

Commit

Permalink
refactor: Improve error handling in addArrowToPolyline function
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmedhossamdev committed Aug 23, 2024
1 parent 637187c commit 794fdd8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/googleMaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ export async function createPolyline(shape) {
* @param {google.maps.Polyline} polyline - The polyline to which the arrow will be added.
*/
export function addArrowToPolyline(polyline) {
if (!(polyline instanceof google.maps.Polyline)) {
console.error('Invalid polyline');
return;
}
const arrowSymbol = {
path: google.maps.SymbolPath.FORWARD_CLOSED_ARROW,
scale: 2,
Expand Down

0 comments on commit 794fdd8

Please sign in to comment.