Norric1Admin / maptemplates

Map templates
0 stars 1 forks source link

Embed maps not displaying on NRP (except 4.2.1) #1

Open Norric1Admin opened 5 years ago

Norric1Admin commented 5 years ago

Something is preventing the 'Map' tab from generating on embed tests for the sandpit and Ghana sites (metadata field 'embedded_map_html'). I've updated the layout file in the Ghana sdg-indicators repo, but this has not generated the 'Map' tab. The only exception is 4.2.1 on the sandpit, but this has an automatically-generating map which I've replaced with an embedded map (it displays, but is missing the graph feature - I'll make a separate issue).

Ghana layout update: https://github.com/sustainabledevelopment-ghana/sdg-indicators/pull/78 (+79) ONS layout update: https://github.com/ONSdigital/sdg-indicators/blob/develop/_layouts/indicator.html Note: the Norric1Admin indicator.html still exists, but in a new location - I'll post this when I know it.

Sandpit map test: https://norric1admin.github.io/sdg-indicators/4-2-1/ Ghana map test: https://github.com/sustainabledevelopment-ghana/sdg-indicators/blob/develop/_indicators/4-2-1.md

I'll add comments to this as I progress. I'll start by looking at the missing fields in Ghana 4.2.1, then see if we're missing any references to the 'Map' tab in the layout scripts.

brockfanning commented 5 years ago

@Norric1Admin I posted a pull-request here that should fix the problem on Ghana's platform. It partially brings in some of the map-related code that was added after the Ghana platform was forked. This is more of a short-term solution, with the longer-term solution being to eventually recommend Ghana switch to the shared platform.

Norric1Admin commented 5 years ago

Thanks Brock - this has indeed solved the problem. I can use your solution to apply embed maps to the UK platform too... The UK embeds only seem to appear if the Mango map has already generated first, but your code shows that there's a way around this. I'll keep the ticket open for now.

brockfanning commented 5 years ago

@Norric1Admin Ah, I was wondering about that. I'll try to add some code to the shared platform so that the embedded maps can be displayed without any of the Mango-map requirements.

Norric1Admin commented 5 years ago

Cheers! I have made a couple of map tests on the sandpit to see whether the data_show_map variable is the key to making the embed display. They’re still pending - will keep you updated. 3.4.1https://github.com/Norric1Admin/sdg-data/commit/190c9def87eab6f4fd0b9c36444dc76aa1e3ca0c – includes data_show_map variable previewhttps://norric1admin.github.io/sdg-indicators/3-4-1/ 3.4.2https://github.com/Norric1Admin/sdg-data/commit/b7796de2ce0cce54a5556cdaed86a95f7287f83a – no data_show_map variable previewhttps://norric1admin.github.io/sdg-indicators/3-4-2/ 4.2.1https://github.com/Norric1Admin/sdg-data/blob/develop/meta/4-2-1.md – working embedded map previewhttps://norric1admin.github.io/sdg-indicators/4-2-1/

If you are willing to provide more help with the maps, perhaps you could advise on the missing graph feature on the embeds? This is a high priority for me, as it’s the final step before having a more-or-less fully functional embedded map. https://github.com/Norric1Admin/maptemplates/issues/2

Many thanks, Chris

From: brockfanning [mailto:notifications@github.com] Sent: 16 October 2018 13:20 To: Norric1Admin/maptemplates maptemplates@noreply.github.com Cc: Norris, Christopher Christopher.Norris@ons.gov.uk; Mention mention@noreply.github.com Subject: Re: [Norric1Admin/maptemplates] Embed maps not displaying on NRP (except 4.2.1) (#1)

@Norric1Adminhttps://github.com/Norric1Admin Ah, I was wondering about that. I'll try to add some code to the shared platform so that the embedded maps can be displayed without any of the Mango-map requirements.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/Norric1Admin/maptemplates/issues/1#issuecomment-430215480, or mute the threadhttps://github.com/notifications/unsubscribe-auth/Aj6iZ9cpf14vOtiHJX9IFdC1q_VhheDRks5ulc7dgaJpZM4XZzXX.


This email has been scanned by the Symantec Email Security.cloud service. For more information please visit http://www.symanteccloud.com


For the latest data on the economy and society, consult our website at http://www.ons.gov.uk


Please Note: Incoming and outgoing email messages are routinely monitored for compliance with our policy on the use of electronic communications


Legal Disclaimer: Any views expressed by the sender of this message are not necessarily those of the Office for National Statistics


Norric1Admin commented 5 years ago

I think that to add an embed to the UK/split site, three variables must be in the metadata... data_geocode_regex: ^E data_show_map: true embedded_map_html:

For the Ghana version of the site, only two variables (excl. data_geocode_regex) are required.

Embed maps are NOT currently working for the ONSDigital site - the sandpit site is now rendering maps from Brock's remote Jekyll build, which contains the file _layout/indicator.html (< old version). When this is included into the ONs site, then we will be able to embed maps.

brockfanning commented 5 years ago

@Norric1Admin In the sandpit UK site, I've not got embedded maps showing without any special fields or data. All that's required is the embedded_map_html field. See 3.2.1 for an example.

I did this by separating out the embedded maps into their own separate tab (also labeled "Map"). This way they are completely separate from the logic/requirements of the Mango maps.

Norric1Admin commented 5 years ago

This problem is resolved, with the main problem now being the making the embedded map functional (missing chart and faulty timeseries line - https://github.com/Norric1Admin/maptemplates/issues/2).

Ensure that data_show_map is set to 'false' (unless the CSV has no GeoCode column), and embedded_map_html contains an iframe in the format:

data_geocode_regex and data_show_map fields are not required.