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/2601021...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to