From c85b245b8ffe1a6f01ce73510c70c6a388dd85d1 Mon Sep 17 00:00:00 2001 From: Matt Stiles Date: Sun, 5 Jan 2025 09:58:44 -0800 Subject: [PATCH] fixing search --- docs/flags.html | 3768 ++++++++++++++++++++--------------------- docs/index.html | 3 + docs/static/script.js | 279 ++- static/script.js | 279 ++- templates/index.html | 3 + 5 files changed, 2142 insertions(+), 2190 deletions(-) diff --git a/docs/flags.html b/docs/flags.html index 37ab67e..d4b8531 100644 --- a/docs/flags.html +++ b/docs/flags.html @@ -22,92 +22,92 @@ Click card for answer
+ data-lat="29.31166" + data-lon="47.481766">
- Palau flag + Kuwait flag
+ data-lat="-11.202692" + data-lon="17.873887">
- Georgia flag + Angola flag
+ data-lat="38.969719" + data-lon="59.556278">
+ data-lat="7.539989" + data-lon="-5.54708"> @@ -115,183 +115,183 @@

Romania

+ data-lat="40.069099" + data-lon="45.038189">
+ data-lat="15.783471" + data-lon="-90.230759">
+ data-lat="-14.235004" + data-lon="-51.92528">
+ data-lat="42.546245" + data-lon="1.601554">
+ data-lat="-25.274398" + data-lon="133.775136">
- Malawi flag + Australia flag
+ data-lat="9.945587" + data-lon="-9.696645">
- Macau flag + Guinea flag
+ data-lat="9.30769" + data-lon="2.315834">
- India flag + Benin flag
-

India

+

Benin

Map of India
+ data-lat="23.69781" + data-lon="120.960515">
- Lithuania flag + Taiwan flag
@@ -299,22 +299,22 @@

Lithuania

+ data-lat="4.210484" + data-lon="101.975766"> @@ -322,45 +322,45 @@

Kazakhstan

+ data-lat="53.709807" + data-lon="27.953389">
+ data-lat="41.20438" + data-lon="74.766098"> @@ -368,114 +368,114 @@

Grenada

+ data-lat="30.375321" + data-lon="69.345116">
+ data-lat="21.694025" + data-lon="-71.797928">
+ data-lat="48.379433" + data-lon="31.16558">
- Anguilla flag + Ukraine flag
+ data-lat="13.794185" + data-lon="-88.89653">
+ data-lat="-14.270972" + data-lon="-170.132217"> @@ -483,160 +483,160 @@

Nicaragua

+ data-lat="-22.95764" + data-lon="18.49041">
- Egypt flag + Namibia flag
+ data-lat="13.909444" + data-lon="-60.978893">
+ data-lat="30.585164" + data-lon="36.238414">
- Niger flag + Jordan flag
+ data-lat="39.074208" + data-lon="21.824312">
+ data-lat="35.907757" + data-lon="127.766922">
+ data-lat="7.51498" + data-lon="134.58252">
- Qatar flag + Palau flag
-

Qatar

+

Palau

Map of Qatar
+ data-lat="26.3351" + data-lon="17.228331">
- Denmark flag + Libya flag
@@ -644,68 +644,68 @@

Denmark

+ data-lat="24.215527" + data-lon="-12.885834">
+ data-lat="-22.328474" + data-lon="24.684866">
+ data-lat="-13.759029" + data-lon="-172.104629">
- Comoros flag + Samoa flag
@@ -713,91 +713,91 @@

Comoros

+ data-lat="12.862807" + data-lon="30.217636">
- Seychelles flag + Sudan flag
+ data-lat="-29.609988" + data-lon="28.233608">
+ data-lat="-29.040835" + data-lon="167.954712">
+ data-lat="61.892635" + data-lon="-6.911806"> @@ -809,18 +809,18 @@

Maldives

data-language="" data-culture="" data-bonus="" - data-lat="-35.675147" - data-lon="-71.542969"> + data-lat="12.52111" + data-lon="-69.968338">
- Chile flag + Aruba flag
-

Chile

+

Aruba

Map of Chile
@@ -832,225 +832,202 @@

Chile

data-language="" data-culture="" data-bonus="" - data-lat="17.189877" - data-lon="-88.49765"> -
-
- Belize flag -
-
-

Belize

- Map of Belize -
-
-
- -
+ data-lat="18.220554" + data-lon="-63.068615">
+ data-lat="-24.143474" + data-lon="-10.030696">
+ data-lat="-16.578193" + data-lon="179.414413">
- Mongolia flag + Fiji flag
+ data-lat="13.193887" + data-lon="-59.543198">
- Gabon flag + Barbados flag
+ data-lat="25.930414" + data-lon="50.637772">
- Ukraine flag + Bahrain flag
+ data-lat="25.03428" + data-lon="-77.39628">
- Sudan flag + Bahamas flag
+ data-lat="15.552727" + data-lon="48.516388">
- Ecuador flag + Yemen flag
+ data-lat="49.817492" + data-lon="15.472962">
- Uganda flag + Czechia flag
+ data-lat="38.963745" + data-lon="35.243322">
- Mexico flag + Turkey flag
@@ -1058,45 +1035,45 @@

Mexico

+ data-lat="50.503887" + data-lon="4.469936">
- Finland flag + Belgium flag
+ data-lat="-21.115141" + data-lon="55.536384"> @@ -1108,133 +1085,110 @@

Timor-Leste

data-language="" data-culture="" data-bonus="" - data-lat="25.03428" - data-lon="-77.39628"> -
-
- Bahamas flag -
-
-

Bahamas

