This is a clickable map of canada:
The highlighted regions include the provinces Alberta, British Columbia, Manitoba and Saskatchewan and the three territories Northwest Territories, Nunavut, and Yukon. The provinces New Brunswick, Newfoundland and Labrador, Nova Scotia, Ontario, Prince Edward Island and Quebec are not highlighted.
The map contains JavaScript code that is executed when a region is clicked. It opens a new window with the corresponding Wikipedia article of the clicked region. The following (simple) code is stored in the map template:
window.open(click_value);
The click value can be defined for each region individually. In this example it contains the URL to the article.
Additionally the map has a custom cursor for all highlighted regions. The following rule was added to the map template:
#{cssid} path:not([fill="#f5f5f5"]) {
cursor: pointer;
}
This will set the “pointer” cursor for all regions that have another color than “#f5f5f5”. The “dataless region color” defines the color for all regions that were not highlighted. In this example the color is set to “#f5f5f5”. Thats why the cursor stays normal when moving the mouse pointer over these regions.
This specific cursor-rule is useful to simulate a link. It is not necessary, but a good way to indicate that the user can interact with this part of the map. The map can easily be imported to the plugin.
Copy the following text and click on "Import" in the plugin.
Map settings
Name |
Value |
Description |
Region |
Canada |
List with all available regions |
Width |
auto |
Width of the map in pixel. 'Auto' means that the map is centered in the available width. |
Height |
auto |
Height of the map in pixel. 'Auto' means that the map is centered in the available height. |
Display mode |
Regions |
Specifies the display mode of the map. |
Border resolution |
Provinces |
The resolution of the map borders. |
Tooltips |
On |
Allows to display a tooltip for highlighted map elements. |
Tooltips: Trigger |
focus |
The user interaction that causes the tooltip to be displayed. |
Tooltips: Use HTML |
Off |
Specifies if the tooltips should use HTML. This allows to customize the tooltips even more. For example, if this property is on, it is possible to display images wihtin the tooltip. |
Map template
CSS |
#{cssid} path:not([fill="#f5f5f5"]) {
cursor: pointer;
} |
HTML |
<div id="{cssid}">
%%map%%
</div> |
JavaScript
Executed when a marker/region is clicked.
Click value can be defined for each map element.
|
window.open(click_value); |
Map elements (7)
Color |
Name |
Click Value |
|
CA-YT |
http://en.wikipedia.org/wiki/Yukon |
|
CA-BC |
http://en.wikipedia.org/wiki/British_Columbia |
|
CA-AB |
http://en.wikipedia.org/wiki/Alberta |
|
CA-SK |
http://en.wikipedia.org/wiki/Saskatchewan |
|
CA-NT |
http://en.wikipedia.org/wiki/Northwest_Territories |
|
CA-MB |
http://en.wikipedia.org/wiki/Manitoba |
|
CA-NU |
http://en.wikipedia.org/wiki/Nunavut |
Comments
If you need help or have questions, please leave a comment.