GPlates / gplates-app

GPlates Mobile App
https://www.gplates.org
2 stars 0 forks source link

Add cities #149

Closed michaelchin closed 1 year ago

michaelchin commented 2 years ago
  1. get the city data from https://gws.gplates.org/mobile/get_cities
  2. draw a dot and label for each city
  3. reconstruct the coordinates when age is changed

This is very similar to the code below.

https://github.com/GPlates/gplates-app/blob/0a4bfaee38f014511d51e1a2f05033684e431bf7/src/functions/presentDayLocations.ts#L23-L49

https://github.com/GPlates/gplates-app/blob/0a4bfaee38f014511d51e1a2f05033684e431bf7/src/components/AddLocationWidget.tsx#L146-L152

michaelchin commented 2 years ago

And after you fetch data from server, save the data into local storage. we can use the data from local storage if network is not available. See the code below.

https://github.com/GPlates/gplates-app/blob/0a4bfaee38f014511d51e1a2f05033684e431bf7/src/functions/rasterMaps.ts#L111-L147

yiyanw commented 2 years ago

@michaelchin Which button do those locations belong to? Location widget or create a new button to handle it?

michaelchin commented 2 years ago

The cities should be one of the vector layers. This layer is different from other layers and need some special treatment. See the code snippets in this Issue.


From: yiyanw @.> Sent: Thursday, 29 September 2022 15:48 To: GPlates/gplates-app @.> Cc: michaelchin @.>; Mention @.> Subject: Re: [GPlates/gplates-app] Add cities (Issue #149)

@michaelchinhttps://github.com/michaelchin Which button do those locations belong to? Location widget or create a new button to handle it?

— Reply to this email directly, view it on GitHubhttps://github.com/GPlates/gplates-app/issues/149#issuecomment-1261797329, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAUQKPF3VNW7TP7DGNT5JKTWAUUSNANCNFSM6AAAAAAQYHS6NY. You are receiving this because you were mentioned.Message ID: @.***>

yiyanw commented 2 years ago

@michaelchin I checked the URL's data

{ "coords": { "Sydney": [151.2099, -33.8651], "Melbourne": [144.9465, -37.8409], "Perth": [115.8613, -31.9523], "Darwin": [130.8444, -12.4637], "Adelaide": [138.6007, -34.9285] }, "plate-ids": { "SETON2012": [801, 801, 801, 801, 801], "MERDITH2021": [801, 801, 801, 801, 801], "MULLER2019": [801, 801, 801, 801, 801] } }

what do "plate-ids" stand for?

michaelchin commented 2 years ago

@michaelchin I checked the URL's data

{ "coords": { "Sydney": [151.2099, -33.8651], "Melbourne": [144.9465, -37.8409], "Perth": [115.8613, -31.9523], "Darwin": [130.8444, -12.4637], "Adelaide": [138.6007, -34.9285] }, "plate-ids": { "SETON2012": [801, 801, 801, 801, 801], "MERDITH2021": [801, 801, 801, 801, 801], "MULLER2019": [801, 801, 801, 801, 801] } }

what do "plate-ids" stand for?

See the code below, the function takes coordinates and plate id (pid) as input parameters. You need to find plate ids according to the current model name, such as "MULLER2019".

https://github.com/GPlates/gplates-app/blob/0a4bfaee38f014511d51e1a2f05033684e431bf7/src/functions/presentDayLocations.ts#L38-L41

You also need to fetch the finite rotations for the plate ids before calling the above function. See the code below.

https://github.com/GPlates/gplates-app/blob/0a4bfaee38f014511d51e1a2f05033684e431bf7/src/functions/presentDayLocations.ts#L32-L34

yiyanw commented 1 year ago

@michaelchin I check the code in LocationWidget, I found that if I add location on "present day" raster map, the point will not move with age changing when we change to timeline-valid raster map. Is that same for cities location?

Btw, Do we need to fly to city's position when we choose it?

michaelchin commented 1 year ago

This is a bug in LocationWidget. I will fix it. The cities should move when the time changes.


From: yiyanw @.> Sent: Sunday, 2 October 2022 1:27 To: GPlates/gplates-app @.> Cc: michaelchin @.>; Mention @.> Subject: Re: [GPlates/gplates-app] Add cities (Issue #149)

I check the code in LocationWidget, I found that if I add location on "present day" raster map, the point will not move with age changing when we change to timeline-valid raster map. Is that same for cities location?

— Reply to this email directly, view it on GitHubhttps://github.com/GPlates/gplates-app/issues/149#issuecomment-1264398257, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAUQKPE4AEHCYRXEIHFQRWLWBBJ6JANCNFSM6AAAAAAQYHS6NY. You are receiving this because you were mentioned.Message ID: @.***>

yiyanw commented 1 year ago

@michaelchin ok, I will try to fix it.

yiyanw commented 1 year ago

@michaelchin cities added:

demo:

https://user-images.githubusercontent.com/31875861/193440619-e6e75160-7254-4497-b428-258fb11a6f83.mp4