Overriding options

Although the various options, such as the colour of the polygons, their width, etc., can be set using the Map Configuration screen, you can also set these options by adding some extra code after the embed code on your site.  Think of the Map Configuration options as being the defaults which can be customised on each site where you embed the map.

 Following the embed code, but before the </script> tag, you can enter any number of calls to the "mapamatic" function.  For example, to override the polygon fill colour where at least one person is associated with the area, you would add the following code:

mapamatic('options.styles.candidate.initial.fillColor', '#0000ff');

which will change the initial fill colour to blue (the colour code is in hexadecimal-coded RGB format).

Overriding functions

As well as overriding static configuration settings, you can also override most of the functional behaviour of the map using the "mapamatic" function.  For example, to override the way in which people are displayed on the panel you can use something like this:

mapamatic('panel.people', function(event)
{
return '<h3>' + Mapamatic.panel.entities(event.feature.getProperty('people')) + '</h3>';
});

The above code is actually the default.