Skip to content

Map Polygon ​

The {maps:add_polygon} tag, for use inside the {exp:reinos_maps:map} tag

A polygon on a map

The tag ​

{exp:reinos_maps:map}
	{maps:add_polygon
		addresses="den-helder|zwolle|deventer|gorssel|arnhem|klarenbeek|apeldoorn"
	}
{/exp:reinos_maps:map}

Tag parameters ​

Below are the Tag Parameters. Those parameters can be used in the tag described above.

addresses ​

The addresses of the corners of the polygon, at least 3, separated with a pipe |.

addresses=""

latlngs ​

The latlngs of the corners of the polygon, at least 3, separated with a pipe |.

latlngs=""

json ​

A JSON list of [lat, lng] points, instead of addresses or latlngs. For a polygon with holes, give a list of rings: the outer ring first, then the holes, e.g. json='[[[52.1,5.1],[52.2,5.1],[52.2,5.2]],[[52.14,5.14],[52.16,5.14],[52.16,5.16]]]'(from v5.0.0).

json="
	[
			[39.74732195489861, -105.00432014465332],
		[39.74620006835170, -105.00715255737305],
		[39.74468219277038, -105.00921249389647],
		[39.74362625960105, -105.01067161560059],
		[39.74290029616054, -105.01195907592773],
		[39.74078835902781, -105.00989913940431],
		[39.74059036160317, -105.00758171081543],
		[39.74059036160317, -105.00346183776855],
		[39.74059036160317, -105.00097274780272],
		[39.74072235994946, -105.00062942504881],
		[39.74191033368865, -105.00020027160645],
		[39.74276830198601, -105.00071525573731],
		[39.74369225589818, -105.00097274780272],
		[39.74461619742136, -105.00097274780272],
		[39.74534214278395, -105.00123023986816],
		[39.74613407445653, -105.00183105468751],
		[39.74732195489861, -105.00432014465332],
		[39.74354376414072, -105.00361204147337],
		[39.74278480127163, -105.00301122665405],
		[39.74316428375108, -105.00221729278564],
		[39.74390674342741, -105.00283956527711],
		[39.74354376414072, -105.00361204147337],
		[39.73989736613708, -105.00942707061768],
		[39.73910536278566, -105.00942707061768],
		[39.73923736397631, -105.00685214996338],
		[39.73910536278566, -105.00384807586671],
		[39.73903936209552, -105.00174522399902],
		[39.73910536278566, -105.00041484832764],
		[39.73979836621592, -105.00041484832764],
		[39.73986436617916, -105.00535011291504],
		[39.73989736613708, -105.00942707061768]
	]
	"

stroke:enable ​

Enable the stroke

stroke:enable="yes"

stroke:color ​

set the stroke color.

stroke:color="#000000" [OPTIONAL]

stroke:opacity ​

set the stroke opacity..

stroke:opacity="1" [OPTIONAL]

stroke:weight ​

Set the stroke weight

stroke:weight="1" [OPTIONAL]

fill:enable ​

Enable the fill option

fill:enable="yes"

fill:opacity ​

set the fill opacity.

fill:opacity="0.4" [OPTIONAL]

fill:color ​

set the fill color

fill:color="#000000" [OPTIONAL]

class ​

Set a class for the polygon object

class="maps_polygon" [OPTIONAL]

tooltip:content ​

set the tooltip content.

tooltip:content="" [OPTIONAL]

tooltip:direction ​

Direction where to open the tooltip. Possible values are: right, left, top, bottom, center, auto.

auto will dynamically switch between right and left according to the tooltip position on the map.

tooltip:direction="auto" [OPTIONAL]

tooltip:permanent ​

Whether to open the tooltip permanently or only on mouseover.

tooltip:permanent="no" [OPTIONAL]

tooltip:sticky ​

If yes, the tooltip will follow the mouse instead of being fixed at the center.

tooltip:sticky="no" [OPTIONAL]

The content for the popup (infowindow) e.g: <h1>Yeah</h1>

Note for complex HTML (e.g. from a WYSIWYG editor) use the encode tag

popup:content="" [OPTIONAL]

Specify the max width for the popup

popup:max_width="300" [OPTIONAL]

Specify the min width for the popup

popup:min_width="50" [OPTIONAL]

Open the popup on hover

popup:open_on_hover="no" [OPTIONAL]

Open the popup by default

possible values no|yes

popup:open_by_default="no" [OPTIONAL]

Close the popup when another popup is opened.

In case if you want to open 2 or more popups by default, you can combine this with popup:open_by_default="yes"

possible values no|yes

popup:auto_close="yes" [OPTIONAL]

category ​

The categories of the polygon, separated by |, for the legend of the map (filter="yes") (from v5.0.0)

category="Shops|Food" [OPTIONAL]

keys ​

The keys to find the polygon with the Javascript API. By default a polygon can be found by its number (1 for the first polygon). Use this param to add your own keys.

Use a colon : to give it multiple keys

keys="key1_for_the_first_polygon:key2_for_the_first_polygon"