- Map of Bahamas -
-
-
- -
+ data-lat="3.933889" + data-lon="-53.125782">
+ data-lat="1.650801" + data-lon="10.267895">
+ data-lat="7.369722" + data-lon="12.354722">
+ data-lat="-49.280366" + data-lon="69.348557">
+ data-lat="-11.875001" + data-lon="43.872219">
- Kosovo flag + Comoros flag
@@ -1246,64 +1200,64 @@

Kosovo

data-language="" data-culture="" data-bonus="" - data-lat="51.165691" - data-lon="10.451526"> + data-lat="47.516231" + data-lon="14.550072">
- Germany flag + Austria flag
+ data-lat="31.046051" + data-lon="34.851612">
- -
+ data-lat="14.497401" + data-lon="-14.452362">
- Vietnam flag + Senegal flag
+ data-lat="3.919305" + data-lon="-56.027783">
+ data-lat="31.952162" + data-lon="35.233154">
+ data-lat="21.521757" + data-lon="-77.781167">
- Vanuatu flag + Cuba flag
+ data-lat="-0.789275" + data-lon="113.921327">
- Andorra flag + Indonesia flag
+ data-lat="55.169438" + data-lon="23.881275">
- Tokelau flag + Lithuania flag
+ data-lat="18.735693" + data-lon="-70.162651">
+ data-lat="-10.447525" + data-lon="105.690449">
+ data-lat="56.879635" + data-lon="24.603189">
+ data-lat="3.202778" + data-lon="73.22068">
- Sweden flag + Maldives flag
+ data-lat="-1.940278" + data-lon="29.873888">
- Portugal flag + Rwanda flag
+ data-lat="71.706936" + data-lon="-42.604303">
- Russia flag + Greenland flag
@@ -1660,18 +1591,18 @@

Russia

data-language="" data-culture="" data-bonus="" - data-lat="-21.115141" - data-lon="55.536384"> + data-lat="11.825138" + data-lon="42.590275">
- Réunion flag + Djibouti flag
@@ -1679,45 +1610,45 @@

Réunion

+ data-lat="9.748917" + data-lon="-83.753428">
+ data-lat="27.514162" + data-lon="90.433601">
- Tanzania flag + Bhutan flag
@@ -1729,87 +1660,87 @@

Tanzania

data-language="" data-culture="" data-bonus="" - data-lat="-4.038333" - data-lon="21.758664"> + data-lat="21.00789" + data-lon="-10.940835">
+ data-lat="-23.442503" + data-lon="-58.443832">
- Djibouti flag + Paraguay flag
+ data-lat="23.885942" + data-lon="45.079162">
-
+ data-lat="-8.967363" + data-lon="-171.855881">
- Monaco flag + Tokelau flag
@@ -1821,87 +1752,87 @@

Monaco

data-language="" data-culture="" data-bonus="" - data-lat="42.708678" - data-lon="19.37439"> + data-lat="36.137741" + data-lon="-5.345374">
+ data-lat="15.870032" + data-lon="100.992541">
+ data-lat="46.227638" + data-lon="2.213749">
- Fiji flag + France flag
-

Fiji

+

France

Map of Fiji
+ data-lat="16.002082" + data-lon="-24.013197"> @@ -1909,229 +1840,229 @@

Cayman Islands
+ data-lat="38.861034" + data-lon="71.276093">
- Israel flag + Tajikistan flag
+ data-lat="19.513469" + data-lon="-80.566956">
+ data-lat="-19.054445" + data-lon="-169.867233">
- Turkmenistan flag + Niue flag
+ data-lat="23.634501" + data-lon="-102.552784">
- Taiwan flag + Mexico flag
+ data-lat="17.33083" + data-lon="145.38469">
+ data-lat="48.019573" + data-lon="66.923684">
+ data-lat="-20.904305" + data-lon="165.618042">
+ data-lat="1.373333" + data-lon="32.290275">
- Aruba flag + Uganda flag
+ data-lat="39.399872" + data-lon="-8.224454">
+ data-lat="52.132633" + data-lon="5.291266"> @@ -2143,18 +2074,18 @@

Micronesia

data-language="" data-culture="" data-bonus="" - data-lat="-24.143474" - data-lon="-10.030696"> + data-lat="15.454166" + data-lon="18.732207"> @@ -2166,41 +2097,41 @@

+ data-lat="8.537981" + data-lon="-80.782127">

+ data-lat="43.94236" + data-lon="12.457777"> @@ -2212,64 +2143,64 @@

Singapore

data-language="" data-culture="" data-bonus="" - data-lat="5.152149" - data-lon="46.199616"> + data-lat="6.428055" + data-lon="-9.429499">
- Somalia flag + Liberia flag
+ data-lat="35.86166" + data-lon="104.195397">
+ data-lat="41.153332" + data-lon="20.168331">
- Cameroon flag + Albania flag
@@ -2299,92 +2230,115 @@

Tunisia

+ data-lat="4.570868" + data-lon="-74.297333">
- Namibia flag + Colombia flag
+ data-lat="-12.164165" + data-lon="96.870956">
+ data-lat="41.87194" + data-lon="12.56738">
- Brazil flag + Italy flag
+ data-lat="-6.369028" + data-lon="34.888822">
- Suriname flag + Tanzania flag
+
+
+ +
+
+
+ Papua New Guinea flag +
+
@@ -2414,23 +2368,46 @@

Nigeria

+ data-lat="47.166" + data-lon="9.555373"> +
+ +
+
+
+ Slovakia flag +
+
+

Slovakia

+ Map of Slovakia
@@ -2438,22 +2415,22 @@

Mozambique

+ data-lat="-13.768752" + data-lon="-177.156097"> @@ -2465,294 +2442,294 @@

Guam

