Simon Hunt

UI topo - remove 'world' from map options (creates sluggish response)

 - (need a custom topojson file for world)
 - removed $loc and tspr as function parameters, since they are in the closure.

Change-Id: I30737eb63be3fd7cfb3bd0572621401024a66efa
......@@ -42,17 +42,16 @@ class MapSelectorMessageHandler extends UiMessageHandler {
private static final List<Map> SUPPORTED_MAPS =
ImmutableList.of(new Map("australia", "Australia", 1.0),
new Map("ns_america", "North, Central and South America", 0.7),
new Map("s_america", "South America", 0.9),
new Map("usa", "United States", 1.0),
new Map("bayarea", "Bay Area, California", 1.0),
new Map("europe", "Europe", 2.5),
new Map("italy", "Italy", 0.8),
new Map("uk", "United Kingdom and Ireland", 0.6),
new Map("japan", "Japan", 0.8),
new Map("s_korea", "South Korea", 0.75),
new Map("taiwan", "Taiwan", 0.7),
new Map("world", "World", 1.0));
new Map("ns_america", "North, Central and South America", 0.7),
new Map("s_america", "South America", 0.9),
new Map("usa", "United States", 1.0),
new Map("bayarea", "Bay Area, California", 1.0),
new Map("europe", "Europe", 2.5),
new Map("italy", "Italy", 0.8),
new Map("uk", "United Kingdom and Ireland", 0.6),
new Map("japan", "Japan", 0.8),
new Map("s_korea", "South Korea", 0.75),
new Map("taiwan", "Taiwan", 0.7));
@Override
protected Collection<RequestHandler> createRequestHandlers() {
......
......@@ -307,12 +307,6 @@
var countryFilters = {
world: function (c) {
return c.properties.continent !== 'Antarctica';
},
// NOTE: for "usa" we are using our hand-crafted topojson file
s_america: function (c) {
return c.properties.continent === 'South America';
},
......@@ -375,7 +369,7 @@
function setMap(map) {
ps.setPrefs('topo_mapid', map);
setUpMap($loc);
setUpMap();
opacifyMap(true);
}
......@@ -387,7 +381,7 @@
);
}
function setUpMap($loc) {
function setUpMap() {
var prefs = currentMap(),
mapId = prefs.mapid,
mapScale = prefs.mapscale,
......@@ -430,7 +424,7 @@
})
} else {
shadeFlip = 0;
cfilter = countryFilters[mapId] || countryFilters.world;
cfilter = countryFilters[mapId] || countryFilters.uk;
promise = ms.loadMapRegionInto(mapG, {
countryFilter: cfilter,
adjustScale: mapScale,
......@@ -459,7 +453,7 @@
.attr('opacity', b ? 1 : 0);
}
function setUpSprites($loc, tspr) {
function setUpSprites() {
var prefs = ps.getPrefs('topo_sprites', { sprites: '' }, $loc.search()),
sprId = prefs.sprites;
......@@ -629,7 +623,7 @@
setUpDefs();
setUpZoom();
setUpNoDevs();
setUpMap($loc).then(
setUpMap().then(
function (proj) {
var z = ps.getPrefs('topo_zoom', { tx:0, ty:0, sc:1 });
zoomer.panZoom([z.tx, z.ty], z.sc);
......@@ -651,7 +645,7 @@
}
);
tes.bindHandlers();
setUpSprites($loc, tspr);
setUpSprites();
forceG = zoomLayer.append('g').attr('id', 'topo-force');
tfs.initForce(svg, forceG, uplink, dim);
......