Skip to content

Commit

Permalink
Step 11.22: Implement getLocation for parsing the location
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha authored and DAB0mB committed Feb 13, 2017
1 parent 27962d3 commit 4f76696
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions client/imports/pages/messages/messages.ts
Expand Up @@ -241,4 +241,14 @@ export class MessagesPage implements OnInit, OnDestroy {

popover.present();
}

getLocation(locationString: string): Location {
const splitted = locationString.split(',').map(Number);

return <Location>{
lat: splitted[0],
lng: splitted[1],
zoom: Math.min(splitted[2] || 0, 19)
};
}
}

0 comments on commit 4f76696

Please sign in to comment.