Drag the prefab “WorldMap2D” from “Resources/Prefabs” folder to your scene. Select the GameObject created to show custom properties:
Custom Editor Properties
Fit Width/Height/Center Map: controls and center how the map can be moved over the screen.
Show Earth: shows/hide the Earth. You can for example hide the Earth and show only frontiers giving a look of futuristic UI.
You may want to not hide the Earth, but instead use the Solid Color style, which will hide the Earth, but will prevent the geographic elements and lines to be seen when they’re on the back of the sphere.
Show Latitude/Longitude Lines: will activate/deactivate the layers of the grid. The stepping options allow you to specify the separation in degrees between lines (for longitude is the number of lines).
Grid Color: modifies the color of the material of the grid (latitude and longitude lines).
Show Cities: activate/deactivate the layer of cities.
- Min Population (K): allows to filter cities from current catalog based on population (K = in thousands). When you move the slider to the right/left you will see the number of cities drawn below. Setting this to 0 (zero) will make all cities in the catalog visible.
- Show Frontiers: show/hide all frontiers. It applies to all countries, however you can colorize individual countries using the API.
- Frontiers Color: will change the color of the material used for all frontiers.
- Country Highlight Enabled: when activated, the countries will be highlighted when mouse hovers them. Current active country can be determined using countryHighlighted
- Country Highlight Color: fill color for the highlighted country. Color of the country will revert back to the colorized color if used.
- Draw Outline and Outline Color: draws a colored border around the colorized or highlighted country.
- Show Country Names: when enabled, country labels will be drawn and blended with the Earth map. This feature uses RenderTexture and has the following options:
- Labels Quality: controls the size of the RenderTexture, thus affecting to the resolution of the labels shown in the map. Low quality uses a texture of 2048×1024, Medium 4096×2048 and High 8192×4096.
- Relative Size: controls the amount of “fitness” for the labels. A high value will make labels grow to fill the country area.
- Minimum Size: specifies the minimum size for all labels. This value should be let low, so smaller areas with many countries don’t overlap.
- Font: allows you to choose a different default font for labels (factory default is “Lato”). Note that using the decorator component you can assign individual fonts to countries.
- Labels and shadow color: they affect the Font material color and alpha value used for both labels and shadows. If you need to change individual label, you can get a reference to the TextMesh component of each label with Country.labelGameObject field.
- Show Cursor: will display a cross centered on mouse cursor. Current location of cursor can be obtained with cursorLocation property when mouseOver property is true.
- Respect Other UI: prevents map interactions while pointer is on UI (buttons, labels, …)
- Navigation Time: time in seconds for the fly to commands. Set it to zero to instant movements.
- Autorotation Speed: will make the Earth continuously rotate around its axis. Set it to zero to disable autorotation.
- Allow User Rotation: whether the user can rotate the Earth with the mouse. You can implement your own interactions setting this to false and modifying the rotation / position fields of the gameObject transform.
- Allow User Zoom: wether the user can zoom in/out the Earth with the mouse wheel.
- Zoom Speed: multiplying factor to the zoom in/out caused by the mouse Wheel (Allow User Zoom must be set to true for this setting to have any effect).
Choose Reset option from the gear icon to revert values to factory defaults.