[openstreetmap-website] Move param-based map configuration to client (#94)

Tom Hughes notifications at github.com
Sun Sep 16 17:04:58 BST 2012


> +    mapParams.minlon = parseFloat(params.minlon);
> +    mapParams.minlat = parseFloat(params.minlat);
> +    mapParams.maxlon = parseFloat(params.maxlon);
> +    mapParams.maxlat = parseFloat(params.maxlat);
> +    mapParams.object_zoom = false;
> +  } else if (params.lon && params.lat) {
> +    mapParams.lon = parseFloat(params.lon);
> +    mapParams.lat = parseFloat(params.lat);
> +    mapParams.zoom = parseInt(params.zoom || 5);
> +    mapParams.object_zoom = false;
> +  } else if (params.mlon && params.mlat) {
> +    mapParams.lon = parseFloat(params.mlon);
> +    mapParams.lat = parseFloat(params.mlat);
> +    mapParams.zoom = parseInt(params.zoom || 12);
> +    mapParams.object_zoom = false;
> +  } else if (loc = document.cookie.replace(/(?:^|.*;\s*)_osm_location\s*=\s*((?:[^;](?!;))*[^;]?).*/, "$1")) {

This condition is evaluating as true even when there is no cookie, meaning that we never try any of the options which follow.

---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/94/files#r1614758
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20120916/c9e3e157/attachment.html>


More information about the rails-dev mailing list