[openstreetmap/openstreetmap-website] Show notes more often (Issue #3971)

mmd notifications at github.com
Sun Jan 19 21:06:39 UTC 2025


The issue here is in osm.js.erb: if mlon and mlat are set, we're not initializing "loc" from the _osm_location cookie. Later on we cannot set mapParams.layers, since "loc" should be nil at this time. This impacts both the notes layer, as well as the map layer.

```javascript
    } else if (params.mlon && params.mlat) {
      mapParams.lon = parseFloat(params.mlon);
      mapParams.lat = parseFloat(params.mlat);
      mapParams.zoom = parseInt(params.zoom || 12);
    } else if (loc = Cookies.get('_osm_location')) {
      loc = loc.split("|");
      mapParams.lon = parseFloat(loc[0]);
      mapParams.lat = parseFloat(loc[1]);
      mapParams.zoom = parseInt(loc[2]);
```

```javascript
    mapParams.layers = hash.layers || (loc && loc[3]) || '';
```

//CC:  fyi @AntonKhorev 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/3971#issuecomment-2601021733
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/issues/3971/2601021733 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250119/702d3d4c/attachment-0001.htm>


More information about the rails-dev mailing list