data-language="" data-culture="" data-bonus="" - data-lat="15.454166" - data-lon="18.732207"> + data-lat="-4.679574" + data-lon="55.491977">
- Chad flag + Seychelles flag
+ data-lat="17.060816" + data-lon="-61.796428">
+ data-lat="26.820553" + data-lon="30.802498">
+ data-lat="-53.08181" + data-lon="73.504158">
+ data-lat="28.033886" + data-lon="1.659626">
+ data-lat="-21.178986" + data-lon="-175.198242">
- Greenland flag + Tonga flag
+ data-lat="-3.373056" + data-lon="29.918886">
+ data-lat="-4.038333" + data-lon="21.758664">
- Bhutan flag + DR Congo flag
+ data-lat="49.465691" + data-lon="-2.585278">
- Guinea flag + Guernsey flag
+ data-lat="-75.250973" + data-lon="-0.071389">
- Oman flag + Antarctica flag
+ data-lat="8.619543" + data-lon="0.824782">
- Slovakia flag + Togo flag
+ data-lat="-38.416097" + data-lon="-63.616672">
+ data-lat="46.151241" + data-lon="14.995463"> @@ -2760,91 +2737,91 @@

Bouvet Island + data-lat="47.162494" + data-lon="19.503304">

+ data-lat="28.394857" + data-lon="84.124008">
+ data-lat="13.444304" + data-lon="144.793731">
- Canada flag + Guam flag
-

Canada

+

Guam

Map of Canada
+ data-lat="58.595272" + data-lon="25.013607"> @@ -2856,41 +2833,41 @@

Cape Verde

data-language="" data-culture="" data-bonus="" - data-lat="13.443182" - data-lon="-15.310139"> + data-lat="-0.228021" + data-lon="15.827659">
+ data-lat="53.41291" + data-lon="-8.24389">
- Honduras flag + Ireland flag
@@ -2898,22 +2875,22 @@

Honduras

+ data-lat="41.608635" + data-lon="21.745275"> @@ -2924,88 +2901,88 @@

Luxembourg

data-subregion="Latin America and the Caribbean" data-language="" data-culture="" - data-bonus="" - data-lat="18.971187" - data-lon="-72.285215"> + data-bonus="" + data-lat="-9.189967" + data-lon="-75.015152">
- Haiti flag + Peru flag
-

Haiti

+

Peru

Map of Haiti
+ data-lat="-0.522778" + data-lon="166.931503">
- Estonia flag + Nauru flag
+ data-lat="35.937496" + data-lon="14.375416">
+ data-lat="45.1" + data-lon="15.2"> @@ -3017,110 +2994,110 @@

Saint Lucia

data-language="" data-culture="" data-bonus="" - data-lat="-9.189967" - data-lon="-75.015152"> + data-lat="-35.675147" + data-lon="-71.542969">
- Peru flag + Chile flag
-

Peru

+

Chile

Map of Peru
+ data-lat="77.553604" + data-lon="23.670272">
+ data-lat="40.143105" + data-lon="47.576927">
- Malta flag + Azerbaijan flag
+ data-lat="42.602636" + data-lon="20.902977">
+ data-lat="41.377491" + data-lon="64.585262"> @@ -3132,133 +3109,133 @@

Botswana

data-language="" data-culture="" data-bonus="" - data-lat="15.552727" - data-lon="48.516388"> + data-lat="21.512583" + data-lon="55.923255">
- Yemen flag + Oman flag
-

Yemen

+

Oman

Map of Yemen
+ data-lat="-0.023559" + data-lon="37.906193">
- Uruguay flag + Kenya flag
+ data-lat="15.179384" + data-lon="39.782334">
+ data-lat="17.570692" + data-lon="-3.996166">
- Puerto Rico flag + Mali flag
+ data-lat="42.315407" + data-lon="43.356892">
+ data-lat="23.424076" + data-lon="53.847818"> @@ -3266,45 +3243,45 @@

Barbados

+ data-lat="40.463667" + data-lon="-3.74922">
+ data-lat="-13.133897" + data-lon="27.849332"> @@ -3316,18 +3293,18 @@

United Arab data-language="" data-culture="" data-bonus="" - data-lat="-12.8275" - data-lon="45.166244"> + data-lat="-30.559482" + data-lon="22.937506"> @@ -3335,45 +3312,45 @@

Mayotte

+ data-lat="54.236107" + data-lon="-4.548056">
+ data-lat="20.593684" + data-lon="78.96288">
- Libya flag + India flag
-

Libya

+

India

Map of Libya
@@ -3381,114 +3358,114 @@

Libya

+ data-lat="61.52401" + data-lon="105.318756">
- Spain flag + Russia flag
+ data-lat="17.189877" + data-lon="-88.49765">
+ data-lat="-0.803689" + data-lon="11.609444">
- Syria flag + Gabon flag
-

Syria

+

Gabon

Map of Syria
+ data-lat="23.684994" + data-lon="90.356331">
+ data-lat="-26.522503" + data-lon="31.465866"> @@ -3500,64 +3477,64 @@

Moldova

data-language="" data-culture="" data-bonus="" - data-lat="6.428055" - data-lon="-9.429499"> + data-lat="6.611111" + data-lon="20.939444">
+ data-lat="43.750298" + data-lon="7.412841">
- Nepal flag + Monaco flag
+ data-lat="-15.376706" + data-lon="166.959158">
- Cambodia flag + Vanuatu flag
+ data-lat="25.354826" + data-lon="51.183884">
+ data-lat="-9.64571" + data-lon="160.156194">
+ data-lat="12.984305" + data-lon="-61.287228">
+ data-lat="42.708678" + data-lon="19.37439">
- China flag + Montenegro flag
+ data-lat="49.214439" + data-lon="-2.13125">
- Jordan flag + Jersey flag
+ data-lat="-18.766947" + data-lon="46.869107">
+ data-lat="5.152149" + data-lon="46.199616">
- Tuvalu flag + Somalia flag
+ data-lat="28.202122" + data-lon="-177.380452">
+ data-lat="12.262776" + data-lon="-61.604171">
- Austria flag + Grenada flag
+ data-lat="49.815273" + data-lon="6.129583">
+ data-lat="51.165691" + data-lon="10.451526">
- Niue flag + Germany flag
@@ -3864,114 +3841,114 @@

