GUI - topo view: enhancements to allow scaling of bay area map.
Change-Id: Iabd50b529eb3f247463a71d29f7c447806c3afe7
diff --git a/web/gui/src/main/webapp/app/fw/svg/geodata.js b/web/gui/src/main/webapp/app/fw/svg/geodata.js
index 6c54bb4..815937d 100644
--- a/web/gui/src/main/webapp/app/fw/svg/geodata.js
+++ b/web/gui/src/main/webapp/app/fw/svg/geodata.js
@@ -132,7 +132,7 @@
mfs = settings.mapFillScale,
path = d3.geo.path().projection(proj);
- rescaleProjection(proj, mfs, dim, path, geoData);
+ rescaleProjection(proj, mfs, dim, path, geoData, opts.adjustScale);
// return the results
return {
@@ -142,7 +142,8 @@
};
}
- function rescaleProjection(proj, mfs, dim, path, geoData) {
+ function rescaleProjection(proj, mfs, dim, path, geoData, adjustScale) {
+ var adj = adjustScale || 1;
// adjust projection scale and translation to fill the view
// with the map
@@ -161,7 +162,7 @@
y = (y1 + y2) / 2;
// size map to 95% of minimum dimension to fill space..
- var s = mfs / Math.min(dx / dim, dy / dim),
+ var s = (mfs / Math.min(dx / dim, dy / dim)) * adj,
t = [dim / 2 - s * x, dim / 2 - s * y];
// set new scale, translation on the projection..
diff --git a/web/gui/src/main/webapp/app/fw/svg/map.js b/web/gui/src/main/webapp/app/fw/svg/map.js
index f8d40f9..c24fb28 100644
--- a/web/gui/src/main/webapp/app/fw/svg/map.js
+++ b/web/gui/src/main/webapp/app/fw/svg/map.js
@@ -56,11 +56,13 @@
deferredProjection.resolve(gen.settings.projection);
- mapLayer.selectAll('path')
+ var path = mapLayer.selectAll('path')
.data(gen.geodata.features)
.enter()
.append('path')
.attr('d', gen.pathgen);
+
+ opts.fill && path.style('fill', opts.fill);
});
return deferredProjection.promise;
}