PHP code example of janpieterk / gemeentekaart-core
1. Go to this page and download the library: Download janpieterk/gemeentekaart-core library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$kaart = new Kaart(); // equals new Kaart('municipalities');
$kaart = new Kaart('provinces');
$kaart = new Kaart('gemeentes', 1921);
$kaart = new Kaart();
$kaart->setPathsFile($alternative_paths_file);
// adding dialect areas to map of municipalities
$kaart = new Kaart('gemeentes');
$kaart->setAdditionalPathsFiles(array('dialectareas.json'));
$kaart = new Kaart('gemeentes');
$kaart->setAdditionalPathsFiles(array('municipalities_flanders.json', 'border_nl_be.json'));
$kaart->setIniFile('municipalities_nl_flanders.ini');
$kaart = new Kaart();
$data = array('g_0534' => '#FFC513');
$kaart->setData($data);
$kaart = new Kaart('gemeentes', 1950);
$kaart->setData(array("a_11150" => "#990000"); // note the Amsterdam code instead of the CBS code
$kaart = new Kaart('corop');
$kaart->setTitle('The 40 COROP areas');
$kaart = new Kaart('provincies');
$kaart->setInteractive();
// set a picture width of 500 pixels
$kaart = new Kaart();
$kaart->setPixelWidth(500);
// create a square 500 * 500 map
$kaart = new Kaart();
$kaart->setPixelWidth(500);
$kaart->setPixelHeight(500);
$kaart = new Kaart();
$kaart->setLink('https://www.example.com/?code=%s');
// now all areas have a link
$kaart = new Kaart();
$kaart->setData(array('g_0363' => '#FFC513'));
$kaart->setLinkHighlighted('http://www.example.com/?code=%s');
// now only area g_0363 (Amsterdam) has a link
// http://www.example.com/?code=g_0363