Niue

+ data-lat="-8.874217" + data-lon="125.727539">
- Iran flag + Timor-Leste flag
+ data-lat="19.85627" + data-lon="102.495496">
- Paraguay flag + Laos flag
+ data-lat="14.058324" + data-lon="108.277199">
+ data-lat="14.641528" + data-lon="-61.024174">
+ data-lat="0.18636" + data-lon="6.613081"> @@ -4001,23 +3978,23 @@

Ethiopia

+ data-lat="-7.109535" + data-lon="177.64933">
- Benin flag + Tuvalu flag
@@ -4025,91 +4002,91 @@

Benin

+ data-lat="35.126413" + data-lon="33.429859">
- Pakistan flag + Cyprus flag
+ data-lat="-1.831239" + data-lon="-78.183406">
+ data-lat="-51.796253" + data-lon="-59.523613">
+ data-lat="13.443182" + data-lon="-15.310139">
- Argentina flag + Gambia flag
@@ -4121,156 +4098,156 @@

Argentina

data-language="" data-culture="" data-bonus="" - data-lat="17.060816" - data-lon="-61.796428"> + data-lat="17.357822" + data-lon="-62.782998">
+ data-lat="-12.8275" + data-lon="45.166244">
- Bolivia flag + Mayotte flag
+ data-lat="-19.015438" + data-lon="29.154857">
- Nauru flag + Zimbabwe flag
+ data-lat="22.198745" + data-lon="113.543873">
- Jersey flag + Macau flag
+ data-lat="-16.290154" + data-lon="-63.588653">
- Greece flag + Bolivia flag
+ data-lat="7.873054" + data-lon="80.771797">
- Croatia flag + Sri Lanka flag
+ data-lat="12.565679" + data-lon="104.990963">
- Italy flag + Cambodia flag
@@ -4282,64 +4259,64 @@

Italy

data-language="" data-culture="" data-bonus="" - data-lat="-18.766947" - data-lon="46.869107"> + data-lat="11.803749" + data-lon="-15.180413">
+ data-lat="33.93911" + data-lon="67.709953">
+ data-lat="4.860416" + data-lon="-58.93018">
- Gibraltar flag + Guyana flag
@@ -4351,18 +4328,18 @@

Gibraltar

data-language="" data-culture="" data-bonus="" - data-lat="7.946527" - data-lon="-1.023194"> + data-lat="17.607789" + data-lon="8.081666">
- Ghana flag + Niger flag
-

Ghana

+

Niger

Map of Ghana
@@ -4370,45 +4347,45 @@

Ghana

+ data-lat="60.472024" + data-lon="8.468946">
- Slovenia flag + Norway flag
+ data-lat="6.42375" + data-lon="-66.58973">
- Belgium flag + Venezuela flag
@@ -4420,18 +4397,18 @@

Belgium

data-language="" data-culture="" data-bonus="" - data-lat="4.570868" - data-lon="-74.297333"> + data-lat="18.420695" + data-lon="-64.639968"> @@ -4443,271 +4420,294 @@

Colombia

data-language="" data-culture="" data-bonus="" - data-lat="-17.679742" - data-lon="-149.406843"> + data-lat="-21.236736" + data-lon="-159.777671">
+
+
+ Jamaica flag +
+
+

Jamaica

+ Map of Jamaica +
+
+
+ +
+ data-lat="18.971187" + data-lon="-72.285215">
+ data-lat="64.963051" + data-lon="-19.020835">
+ data-lat="46.862496" + data-lon="103.846656">
- Togo flag + Mongolia flag
+ data-lat="10.691803" + data-lon="-61.222503">
+ data-lat="-17.679742" + data-lon="-149.406843">
+ data-lat="56.26392" + data-lon="9.501785">
- Jamaica flag + Denmark flag
+ data-lat="-18.665695" + data-lon="35.529562">
- Poland flag + Mozambique flag
+ data-lat="46.941936" + data-lon="-56.27111">
+ data-lat="-13.254308" + data-lon="34.301525">
- Australia flag + Malawi flag
+ data-lat="39.817075" + data-lon="-98.362361">
+ data-lat="12.879721" + data-lon="121.774017"> @@ -4719,41 +4719,41 @@

Latvia

data-language="" data-culture="" data-bonus="" - data-lat="53.41291" - data-lon="-8.24389"> + data-lat="60.128161" + data-lon="18.643501">
- Ireland flag + Sweden flag
+ data-lat="-6.343194" + data-lon="71.876519"> @@ -4765,18 +4765,18 @@

Thailand

data-language="" data-culture="" data-bonus="" - data-lat="28.202122" - data-lon="-177.380452"> + data-lat="-3.370417" + data-lon="-168.734039"> @@ -4788,179 +4788,179 @@

+ data-lat="16.742498" + data-lon="-62.187366">

+ data-lat="12.238333" + data-lon="-1.561593">
+ data-lat="7.425554" + data-lon="150.550812">
+ data-lat="33.854721" + data-lon="35.862285">
- Dominica flag + Lebanon flag
+ data-lat="15.414999" + data-lon="-61.370976">
- Senegal flag + Dominica flag
+ data-lat="61.92411" + data-lon="25.748151">
- Brunei flag + Finland flag
+ data-lat="55.378051" + data-lon="-3.435973">
+ data-lat="4.535277" + data-lon="114.727669">
- Guyana flag + Brunei flag
@@ -4968,68 +4968,68 @@

Guyana

