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

Tom MacWright notifications at github.com
Thu Sep 13 14:05:54 BST 2012


> +    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")) {
> +    loc = loc.split("|");
> +    mapParams.lon = parseFloat(loc[0]);
> +    mapParams.lat = parseFloat(loc[1]);
> +    mapParams.zoom = parseInt(loc[2]);
> +    mapParams.layers = loc[3];
> +  } else if (OSM.home) {

Are there really 8 different sources for the map center? We should really unify these if so.

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


More information about the rails-dev mailing list