odileeds / ukpowernetworks

UK Power Network's potential future scenarios as defined in the National Grid Future Energy Scenarios (DFES).
1 stars 1 forks source link

Add place name labels to map #24

Closed slowe closed 2 years ago

slowe commented 2 years ago

As @ash001j points out, we don't have place name labels on the map.

slowe commented 2 years ago

I wasn't sure what this was due to. My first thought was that it was the tile server that provides the labels as the labels are a separate set of tiles so that they can sit on top of the heat map rather than under it. But those tiles were loading. Next I lookeded at warnings in the console. There was one about memory usage so I tried making the map area smaller but it didn't fix it. Next I looked at a warning I was unfamiliar with:

This page uses the non standard property “zoom”. Consider using calc() in the relevant property values, or using “transform” along with “transform-origin: 0 0”.

This looked like a CSS issue. This warning wasn't there last year as far as I remember. None of our CSS uses the zoom property so that narrowed it down to either the noUIslider (sliders) or Leaflet (map) libraries. The leaflet.css file did seem to use a zoom. I've updated Leaflet to the latest stable version (1.7.1) - the release notes say that browsers have changed how touchscreens work which broke some things in version 1.6. Updating that library (making sure to retain our DFES/leaflet style modifications) removes the console warning and seems to bring labels back.