Maps » Usage

Copyright© 2005 Peter Taurins

Maps are free software; you can redistribute it and/or modify it under the terms of the Creative Commons

Maps are distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Creative Commons License for more details.

The software expects the font files to be in /resources so ensure that you place your TTF (True Type Font) file in the /resources direcory.

Create a new file, call it example.php

Include the software (amending the path as necessary) and set the variables:
Australia and New Zealand Map example.

  • require($_SERVER["DOCUMENT_ROOT"]."/maps/map_anz.php");
  • $my_map = new mapANZ();
  • $my_map->setTitle("Map of Australia and New Zealand");
  • $my_map->setState(array("qld", "nsw", "act", "vic", "tas", "sa", "wa", "nt", "ni", "si"));
  • $my_map->setValue(array(10, 20, 30, 40, 50, 60, 70, 80, 90, 100));
  • $my_map->setColor(array("FF0000", "FFFF00", "FFFFFF", "CC0000", "CCCC00", "CCCCCC", "990000", "999900", "999999", "660000"));
  • my_map->drawMap();

Include the software (amending the path as necessary) and set the variables:
United States of America Map example.

  • require($_SERVER["DOCUMENT_ROOT"]."/maps/map_usa.php");
  • $my_map = new mapUSA();
  • $my_map->setTitle("Map of Unites States of America");
  • $my_map->setState(array("ma", "ca", "co", "ks", "mo", "wa", "tx", "fl", "il", "ri", "nd"));
  • $my_map->setColor(array("FF0000", "FFFF00", "FF9999", "CC0000", "CCCC00", "CCCCCC", "990000", "999900", "999999", "666600", "990000"));
  • $my_map->drawMap();

Include the software (amending the path as necessary) and set the variables:
World Map example.

  • require($_SERVER["DOCUMENT_ROOT"]."/maps/map_world.php");
  • $my_map = new mapworld();
  • $my_map->setTitle("Map of the World");
  • $my_map->setState(array("au", "us", "gb", "my", "mz", "na", "nc", "ne", "nf", "ng", "ni", ));
  • $my_map->setColor(array("FF0000", "FFFF00", "FF9999", "CC0000", "CCCC00", "CCCCCC", "990000", "999900", "999999", "660000"));
  • $my_map->drawMap();

Generate the image either by calling the file example.php directly in your browser or by wrapping it in an image tag for display on your webpage.
<img src="example.php">