simplemaps

Labels | Documentation

Labels exist by default in the US, North America, and Canada Maps. Labels must be attached to either a region, a state or a location. They will share hover and click events with their parent.

Label Properties (these overwrite the properties in the main settings)
name The name of the label.
x The x coordinate of the label. Learn how to find x/y coordinates at the end of this page.
y The y coordinate of the label. Learn how to find x/y coordinates at the end of this page.
parent_type The type of the parent. ['state', 'region', 'location']
parent_id The id of the parent. (e.g. '0')
hide 'yes' makes the label invisible.
line If 'yes' and the parent is a location, a line will be drawn from the location to the label. Lines cannot be used with display: 'all',
line_color If a line exists, the color of the line. (e.g. 'black' or '#000000')
anchor The orientation of the text relative to the x/y coordinate. ('start', 'middle', 'end')
pill If 'yes', and the parent is a state, the label will have a pill with the same color as the parent.
width Only relevant if pill:'yes',. This is the width of the pill. If not specified, the pill will grow to fit the label.
display Where should the label be visible. Options are: 'all', 'out', 'region', 'state'.
font The font family for the label. (e.g. 'Arial')
size The size of the label font in pixels
color The color of the label. (e.g. 'black' or '#000000')
hover_color The color of the label upon hover. (e.g. 'black' or '#000000')

Some states contain default labels. These can be overwritten in the mapdata.js file. Below are the default labels for the United States:

You can copy and paste the above object into your mapdata.js file and make any changes you desire.


How to Find X/Y Coordinates


First, choose the map you want to install:

  1. Open the map in Chrome
  2. Click F12 to go to Developer Tools
  3. Click on the Console tab
  4. Enter the command simplemaps_worldmap.get_xy();
  5. Click somewhere on the map
  6. You'll get a prompt that gives you the x/y coordinates

HTML5 Map Documentation v3.2

The current version is 3.2. Older docs: 3.0, 2.9
Already a customer and need to update?

Customization

Installation

Common Questions

Troubleshooting

JavaScript API

© Simplemaps.com 2010-2015 | License | Privacy Policy | Releases | Testimonials | Resources | Documentation
Deprecated Maps: Flash USA Map | Flash World Map | Flash Canada Map | Flash Europe Map | Flash Congress Map
Formerly FlashUSAmap.com and Flashworldmap.com