+ data-lat="44.016521" + data-lon="21.005859">
+ data-lat="31.791702" + data-lon="-7.09262">
+ data-lat="-40.900557" + data-lon="174.885971"> @@ -5037,298 +5037,298 @@

South Korea

+ data-lat="7.946527" + data-lon="-1.023194">
- Morocco flag + Ghana flag
+ data-lat="42.733883" + data-lon="25.48583">
- Cyprus flag + Bulgaria flag
+ data-lat="36.204824" + data-lon="138.252924">
+ data-lat="32.321384" + data-lon="-64.75737">
- Mauritius flag + Bermuda flag
+ data-lat="-24.703615" + data-lon="-127.439308">
+ data-lat="21.913965" + data-lon="95.956223">
- Tonga flag + Myanmar flag
+ data-lat="34.802075" + data-lon="38.996815">
+ data-lat="-54.423199" + data-lon="3.413194">
+ data-lat="8.460555" + data-lon="-11.779889">
+ data-lat="-20.348404" + data-lon="57.552152">
- Cuba flag + Mauritius flag
+ data-lat="16.995971" + data-lon="-62.067641">
+ data-lat="15.199999" + data-lon="-86.241905">
- Serbia flag + Honduras flag
+ data-lat="18.220833" + data-lon="-66.590149"> @@ -5336,22 +5336,22 @@

Faroe Islands + data-lat="33.223191" + data-lon="43.679291">
- Laos flag + Iraq flag
-

Laos

+

Iraq

Map of Laos
@@ -5359,22 +5359,22 @@

Laos

+ data-lat="40.339852" + data-lon="127.510093"> @@ -5386,64 +5386,64 @@

Kuwait

data-language="" data-culture="" data-bonus="" - data-lat="53.709807" - data-lon="27.953389"> + data-lat="45.943161" + data-lon="24.96676">
- Belarus flag + Romania flag
+ data-lat="18.335765" + data-lon="-64.896335">
+ data-lat="7.131474" + data-lon="171.184478"> @@ -5451,22 +5451,22 @@

Indonesia

+ data-lat="51.919438" + data-lon="19.145136">
- Iceland flag + Poland flag
@@ -5478,133 +5478,133 @@

Iceland

