},
mapParams: function (search) {
- var params = OSM.params(search), mapParams = {}, bounds, loc, match;
+ var params = OSM.params(search), mapParams = {}, loc, match;
if (params.mlon && params.mlat) {
mapParams.marker = true;
mapParams.note = parseInt(params.note);
}
- if (params.bbox) {
- params.bbox = params.bbox.split(',');
- bounds = L.latLngBounds(
- [parseFloat(params.bbox[1]),
- parseFloat(params.bbox[0])],
- [parseFloat(params.bbox[3]),
- parseFloat(params.bbox[2])]);
- } else if (params.minlon && params.minlat && params.maxlon && params.maxlat) {
- bounds = L.latLngBounds(
- [parseFloat(params.minlat),
- parseFloat(params.minlon)],
- [parseFloat(params.maxlat),
- parseFloat(params.maxlon)]);
- }
-
var hash = OSM.parseHash(location.hash);
// Decide on a map starting position. Various ways of doing this.
mapParams.lat = hash.center.lat;
mapParams.zoom = hash.zoom;
mapParams.object_zoom = false;
- } else if (bounds) {
- mapParams.lon = bounds.getCenter().lng; // Not used by main map, but
- mapParams.lat = bounds.getCenter().lat; // are used by iD/Potlatch.
- mapParams.bounds = bounds;
- mapParams.object_zoom = false;
} else if (params.lon && params.lat) {
mapParams.lon = parseFloat(params.lon);
mapParams.lat = parseFloat(params.lat);