Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

--simplify-proportion is a little bit trial and error in finding the perfect number.

Lastly we need to change the name of the 

Adding the topojson to an application

Add the file to the webapp/data/maps folder 

Code Block
languagejava
linenumberstrue
UiTopoMapFactory topoMapFactory =
        () -> ImmutableList.of(
                new UiTopoMap("south_america", "South America", "*south_america", 0.9)
        );

return new UiExtension.Builder(CL, coreViews)
        .messageHandlerFactory(messageHandlerFactory)
        .topoOverlayFactory(topoOverlayFactory)
        .topoMapFactory(topoMapFactory)
        .resourcePath(CORE)
        .build();

UiTopoMap(String id, String description, String path, Double scale);

Id: is the string found within the topojson file.

Code Block
{
	"type": "Topology",
	"objects": {
		"s_america": {} //This is the Id
	}
} 

Description: The name to appear in the maps drop down menu
Path: The path to the topojson resource ('*' is a place holder for ~/data/maps) 
Scale: Sets the map scale