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
......@@ -51,8 +51,7 @@ class MapSelectorMessageHandler extends UiMessageHandler {
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("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);
......