Skip to content

Commit

Permalink
Update gemstone demo
Browse files Browse the repository at this point in the history
  • Loading branch information
chisandrei committed Jun 28, 2024
1 parent af72800 commit 63c5b21
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
Extension { #name : #GtRmGeoGpsRecord }

{ #category : #'*GToolkit-RemotePhlow-GeolifeDemo-GTSpecific' }
GtRmGeoGpsRecord >> gtViewOnGoogleMapFor: aView [
<gtView>

^ aView forward
title: 'On Google Map';
priority: 56;
object: [
GtWebViewElement new
url: self googleMapsUrl ];
view: #gtLiveFor:
]

{ #category : #'*GToolkit-RemotePhlow-GeolifeDemo-GTSpecific' }
GtRmGeoGpsRecord >> gtViewOnMapFor: aView [
<gtView>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ GtRmGeoGpsRecord >> asPoint [
^ self longitude @ self latitude
]

{ #category : #accessing }
GtRmGeoGpsRecord >> googleMapsUrl [
^ ('https://www.google.com/maps/search/?api=1&query={lat}%2C{long}' format: {
'lat' -> self latitude printString.
'long' -> self longitude printString} asDictionary)
]

{ #category : #initialization }
GtRmGeoGpsRecord >> initializeFomJsonDictionary: aDictionary [
self latitude: (aDictionary at: #latitude).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ GtRmGeoGpsTrajectory >> distance [

{ #category : #'gt - extensions' }
GtRmGeoGpsTrajectory >> gtViewGpsRecordsFor: aView [

<gtView>

^ aView columnedList
title: 'Records';
priority: 10;
items: [ self records items ];
column: 'Timestamp' text: [ :aRecord | aRecord timestamp ];
column: 'Latitude' text: [ :aRecord | aRecord latitude ];
Expand All @@ -44,7 +46,8 @@ GtRmGeoGpsTrajectory >> gtViewGpsRecordsFor: aView [

{ #category : #accessing }
GtRmGeoGpsTrajectory >> gtViewMapFor: aView [

<gtView>

^ aView explicit
title: 'OSM';
priority: 20;
Expand Down

0 comments on commit 63c5b21

Please sign in to comment.