Skip to content
Permalink
Browse files

Step 12.22: Implement getLocation for parsing the location

  • Loading branch information...
dotansimha authored and darkbasic committed Jan 24, 2017
1 parent 8d3c5e3 commit 1ff2fec4d7da6cf12b50241c716882049dbf81da
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/pages/messages/messages.ts
@@ -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 1ff2fec

Please sign in to comment.
You can’t perform that action at this time.