Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual representation of capitals #348

Open
cburroughs opened this issue Jul 1, 2020 · 4 comments
Open

Visual representation of capitals #348

cburroughs opened this issue Jul 1, 2020 · 4 comments
Labels
conception Scope of the deck, memorisation, contribution guidelines, etc.

Comments

@cburroughs
Copy link

I offer this more as a discussion topic rather than something I'm sure is a good idea, but with v4 on the horizon it felt like the appropriate time.

Aside from tiny islands in need of a zoom box (generally already covered by tickets, and greatly improved over the past year!) I find that Capital-->Country tends to be where I struggle the most. I suspect this is because my brain doesn't have anything visual to latch (flags, maps) onto, so it turns into a rote "what does this name I may struggle to pronounce point to". Sometime I can go back and try to come up with my own mnemonics, or read the wikipedia article on the capital and hope that gives me some context to latch on to. Both of those go one at a time and I tend to only realize I need to do it once I have a leech on my hands.

From doing this I noticed that in most (all?) cases the wikipedia article for capitals has a map of where the capital is within the country. I wonder if would be sensible and (relatively) low effort to include that map as a field and use it for additional context. So concretely the card for Country-->Capital would be Country-->Capital,CapitalMap. I know this is somewhat inconsistent with how the rest of the fields are used, but I wanted to offer my experience as a learner before all my Ultimate Geography cards are mature (I hope soon!).

@axelboc axelboc added the conception Scope of the deck, memorisation, contribution guidelines, etc. label Jul 1, 2020
@axelboc axelboc added the better-deck-manager Improvements feasible with a better deck manager label Jul 13, 2020
@axelboc axelboc removed the better-deck-manager Improvements feasible with a better deck manager label Jan 16, 2021
@Erim24
Copy link
Collaborator

Erim24 commented Apr 16, 2021

I totally agree with you and would wish that such maps could be included.

The way how wikipedia does this is by adding a pin via some extra markup to a map. A while ago I was wondering if Anki would support something like that as well? (But I wasn't familiar enough with how Anki works to achieve that)
If possible that would enable Ultimate Geography to just add some relative coordinates to add a pin as an overly onto the current maps. In that way the size of the deck wouldn't increase too much (since I remember that being a concern in the past)

@aplaice
Copy link
Collaborator

aplaice commented Apr 16, 2021

Anki's "cards" are embedded HTML pages usually scriptable with JavaScript, almost exactly like normal web pages.

Anki desktop, Ankidroid and Ankimobile (iOS) all definitely have JS support. There are slight differences, but it's not much worse than the diversity among web browsers. I'm not sure about Ankiweb — I haven't tested and there might be security concerns regarding AnkiWeb allowing what is effectively third-party JS running on their pages.

Hence, something like Wikipedia's approach should be doable.

The main issue is that the "panning" of our (AUG) maps differs from map to map, and isn't known for the vast majority of them.

For each map we know the projection (Winkel Tripel with the standard value of φ_1, always(?)) and the central longitude (usually 0°, 11°30' East or 150 ° East), but we don't know how the map was panned or zoomed (we're not displaying the entire globe). I'm not sure how easy it'd be to extract this information from the SVGs. (I've been thinking about this for a while — it'd be also useful for #267 — and have some ideas, but I haven't tried anything yet — too many things to do, and too little time...)

If this information were obtained, then displaying a pin should be relatively straightforward. (In order to calculate the position of the pin on the map AFAICT we just need:

  1. the longitude of the capital,
  2. the latitude of the capital,
  3. the central longitude for the W3 projection
  4. the "x" panning of the map
  5. the "y" panning of the map
  6. the zoom level of the map

This position information could be stored as a list of numbers in an extra field. We could also have some JS in the relevant template that'd process this info and display a pin on top of the map, just like Wikipedia.)


If we don't want a JS-solution, for whatever reason, we could generate SVG overlays for each of the capitals. These would just be SVG "pins" in the correct positions, in transparent canvases. They could be applied to our existing maps via CSS filters.

Since such SVG overlays would be extremely lightweight, we wouldn't add much to the size of the deck.

(Obviously, we'd still need to solve the panning/zoom information problem.)


OTOH if we make the maps with pinned capitals optional, then having hardcoded images wouldn't be too much of a problem. It'd have the advantage that we could use Wikipedia's "pin" maps, which have known panning/zoom level. It'd have the disadvantage that the "style" of these maps wouldn't fit the style of our existing AUG maps.


We could also look at what the Anki UK geography deck does — they seem to have pins for cities!

@drake-macmillan
Copy link

I have used the following code to have a map for each capital:

<iframe src="https://maps.google.com/maps?q={{Capital}}&t=&z=6&ie=UTF8&iwloc=&output=embed" id="gmap_canvas" frameborder="0" scrolling="no" style="width: 98%; height: 600px;"></iframe>

Adjusting the "z=" part can make the map more zoomed in or out.

I also put a Wikipedia page within the card with this:

<iframe src="https://en.wikipedia.org/wiki/{{Capital}}" style="height: 100vh; width:100%;" seamless="seamless"></iframe>

End result looks like this:
Screenshot 2023-04-24 at 3 05 49 PM

@melissis
Copy link
Contributor

Hence, something like Wikipedia's approach should be doable.

If I understand anything at all, the HTML for displaying map and pin on Wikipedia is generated from this lua script: Module:Location map. It can also fetch a map file based on what location name you enter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conception Scope of the deck, memorisation, contribution guidelines, etc.
Development

No branches or pull requests

6 participants