data-language="" data-culture="" data-bonus="" - data-lat="43.915886" - data-lon="17.679076"> + data-lat="41.902916" + data-lon="12.453389">
+ data-lat="32.427908" + data-lon="53.688046">
- Burundi flag + Iran flag
+ data-lat="-32.522779" + data-lon="-55.765835">
+ data-lat="56.130366" + data-lon="-106.346771">
+ data-lat="46.818188" + data-lon="8.227512">
+ data-lat="-54.429579" + data-lon="-36.587909"> diff --git a/docs/index.html b/docs/index.html index f2ed997..07ef825 100644 --- a/docs/index.html +++ b/docs/index.html @@ -53,6 +53,9 @@ "image": "https://levelupgeo.com/static/og-image.jpg" } + + + diff --git a/docs/static/script.js b/docs/static/script.js index be629c3..ca4a3da 100644 --- a/docs/static/script.js +++ b/docs/static/script.js @@ -13,185 +13,158 @@ document.addEventListener("DOMContentLoaded", function () { mapboxgl.accessToken = 'pk.eyJ1Ijoic3RpbGVzIiwiYSI6ImNsd3Rpc3V2aTAzeXUydm9sMHdoN210b2oifQ.66AJmPYxe2ixku1o7Rwdlg'; const mapContainer = document.getElementById("country-map"); - if (!mapContainer) { - console.error("Country map container not found."); - return; - } - - const mapLat = parseFloat(mapContainer.getAttribute("data-lat")); - const mapLon = parseFloat(mapContainer.getAttribute("data-lon")); - const countryName = mapContainer.getAttribute("data-name"); - - // Dynamically determine the base path - const basePath = window.location.pathname.includes('/guessr-meta-generator/') - ? '/guessr-meta-generator' - : ''; - - // Construct the GeoJSON URL - const geojsonUrl = `${basePath}/static/data/geo/${countryName}.geojson`; - - console.log("GeoJSON URL:", geojsonUrl); - - // Initialize the main map - const map = new mapboxgl.Map({ - container: 'country-map', - style: 'mapbox://styles/stiles/cm5cvawys00ti01su1mxw905f', - center: [mapLon, mapLat], - zoom: 4, - minZoom: 3, - maxZoom: 10, - worldCopyJump: true // Ensures wrapping for maps crossing the Date Line - }); - - map.on('load', function () { - // Load country boundary GeoJSON - map.addSource('country-boundary', { - type: 'geojson', - data: geojsonUrl, - }); + const filterInput = document.getElementById("filter-input"); - map.addLayer({ - id: 'country-boundary-layer', - type: 'line', - source: 'country-boundary', - paint: { - 'line-color': '#c8553d', - 'line-width': 2, - }, - }); + // Initialize the map only if the map container exists + if (mapContainer) { + const mapLat = parseFloat(mapContainer.getAttribute("data-lat")); + const mapLon = parseFloat(mapContainer.getAttribute("data-lon")); + const countryName = mapContainer.getAttribute("data-name"); - // Fetch the GeoJSON to dynamically set bounds - fetch(geojsonUrl) - .then(response => { - if (!response.ok) { - throw new Error(`Failed to fetch GeoJSON: ${response.statusText}`); - } - return response.json(); - }) - .then(geojsonData => { - const bounds = new mapboxgl.LngLatBounds(); - - geojsonData.features.forEach(feature => { - const coordinates = feature.geometry.coordinates; - - if (feature.geometry.type === 'Polygon') { - coordinates[0].forEach(coord => adjustLngLat(coord, bounds)); - } else if (feature.geometry.type === 'MultiPolygon') { - coordinates.forEach(polygon => { - polygon[0].forEach(coord => adjustLngLat(coord, bounds)); - }); - } - }); + // Dynamically determine the base path + const basePath = window.location.pathname.includes('/guessr-meta-generator/') + ? '/guessr-meta-generator' + : ''; - // Apply bounds to the map with maxZoom - map.fitBounds(bounds, { - padding: 20, - maxZoom: 10 - }); - }) - .catch(error => { - console.error("Error loading GeoJSON:", error); - }); + // Construct the GeoJSON URL + const geojsonUrl = `${basePath}/static/data/geo/${countryName}.geojson`; - // Initialize the inset map - const insetContainer = document.createElement('div'); - insetContainer.id = 'inset-map'; - mapContainer.appendChild(insetContainer); + console.log("GeoJSON URL:", geojsonUrl); - const insetMap = new mapboxgl.Map({ - container: 'inset-map', - style: 'mapbox://styles/mapbox/light-v10', + // Initialize the main map + const map = new mapboxgl.Map({ + container: 'country-map', + style: 'mapbox://styles/stiles/cm5cvawys00ti01su1mxw905f', center: [mapLon, mapLat], - zoom: 1, - interactive: false, + zoom: 4, + minZoom: 3, + maxZoom: 10, + worldCopyJump: true // Ensures wrapping for maps crossing the Date Line }); - insetMap.on('load', () => { - insetMap.addSource('main-map-bounds', { + map.on('load', function () { + // Load country boundary GeoJSON + map.addSource('country-boundary', { type: 'geojson', - data: { - type: 'FeatureCollection', - features: [], - }, + data: geojsonUrl, }); - insetMap.addLayer({ - id: 'bounding-box', + map.addLayer({ + id: 'country-boundary-layer', type: 'line', - source: 'main-map-bounds', + source: 'country-boundary', paint: { - 'line-color': '#FF0000', + 'line-color': '#c8553d', 'line-width': 2, }, }); - // Update the bounding box on the inset map whenever the main map moves - function updateInsetMap() { - const bounds = map.getBounds(); - const bbox = { - type: 'Feature', - geometry: { - type: 'Polygon', - coordinates: [[ - [bounds.getSouthWest().lng, bounds.getSouthWest().lat], - [bounds.getNorthWest().lng, bounds.getNorthWest().lat], - [bounds.getNorthEast().lng, bounds.getNorthEast().lat], - [bounds.getSouthEast().lng, bounds.getSouthEast().lat], - [bounds.getSouthWest().lng, bounds.getSouthWest().lat], // Close the polygon - ]], - }, - }; - - // Update the source on the inset map - insetMap.getSource('main-map-bounds').setData({ - type: 'FeatureCollection', - features: [bbox], + // Fetch the GeoJSON to dynamically set bounds + fetch(geojsonUrl) + .then(response => { + if (!response.ok) { + throw new Error(`Failed to fetch GeoJSON: ${response.statusText}`); + } + return response.json(); + }) + .then(geojsonData => { + const bounds = new mapboxgl.LngLatBounds(); + + geojsonData.features.forEach(feature => { + const coordinates = feature.geometry.coordinates; + + if (feature.geometry.type === 'Polygon') { + coordinates[0].forEach(coord => adjustLngLat(coord, bounds)); + } else if (feature.geometry.type === 'MultiPolygon') { + coordinates.forEach(polygon => { + polygon[0].forEach(coord => adjustLngLat(coord, bounds)); + }); + } + }); + + // Apply bounds to the map with maxZoom + map.fitBounds(bounds, { + padding: 20, + maxZoom: 10 + }); + }) + .catch(error => { + console.error("Error loading GeoJSON:", error); }); - - // Synchronize the inset map center - insetMap.setCenter(map.getCenter()); - } - - // Call updateInsetMap initially and whenever the main map moves - map.on('move', updateInsetMap); - updateInsetMap(); }); // Dynamically adjust inset map for mobile function adjustInsetMapLayout() { - if (window.innerWidth <= 768) { - insetContainer.style.position = "relative"; - insetContainer.style.width = "100%"; - insetContainer.style.height = "150px"; - insetContainer.style.border = "none"; - insetContainer.style.marginTop = "10px"; // Add space below the main map - } else { - insetContainer.style.position = "absolute"; - insetContainer.style.width = "150px"; - insetContainer.style.height = "150px"; - insetContainer.style.border = "1px solid #999"; - insetContainer.style.borderRadius = "8px"; - insetContainer.style.overflow = "hidden"; - insetContainer.style.marginTop = "0"; - } - } + const insetContainer = document.createElement('div'); + insetContainer.id = 'inset-map'; + mapContainer.appendChild(insetContainer); + + const insetMap = new mapboxgl.Map({ + container: 'inset-map', + style: 'mapbox://styles/mapbox/light-v10', + center: [mapLon, mapLat], + zoom: 1, + interactive: false, + }); - // Adjust on page load and window resize - adjustInsetMapLayout(); - window.addEventListener("resize", adjustInsetMapLayout); - }); + insetMap.on('load', () => { + insetMap.addSource('main-map-bounds', { + type: 'geojson', + data: { + type: 'FeatureCollection', + features: [], + }, + }); + + insetMap.addLayer({ + id: 'bounding-box', + type: 'line', + source: 'main-map-bounds', + paint: { + 'line-color': '#FF0000', + 'line-width': 2, + }, + }); - // Enforce max zoom level dynamically - map.on('zoom', () => { - if (map.getZoom() > 10) { - map.setZoom(10); + // Update the bounding box on the inset map whenever the main map moves + function updateInsetMap() { + const bounds = map.getBounds(); + const bbox = { + type: 'Feature', + geometry: { + type: 'Polygon', + coordinates: [[ + [bounds.getSouthWest().lng, bounds.getSouthWest().lat], + [bounds.getNorthWest().lng, bounds.getNorthWest().lat], + [bounds.getNorthEast().lng, bounds.getNorthEast().lat], + [bounds.getSouthEast().lng, bounds.getSouthEast().lat], + [bounds.getSouthWest().lng, bounds.getSouthWest().lat], // Close the polygon + ]], + }, + }; + + // Update the source on the inset map + insetMap.getSource('main-map-bounds').setData({ + type: 'FeatureCollection', + features: [bbox], + }); + + // Synchronize the inset map center + insetMap.setCenter(map.getCenter()); + } + + // Call updateInsetMap initially and whenever the main map moves + map.on('move', updateInsetMap); + updateInsetMap(); + }); } - }); - // Filter countries by name (with null-check for country pages) - const filterInput = document.getElementById("filter-input"); + adjustInsetMapLayout(); + } + + // Filter countries by name (only if the filter input exists) if (filterInput) { - filterInput.addEventListener("input", () => { + filterInput.addEventListener("input", function () { const filterValue = filterInput.value.toLowerCase(); const gridItems = document.querySelectorAll(".grid-item"); const regionSections = document.querySelectorAll(".region-section"); @@ -230,4 +203,4 @@ document.addEventListener("DOMContentLoaded", function () { }); }); } -}); \ No newline at end of file +}); diff --git a/static/script.js b/static/script.js index be629c3..ca4a3da 100644 --- a/static/script.js +++ b/static/script.js @@ -13,185 +13,158 @@ document.addEventListener("DOMContentLoaded", function () { mapboxgl.accessToken = 'pk.eyJ1Ijoic3RpbGVzIiwiYSI6ImNsd3Rpc3V2aTAzeXUydm9sMHdoN210b2oifQ.66AJmPYxe2ixku1o7Rwdlg'; const mapContainer = document.getElementById("country-map"); - if (!mapContainer) { - console.error("Country map container not found."); - return; - } - - const mapLat = parseFloat(mapContainer.getAttribute("data-lat")); - const mapLon = parseFloat(mapContainer.getAttribute("data-lon")); - const countryName = mapContainer.getAttribute("data-name"); - - // Dynamically determine the base path - const basePath = window.location.pathname.includes('/guessr-meta-generator/') - ? '/guessr-meta-generator' - : ''; - - // Construct the GeoJSON URL - const geojsonUrl = `${basePath}/static/data/geo/${countryName}.geojson`; - - console.log("GeoJSON URL:", geojsonUrl); - - // Initialize the main map - const map = new mapboxgl.Map({ - container: 'country-map', - style: 'mapbox://styles/stiles/cm5cvawys00ti01su1mxw905f', - center: [mapLon, mapLat], - zoom: 4, - minZoom: 3, - maxZoom: 10, - worldCopyJump: true // Ensures wrapping for maps crossing the Date Line - }); - - map.on('load', function () { - // Load country boundary GeoJSON - map.addSource('country-boundary', { - type: 'geojson', - data: geojsonUrl, - }); + const filterInput = document.getElementById("filter-input"); - map.addLayer({ - id: 'country-boundary-layer', - type: 'line', - source: 'country-boundary', - paint: { - 'line-color': '#c8553d', - 'line-width': 2, - }, - }); + // Initialize the map only if the map container exists + if (mapContainer) { + const mapLat = parseFloat(mapContainer.getAttribute("data-lat")); + const mapLon = parseFloat(mapContainer.getAttribute("data-lon")); + const countryName = mapContainer.getAttribute("data-name"); - // Fetch the GeoJSON to dynamically set bounds - fetch(geojsonUrl) - .then(response => { - if (!response.ok) { - throw new Error(`Failed to fetch GeoJSON: ${response.statusText}`); - } - return response.json(); - }) - .then(geojsonData => { - const bounds = new mapboxgl.LngLatBounds(); - - geojsonData.features.forEach(feature => { - const coordinates = feature.geometry.coordinates; - - if (feature.geometry.type === 'Polygon') { - coordinates[0].forEach(coord => adjustLngLat(coord, bounds)); - } else if (feature.geometry.type === 'MultiPolygon') { - coordinates.forEach(polygon => { - polygon[0].forEach(coord => adjustLngLat(coord, bounds)); - }); - } - }); + // Dynamically determine the base path + const basePath = window.location.pathname.includes('/guessr-meta-generator/') + ? '/guessr-meta-generator' + : ''; - // Apply bounds to the map with maxZoom - map.fitBounds(bounds, { - padding: 20, - maxZoom: 10 - }); - }) - .catch(error => { - console.error("Error loading GeoJSON:", error); - }); + // Construct the GeoJSON URL + const geojsonUrl = `${basePath}/static/data/geo/${countryName}.geojson`; - // Initialize the inset map - const insetContainer = document.createElement('div'); - insetContainer.id = 'inset-map'; - mapContainer.appendChild(insetContainer); + console.log("GeoJSON URL:", geojsonUrl); - const insetMap = new mapboxgl.Map({ - container: 'inset-map', - style: 'mapbox://styles/mapbox/light-v10', + // Initialize the main map + const map = new mapboxgl.Map({ + container: 'country-map', + style: 'mapbox://styles/stiles/cm5cvawys00ti01su1mxw905f', center: [mapLon, mapLat], - zoom: 1, - interactive: false, + zoom: 4, + minZoom: 3, + maxZoom: 10, + worldCopyJump: true // Ensures wrapping for maps crossing the Date Line }); - insetMap.on('load', () => { - insetMap.addSource('main-map-bounds', { + map.on('load', function () { + // Load country boundary GeoJSON + map.addSource('country-boundary', { type: 'geojson', - data: { - type: 'FeatureCollection', - features: [], - }, + data: geojsonUrl, }); - insetMap.addLayer({ - id: 'bounding-box', + map.addLayer({ + id: 'country-boundary-layer', type: 'line', - source: 'main-map-bounds', + source: 'country-boundary', paint: { - 'line-color': '#FF0000', + 'line-color': '#c8553d', 'line-width': 2, }, }); - // Update the bounding box on the inset map whenever the main map moves - function updateInsetMap() { - const bounds = map.getBounds(); - const bbox = { - type: 'Feature', - geometry: { - type: 'Polygon', - coordinates: [[ - [bounds.getSouthWest().lng, bounds.getSouthWest().lat], - [bounds.getNorthWest().lng, bounds.getNorthWest().lat], - [bounds.getNorthEast().lng, bounds.getNorthEast().lat], - [bounds.getSouthEast().lng, bounds.getSouthEast().lat], - [bounds.getSouthWest().lng, bounds.getSouthWest().lat], // Close the polygon - ]], - }, - }; - - // Update the source on the inset map - insetMap.getSource('main-map-bounds').setData({ - type: 'FeatureCollection', - features: [bbox], + // Fetch the GeoJSON to dynamically set bounds + fetch(geojsonUrl) + .then(response => { + if (!response.ok) { + throw new Error(`Failed to fetch GeoJSON: ${response.statusText}`); + } + return response.json(); + }) + .then(geojsonData => { + const bounds = new mapboxgl.LngLatBounds(); + + geojsonData.features.forEach(feature => { + const coordinates = feature.geometry.coordinates; + + if (feature.geometry.type === 'Polygon') { + coordinates[0].forEach(coord => adjustLngLat(coord, bounds)); + } else if (feature.geometry.type === 'MultiPolygon') { + coordinates.forEach(polygon => { + polygon[0].forEach(coord => adjustLngLat(coord, bounds)); + }); + } + }); + + // Apply bounds to the map with maxZoom + map.fitBounds(bounds, { + padding: 20, + maxZoom: 10 + }); + }) + .catch(error => { + console.error("Error loading GeoJSON:", error); }); - - // Synchronize the inset map center - insetMap.setCenter(map.getCenter()); - } - - // Call updateInsetMap initially and whenever the main map moves - map.on('move', updateInsetMap); - updateInsetMap(); }); // Dynamically adjust inset map for mobile function adjustInsetMapLayout() { - if (window.innerWidth <= 768) { - insetContainer.style.position = "relative"; - insetContainer.style.width = "100%"; - insetContainer.style.height = "150px"; - insetContainer.style.border = "none"; - insetContainer.style.marginTop = "10px"; // Add space below the main map - } else { - insetContainer.style.position = "absolute"; - insetContainer.style.width = "150px"; - insetContainer.style.height = "150px"; - insetContainer.style.border = "1px solid #999"; - insetContainer.style.borderRadius = "8px"; - insetContainer.style.overflow = "hidden"; - insetContainer.style.marginTop = "0"; - } - } + const insetContainer = document.createElement('div'); + insetContainer.id = 'inset-map'; + mapContainer.appendChild(insetContainer); + + const insetMap = new mapboxgl.Map({ + container: 'inset-map', + style: 'mapbox://styles/mapbox/light-v10', + center: [mapLon, mapLat], + zoom: 1, + interactive: false, + }); - // Adjust on page load and window resize - adjustInsetMapLayout(); - window.addEventListener("resize", adjustInsetMapLayout); - }); + insetMap.on('load', () => { + insetMap.addSource('main-map-bounds', { + type: 'geojson', + data: { + type: 'FeatureCollection', + features: [], + }, + }); + + insetMap.addLayer({ + id: 'bounding-box', + type: 'line', + source: 'main-map-bounds', + paint: { + 'line-color': '#FF0000', + 'line-width': 2, + }, + }); - // Enforce max zoom level dynamically - map.on('zoom', () => { - if (map.getZoom() > 10) { - map.setZoom(10); + // Update the bounding box on the inset map whenever the main map moves + function updateInsetMap() { + const bounds = map.getBounds(); + const bbox = { + type: 'Feature', + geometry: { + type: 'Polygon', + coordinates: [[ + [bounds.getSouthWest().lng, bounds.getSouthWest().lat], + [bounds.getNorthWest().lng, bounds.getNorthWest().lat], + [bounds.getNorthEast().lng, bounds.getNorthEast().lat], + [bounds.getSouthEast().lng, bounds.getSouthEast().lat], + [bounds.getSouthWest().lng, bounds.getSouthWest().lat], // Close the polygon + ]], + }, + }; + + // Update the source on the inset map + insetMap.getSource('main-map-bounds').setData({ + type: 'FeatureCollection', + features: [bbox], + }); + + // Synchronize the inset map center + insetMap.setCenter(map.getCenter()); + } + + // Call updateInsetMap initially and whenever the main map moves + map.on('move', updateInsetMap); + updateInsetMap(); + }); } - }); - // Filter countries by name (with null-check for country pages) - const filterInput = document.getElementById("filter-input"); + adjustInsetMapLayout(); + } + + // Filter countries by name (only if the filter input exists) if (filterInput) { - filterInput.addEventListener("input", () => { + filterInput.addEventListener("input", function () { const filterValue = filterInput.value.toLowerCase(); const gridItems = document.querySelectorAll(".grid-item"); const regionSections = document.querySelectorAll(".region-section"); @@ -230,4 +203,4 @@ document.addEventListener("DOMContentLoaded", function () { }); }); } -}); \ No newline at end of file +}); diff --git a/templates/index.html b/templates/index.html index 6fb7e9c..0d30682 100644 --- a/templates/index.html +++ b/templates/index.html @@ -53,6 +53,9 @@ "image": "https://levelupgeo.com/static/og-image.jpg" } + + +