[Pro] Custom Click Actions
In the Pro version you’re able to execute custom Javascript when the marker or region is clicked. The click will trigger a javascript function that will take one parameter, which is an object containing the data for that marker or region.
The function that will run will be similar to the following:
function customCodeExample( data ) {
... your custom code ....
}
So you should use the parameter data in your custom code. Example of a data object:
name: "US"
id: "US"
tooltipContent: "click for more info"
content: "this is the special content for US"
action: "customRegionAction"
value: ""
mapID: "7130"
So if you want to use the content you would use for example:
alert( data.content );
In the editor screen you would have something like:
![[Pro] Custom Click Actions Screenshot for custom code](https://interactivegeomaps.com/wp-content/uploads/2020/01/custom_code_map_wordpress.png)
So the final code that will run will be the following:
function customCodeExample( data ) {
alert( data.content );
}