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

Tom Hughes notifications at github.com
Mon Sep 17 19:17:46 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")) {

I wonder if we should think about using something like https://github.com/carhartl/jquery-cookie rather than parsing the cookies ourselves, to make this easier?

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


More information about the rails-dev mailing list