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
Showing
2 changed files
with
16 additions
and
23 deletions
... | @@ -42,17 +42,16 @@ class MapSelectorMessageHandler extends UiMessageHandler { | ... | @@ -42,17 +42,16 @@ class MapSelectorMessageHandler extends UiMessageHandler { |
42 | 42 | ||
43 | private static final List<Map> SUPPORTED_MAPS = | 43 | private static final List<Map> SUPPORTED_MAPS = |
44 | ImmutableList.of(new Map("australia", "Australia", 1.0), | 44 | ImmutableList.of(new Map("australia", "Australia", 1.0), |
45 | - new Map("ns_america", "North, Central and South America", 0.7), | 45 | + new Map("ns_america", "North, Central and South America", 0.7), |
46 | - new Map("s_america", "South America", 0.9), | 46 | + new Map("s_america", "South America", 0.9), |
47 | - new Map("usa", "United States", 1.0), | 47 | + new Map("usa", "United States", 1.0), |
48 | - new Map("bayarea", "Bay Area, California", 1.0), | 48 | + new Map("bayarea", "Bay Area, California", 1.0), |
49 | - new Map("europe", "Europe", 2.5), | 49 | + new Map("europe", "Europe", 2.5), |
50 | - new Map("italy", "Italy", 0.8), | 50 | + new Map("italy", "Italy", 0.8), |
51 | - new Map("uk", "United Kingdom and Ireland", 0.6), | 51 | + new Map("uk", "United Kingdom and Ireland", 0.6), |
52 | - new Map("japan", "Japan", 0.8), | 52 | + new Map("japan", "Japan", 0.8), |
53 | - new Map("s_korea", "South Korea", 0.75), | 53 | + new Map("s_korea", "South Korea", 0.75), |
54 | - new Map("taiwan", "Taiwan", 0.7), | 54 | + new Map("taiwan", "Taiwan", 0.7)); |
55 | - new Map("world", "World", 1.0)); | ||
56 | 55 | ||
57 | @Override | 56 | @Override |
58 | protected Collection<RequestHandler> createRequestHandlers() { | 57 | protected Collection<RequestHandler> createRequestHandlers() { | ... | ... |
... | @@ -307,12 +307,6 @@ | ... | @@ -307,12 +307,6 @@ |
307 | 307 | ||
308 | 308 | ||
309 | var countryFilters = { | 309 | var countryFilters = { |
310 | - world: function (c) { | ||
311 | - return c.properties.continent !== 'Antarctica'; | ||
312 | - }, | ||
313 | - | ||
314 | - // NOTE: for "usa" we are using our hand-crafted topojson file | ||
315 | - | ||
316 | s_america: function (c) { | 310 | s_america: function (c) { |
317 | return c.properties.continent === 'South America'; | 311 | return c.properties.continent === 'South America'; |
318 | }, | 312 | }, |
... | @@ -375,7 +369,7 @@ | ... | @@ -375,7 +369,7 @@ |
375 | 369 | ||
376 | function setMap(map) { | 370 | function setMap(map) { |
377 | ps.setPrefs('topo_mapid', map); | 371 | ps.setPrefs('topo_mapid', map); |
378 | - setUpMap($loc); | 372 | + setUpMap(); |
379 | opacifyMap(true); | 373 | opacifyMap(true); |
380 | } | 374 | } |
381 | 375 | ||
... | @@ -387,7 +381,7 @@ | ... | @@ -387,7 +381,7 @@ |
387 | ); | 381 | ); |
388 | } | 382 | } |
389 | 383 | ||
390 | - function setUpMap($loc) { | 384 | + function setUpMap() { |
391 | var prefs = currentMap(), | 385 | var prefs = currentMap(), |
392 | mapId = prefs.mapid, | 386 | mapId = prefs.mapid, |
393 | mapScale = prefs.mapscale, | 387 | mapScale = prefs.mapscale, |
... | @@ -430,7 +424,7 @@ | ... | @@ -430,7 +424,7 @@ |
430 | }) | 424 | }) |
431 | } else { | 425 | } else { |
432 | shadeFlip = 0; | 426 | shadeFlip = 0; |
433 | - cfilter = countryFilters[mapId] || countryFilters.world; | 427 | + cfilter = countryFilters[mapId] || countryFilters.uk; |
434 | promise = ms.loadMapRegionInto(mapG, { | 428 | promise = ms.loadMapRegionInto(mapG, { |
435 | countryFilter: cfilter, | 429 | countryFilter: cfilter, |
436 | adjustScale: mapScale, | 430 | adjustScale: mapScale, |
... | @@ -459,7 +453,7 @@ | ... | @@ -459,7 +453,7 @@ |
459 | .attr('opacity', b ? 1 : 0); | 453 | .attr('opacity', b ? 1 : 0); |
460 | } | 454 | } |
461 | 455 | ||
462 | - function setUpSprites($loc, tspr) { | 456 | + function setUpSprites() { |
463 | var prefs = ps.getPrefs('topo_sprites', { sprites: '' }, $loc.search()), | 457 | var prefs = ps.getPrefs('topo_sprites', { sprites: '' }, $loc.search()), |
464 | sprId = prefs.sprites; | 458 | sprId = prefs.sprites; |
465 | 459 | ||
... | @@ -629,7 +623,7 @@ | ... | @@ -629,7 +623,7 @@ |
629 | setUpDefs(); | 623 | setUpDefs(); |
630 | setUpZoom(); | 624 | setUpZoom(); |
631 | setUpNoDevs(); | 625 | setUpNoDevs(); |
632 | - setUpMap($loc).then( | 626 | + setUpMap().then( |
633 | function (proj) { | 627 | function (proj) { |
634 | var z = ps.getPrefs('topo_zoom', { tx:0, ty:0, sc:1 }); | 628 | var z = ps.getPrefs('topo_zoom', { tx:0, ty:0, sc:1 }); |
635 | zoomer.panZoom([z.tx, z.ty], z.sc); | 629 | zoomer.panZoom([z.tx, z.ty], z.sc); |
... | @@ -651,7 +645,7 @@ | ... | @@ -651,7 +645,7 @@ |
651 | } | 645 | } |
652 | ); | 646 | ); |
653 | tes.bindHandlers(); | 647 | tes.bindHandlers(); |
654 | - setUpSprites($loc, tspr); | 648 | + setUpSprites(); |
655 | 649 | ||
656 | forceG = zoomLayer.append('g').attr('id', 'topo-force'); | 650 | forceG = zoomLayer.append('g').attr('id', 'topo-force'); |
657 | tfs.initForce(svg, forceG, uplink, dim); | 651 | tfs.initForce(svg, forceG, uplink, dim); | ... | ... |
-
Please register or login to post a comment